require [ "copy", "imapsieve", "environment", "variables", "vnd.dovecot.pipe" ]; if environment :matches "imap.user" "*" { set "username" "${1}"; } pipe :copy :try "learn-spam.sh" [ "${username}" ];