Merge pull request #1705 from gmasse/new-1697

Add purge cron job for Dovecot dbox format
This commit is contained in:
Georg Lauterbach 2020-12-18 23:00:36 +01:00 committed by GitHub
commit e11f4f609a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,5 @@
#
# Dovecot purge maintenance
#
# m h dom mon dow user command
38 2 * * * root doveadm purge -A

View file

@ -543,9 +543,13 @@ function _setup_dovecot
# set mail_location according to mailbox format
case "${DOVECOT_MAILBOX_FORMAT}" in
sdbox|mdbox|maildir )
sdbox|mdbox )
_notify 'inf' "Dovecot ${DOVECOT_MAILBOX_FORMAT} format configured"
sed -i -e 's/^mail_location = .*$/mail_location = '"${DOVECOT_MAILBOX_FORMAT}"':\/var\/mail\/%d\/%n/g' /etc/dovecot/conf.d/10-mail.conf
_notify 'inf' "Enabling cron job for dbox purge"
mv /etc/cron.d/dovecot-purge.disabled /etc/cron.d/dovecot-purge
chmod 644 /etc/cron.d/dovecot-purge
;;
* )
_notify 'inf' "Dovecot maildir format configured (default)"