mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Merge pull request #1705 from gmasse/new-1697
Add purge cron job for Dovecot dbox format
This commit is contained in:
commit
e11f4f609a
|
@ -119,6 +119,8 @@ RUN echo "0 */6 * * * clamav /usr/bin/freshclam --quiet" > /etc/cron.d/clamav-fr
|
|||
COPY target/dovecot/auth-passwdfile.inc target/dovecot/??-*.conf /etc/dovecot/conf.d/
|
||||
COPY target/dovecot/scripts/quota-warning.sh /usr/local/bin/quota-warning.sh
|
||||
COPY target/dovecot/sieve/ /etc/dovecot/sieve/
|
||||
COPY target/dovecot/dovecot-purge.cron /etc/cron.d/dovecot-purge.disabled
|
||||
RUN chmod 0 /etc/cron.d/dovecot-purge.disabled
|
||||
WORKDIR /usr/share/dovecot
|
||||
# hadolint ignore=SC2016,SC2086
|
||||
RUN sed -i -e 's/include_try \/usr\/share\/dovecot\/protocols\.d/include_try \/etc\/dovecot\/protocols\.d/g' /etc/dovecot/dovecot.conf && \
|
||||
|
|
5
target/dovecot/dovecot-purge.cron
Normal file
5
target/dovecot/dovecot-purge.cron
Normal file
|
@ -0,0 +1,5 @@
|
|||
#
|
||||
# Dovecot purge maintenance
|
||||
#
|
||||
# m h dom mon dow user command
|
||||
38 2 * * * root doveadm purge -A
|
|
@ -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)"
|
||||
|
|
Loading…
Reference in a new issue