diff options
Diffstat (limited to 'debian/exim4-base.cron.daily')
-rw-r--r-- | debian/exim4-base.cron.daily | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/debian/exim4-base.cron.daily b/debian/exim4-base.cron.daily new file mode 100644 index 0000000..9cc30b3 --- /dev/null +++ b/debian/exim4-base.cron.daily @@ -0,0 +1,27 @@ +#!/bin/sh + +# Only do anything if exim4 is actually installed +if [ ! -x /usr/lib/exim4/exim4 ]; then + exit 0 +fi + +# Uncomment the following lines to get daily e-mail reports +#if [ -x /usr/sbin/eximstats ]; then +# eximstats </var/log/exim4/mainlog \ +# | mail postmaster -s"$(hostname) Daily email activity report" +#fi + + +# run tidydb as mail:mail. +alias exim_tidydb_as_mail='start-stop-daemon --start --exec /usr/sbin/exim_tidydb --chuid mail:mail --' + +if [ -x /usr/sbin/exim_tidydb ]; then + cd /var/spool/exim4/db || exit 1 + for file in *; do + if echo $file | grep \\.lockfile >/dev/null 2>&1; then + : # skip lock files + else + exim_tidydb_as_mail /var/spool/exim4 $file >/dev/null + fi + done +fi |