## http://tools.ietf.org/html/rfc5228#section-4.1## Sieve filterrequire ["include","fileinto","vacation","variables"];# 包含公共文件,需要includeinclude :global "att_flag";# 将主题赋给subject,需要variablesif header :matches "Subject" "*"{ set "subject" "${1}";}# 从abc发过来的邮件取主题后交给外部程序yy.sh 需要 vnd.dovecot.executeif address "from" "abc@abc.com"{ fileinto "Junk"; execute :input "aa" "yy.sh" "${subject}";}# 主题包含 **SPAM** 投递到垃圾邮件if header :contains "Subject" "**SPAM**" { fileinto "Junk"; stop;}# 从a发过来的邮件,收取并转发到b,否则自动回复if header :contains "from" "a@qq.com"{ fileinto "INBOX"; redirect "b@qq.com";} else { vacation "Sorry,later agian!";}# 邮件超过2048K拒绝,需要rejectif size :over 2048K{ reject "Message not delivered; size over limit accepted by recipient"; stop; }