diff options
-rwxr-xr-x | postfix/cron.weekly/local-purgeoldtrashedmails | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/postfix/cron.weekly/local-purgeoldtrashedmails b/postfix/cron.weekly/local-purgeoldtrashedmails index e440b02..7ec70e7 100755 --- a/postfix/cron.weekly/local-purgeoldtrashedmails +++ b/postfix/cron.weekly/local-purgeoldtrashedmails @@ -4,6 +4,11 @@ set -e -find /home/*/Maildir/.Trash /home/*/Maildir/.Trash.* /home/*/Maildir/.INBOX_Trash /home/*/Maildir/.trash /home/*/Maildir/.Deleted\ Messages /home/*/Maildir/.Deleted\ Items /home/*/Maildir/.Slettet\ post /home/*/Maildir/.Junk -type f -mtime +60 -delete +prefix=/home/*/Maildir +if grep -Fxq LETTERHOMES=yes /etc/adduser.conf; then + prefix=/home/*/*/Maildir +fi + +find $prefix/.Trash $prefix/.Trash.* $prefix/.INBOX_Trash $prefix/.trash $prefix/.Deleted\ Messages $prefix/.Deleted\ Items $prefix/.Slettet\ post $prefix/.Junk -type f -mtime +60 -delete exit 0 |