diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-01-17 17:58:08 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-01-17 17:58:08 +0100 |
commit | 5dc338f00bb37519260ffa07f2ccbb80b0abc833 (patch) | |
tree | 90ee16e7165440eb2c7b82074b4ff7718491b9a7 /modules/private/mail | |
parent | ef0a9217fba817d7fb71ccd4cca65919dd89ebec (diff) | |
download | Nix-5dc338f00bb37519260ffa07f2ccbb80b0abc833.tar.gz Nix-5dc338f00bb37519260ffa07f2ccbb80b0abc833.tar.zst Nix-5dc338f00bb37519260ffa07f2ccbb80b0abc833.zip |
Fix Backup mailboxes expunging
Diffstat (limited to 'modules/private/mail')
-rw-r--r-- | modules/private/mail/dovecot.nix | 2 | ||||
-rw-r--r-- | modules/private/mail/sieve_scripts/backup.sieve | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/modules/private/mail/dovecot.nix b/modules/private/mail/dovecot.nix index 523c017..9836f78 100644 --- a/modules/private/mail/dovecot.nix +++ b/modules/private/mail/dovecot.nix | |||
@@ -261,7 +261,7 @@ in | |||
261 | 261 | ||
262 | services.cron.systemCronJobs = let | 262 | services.cron.systemCronJobs = let |
263 | cron_script = pkgs.writeScriptBin "cleanup-imap-folders" '' | 263 | cron_script = pkgs.writeScriptBin "cleanup-imap-folders" '' |
264 | ${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" | 264 | ${pkgs.dovecot}/bin/doveadm expunge -A MAILBOX "Backup/*" NOT FLAGGED BEFORE 8w 2>&1 > /dev/null | grep -v "Mailbox doesn't exist:" | grep -v "Info: Opening DB" |
265 | ${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" | 265 | ${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" |
266 | ${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" | 266 | ${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" |
267 | ''; | 267 | ''; |
diff --git a/modules/private/mail/sieve_scripts/backup.sieve b/modules/private/mail/sieve_scripts/backup.sieve index c922999..3014c0a 100644 --- a/modules/private/mail/sieve_scripts/backup.sieve +++ b/modules/private/mail/sieve_scripts/backup.sieve | |||
@@ -1,9 +1,7 @@ | |||
1 | # vim: filetype=sieve | 1 | # vim: filetype=sieve |
2 | require ["copy","mailbox","fileinto","regex"]; | 2 | require ["copy","mailbox","fileinto","regex"]; |
3 | if not header :regex "subject" "^TestMailImmae ?$" { | 3 | if header :is "X-Spam" "Yes" { |
4 | if header :is "X-Spam" "Yes" { | 4 | fileinto :create :copy "Backup/Spam"; |
5 | fileinto :create :copy "Backup/Spam"; | 5 | } else { |
6 | } else { | 6 | fileinto :create :copy "Backup/Ham"; |
7 | fileinto :create :copy "Backup/Ham"; | ||
8 | } | ||
9 | } | 7 | } |