#
# http://tools.ietf.org/html/rfc5228#section-4.1
#
# Sieve filter
require ["include","fileinto","vacation","variables"];
# 包含公共文件,需要include
include :global "att_flag";
# 将主题赋给subject,需要variables
if header :matches "Subject" "*"
{
set "subject" "${1}";
}
# 从abc发过来的邮件取主题后交给外部程序yy.sh 需要 vnd.dovecot.execute
if 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拒绝,需要reject
if size :over 2048K
{
reject "Message not delivered; size over limit accepted by recipient";
stop;
}