dovecot: expunge seen messages older than 40 days each night

This commit is contained in:
missytake
2023-10-16 17:43:58 +02:00
committed by holger krekel
parent b943f24587
commit c9ecf24b3e
2 changed files with 14 additions and 0 deletions

View File

@@ -160,6 +160,16 @@ def _configure_dovecot(mail_server: str) -> bool:
)
need_restart |= auth_config.changed
files.put(
src=importlib.resources.files(__package__)
.joinpath("dovecot/expunge.cron")
.open("rb"),
dest="/etc/cron.d/expunge",
user="root",
group="root",
mode="644",
)
return need_restart

View File

@@ -0,0 +1,4 @@
2 0 * * * dovecot doveadm expunge -A SEEN BEFORE 40d INBOX
2 0 * * * dovecot doveadm expunge -A SEEN BEFORE 40d Deltachat
2 0 * * * dovecot doveadm expunge -A SEEN BEFORE 40d Trash
2 30 * * * dovecot doveadm purge -A