summaryrefslogtreecommitdiffstats
path: root/modules/mail/files/patch/learn.sieve
blob: e56b5938020d7c8dc1d3000946525523732d8400 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require ["vnd.dovecot.execute", "imap4flags", "imapsieve", "environment", "variables"];

if environment :matches "imap.mailbox" "*" {
    set "mailbox" "${1}";
}

if string "${mailbox}" "Junk" {
    setflag "\\seen";
    execute :pipe "spam";
}
else {
    if string "${mailbox}" "Trash" {
        stop;
    }

    execute :pipe "ham";
}