Skip to content

BillionMail gives you open-source MailServer, NewsLetter, Email Marketing — fully self-hosted, dev-friendly, and free from monthly fees. Join the discord: https://discord.gg/asfXzBUhZr

Add log saving day parameter

aapanel.com9baa0b925bb1
diff --git a/docker-compose.yml b/docker-compose.yml
index 3ffcbccd..370faecb 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -48,6 +48,7 @@ services:
environment:
- TZ=${TZ}
- REDISPASS=${REDISPASS}
+ - RETENTION_DAYS=${RETENTION_DAYS:-7}
volumes:
- ./conf/rspamd/local.d:/etc/rspamd/local.d
- ./conf/rspamd/statistic.conf:/etc/rspamd/statistic.conf
@@ -85,6 +86,7 @@ services:
- TZ=${TZ}
- BILLIONMAIL_HOSTNAME=${BILLIONMAIL_HOSTNAME}
- REDISPASS=${REDISPASS}
+ - RETENTION_DAYS=${RETENTION_DAYS:-7}
ports:
- "${IMAP_PORT:-143}:143"
- "${IMAPS_PORT:-993}:993"
@@ -125,6 +127,7 @@ services:
- DBPASS=${DBPASS}
- REDISPASS=${REDISPASS}
- BILLIONMAIL_HOSTNAME=${BILLIONMAIL_HOSTNAME}
+ - RETENTION_DAYS=${RETENTION_DAYS:-7}
cap_add:
- NET_BIND_SERVICE
ports:
diff --git a/env_init b/env_init
index 31de0ab5..97f3792e 100644
--- a/env_init
+++ b/env_init
@@ -46,4 +46,7 @@ IPV4_NETWORK=172.66.1
FAIL2BAN_INIT=y
# Console ip whitelist Disabled:false Enabled:true
-IP_WHITELIST_ENABLE=false
\ No newline at end of file
+IP_WHITELIST_ENABLE=false
+
+# Number of days to keep log backup
+RETENTION_DAYS=7
\ No newline at end of file
diff --git a/install.sh b/install.sh
index 3f809112..273181ce 100644
--- a/install.sh
+++ b/install.sh
@@ -1332,6 +1332,9 @@ IPV4_NETWORK=172.66.1
# Enable fail2ban Access restrictions, specify that the IP exceeds the access limit
FAIL2BAN_INIT=y
+# Number of days to keep log backup
+RETENTION_DAYS=7
+
EOF
\cp -rf billionmail.conf .env
if [ ! -f ".env" ]; then
diff --git a/update.sh b/update.sh
index 4f1854e6..6a8cb420 100644
--- a/update.sh
+++ b/update.sh
@@ -281,6 +281,17 @@ Update_BillionMail(){
}
+Update_config() {
+
+ if ! grep "^RETENTION_DAYS=" .env; then
+ echo "" >> .env
+ echo "# Number of days to keep log backup" >> .env
+ echo "RETENTION_DAYS=7" >> .env
+ fi
+
+}
+
+
echo "
+-----------------------------------------------------------------------------
| You are updating BillionMail. This operation will pull the latest code from
@@ -303,4 +314,6 @@ Docker_Compose_Check
Docker_Status_Check
-Update_BillionMail
\ No newline at end of file
+Update_BillionMail
+
+Update_config
\ No newline at end of file