NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Commit

[Dovecot] Check garbage hourly [Dovecot] Update SA rules once when container starts

62b27aea
AndrĂ© <[email protected]> 8 years ago
data/Dockerfiles/dovecot/Dockerfile           | 2 +-
 data/Dockerfiles/dovecot/docker-entrypoint.sh | 3 +++
 generate_config.sh                            | 1 +
 update.sh                                     | 1 +
 4 files changed, 6 insertions(+), 1 deletion(-)

Diff

diff --git a/data/Dockerfiles/dovecot/Dockerfile b/data/Dockerfiles/dovecot/Dockerfile
index 84ecb322..fdfa84f5 100644
--- a/data/Dockerfiles/dovecot/Dockerfile
+++ b/data/Dockerfiles/dovecot/Dockerfile
@@ -92,7 +92,7 @@ RUN cpanm Data::Uniqid Mail::IMAPClient String::Util
 RUN echo '* * * * *   root  /usr/local/bin/imapsync_cron.pl' > /etc/cron.d/imapsync
 RUN echo '30 3 * * *  vmail /usr/local/bin/doveadm quota recalc -A' > /etc/cron.d/dovecot-sync
 RUN echo '* * * * *   vmail /usr/local/bin/trim_logs.sh >> /dev/stdout 2>&1' > /etc/cron.d/trim_logs
-RUN echo '30 2 * * *  vmail /usr/local/bin/maildir_gc.sh >> /dev/stdout 2>&1' > /etc/cron.d/maildir_gc
+RUN echo '25 * * * *  vmail /usr/local/bin/maildir_gc.sh >> /dev/stdout 2>&1' > /etc/cron.d/maildir_gc
 RUN echo '30 1 * * *  root  /usr/local/bin/sa-rules.sh  >> /dev/stdout 2>&1' > /etc/cron.d/sa-rules
 COPY trim_logs.sh /usr/local/bin/trim_logs.sh
 COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
diff --git a/data/Dockerfiles/dovecot/docker-entrypoint.sh b/data/Dockerfiles/dovecot/docker-entrypoint.sh
index 23e3682a..9c249908 100755
--- a/data/Dockerfiles/dovecot/docker-entrypoint.sh
+++ b/data/Dockerfiles/dovecot/docker-entrypoint.sh
@@ -145,4 +145,7 @@ rm -f /tmp/imapsync_busy.lock
 IMAPSYNC_TABLE=$(mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SHOW TABLES LIKE 'imapsync'" -Bs)
 [[ ! -z ${IMAPSYNC_TABLE} ]] && mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "UPDATE imapsync SET is_running='0'"
 
+# Collect SA rules once now
+/usr/local/bin/sa-rules.sh
+
 exec "$@"
diff --git a/generate_config.sh b/generate_config.sh
index 5e8fbf37..a1b5e12e 100755
--- a/generate_config.sh
+++ b/generate_config.sh
@@ -107,6 +107,7 @@ COMPOSE_PROJECT_NAME=mailcowdockerized
 # Garbage collector cleanup
 # Deleted domains and mailboxes are moved to /var/vmail/_garbage/timestamp_sanitizedstring
 # How long should objects remain in the garbage until they are being deleted? (value in minutes)
+# Check interval is hourly
 MAILDIR_GC_TIME=1440
 
 # Additional SAN for the certificate
diff --git a/update.sh b/update.sh
index e38a1e95..12820fd5 100755
--- a/update.sh
+++ b/update.sh
@@ -206,6 +206,7 @@ for option in ${CONFIG_ARRAY[@]}; do
       echo '# Garbage collector cleanup' >> mailcow.conf
       echo '# Deleted domains and mailboxes are moved to /var/vmail/_garbage/timestamp_sanitizedstring' >> mailcow.conf
       echo '# How long should objects remain in the garbage until they are being deleted? (value in minutes)' >> mailcow.conf
+      echo '# Check interval is hourly' >> mailcow.conf
       echo 'MAILDIR_GC_TIME=1440' >> mailcow.conf
     fi
   elif ! grep -q ${option} mailcow.conf; then