}
''
+ # ACL
+ ''
+ mail_plugins = $mail_plugins acl
+ plugin {
+ acl = vfile:${pkgs.writeText "dovecot-acl" ''
+ Backup/* owner lrp
+ ''}
+ acl_globals_only = yes
+ }
+ ''
+
# Full text search
''
# needs to be bigger than any mailbox size
sieve_plugins = sieve_imapsieve sieve_extprograms
imapsieve_url = sieve://127.0.0.1:4190
+ sieve_before = file:${./sieve_scripts}/backup.sieve
+
# From elsewhere to Junk folder
imapsieve_mailbox1_name = Junk
imapsieve_mailbox1_causes = COPY APPEND
# Needs to come last if there are mail_plugins entries
''
protocol imap {
- mail_plugins = $mail_plugins imap_sieve
+ mail_plugins = $mail_plugins imap_sieve imap_acl
}
protocol lda {
mail_plugins = $mail_plugins sieve
services.cron.systemCronJobs = let
cron_script = pkgs.writeScriptBin "cleanup-imap-folders" ''
- ${pkgs.dovecot}/bin/doveadm expunge -A MAILBOX "Backup/*" NOT UID 1:256
- ${pkgs.dovecot}/bin/doveadm expunge -A MAILBOX Junk SEEN NOT FLAGGED BEFORE 4w
- ${pkgs.dovecot}/bin/doveadm search -A MAILBOX Trash NOT FLAGGED BEFORE 4w
+ ${pkgs.dovecot}/bin/doveadm expunge -A MAILBOX "Backup/*" NOT UID 1:256 2>&1 > /dev/null | grep -v "Mailbox doesn't exist:" | grep -v "Info: Opening DB"
+ ${pkgs.dovecot}/bin/doveadm expunge -A MAILBOX Junk SEEN NOT FLAGGED BEFORE 4w 2>&1 > /dev/null | grep -v "Mailbox doesn't exist:" | grep -v "Info: Opening DB"
+ ${pkgs.dovecot}/bin/doveadm expunge -A MAILBOX Trash NOT FLAGGED BEFORE 4w 2>&1 > /dev/null | grep -v "Mailbox doesn't exist:" | grep -v "Info: Opening DB"
'';
in
[