require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"]; if environment :matches "imap.mailbox" "*" { set "mailbox" "${1}"; } if anyof (string "${mailbox}" "Trash", string "${mailbox}" "junkmail", string "${mailbox}" "Junk") { stop; } pipe :copy "learn-ham.sh";