]> Git — Sourcephile - sourcephile-nix.git/blob - machines/mermet/dovecot/sieve/global/spam-or-ham.sieve
sanoid: less data retention
[sourcephile-nix.git] / machines / mermet / dovecot / sieve / global / spam-or-ham.sieve
1 require [ "copy", "environment", "imap4flags", "imapsieve", "variables", "vnd.dovecot.pipe" ];
2
3 if environment :is "imap.changedflags" "Junk" {
4 if environment :matches "imap.user" "*" { set "username" "${1}"; }
5 if hasflag :is "Junk" {
6 pipe :copy :try "learn-spam.sh" [ "${username}" ];
7 } elsif not hasflag :is "Junk" {
8 pipe :copy :try "learn-ham.sh" [ "${username}" ];
9 }
10 }