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"; }