我有以下筛选脚本(由 Horde 的 ingo 程序生成):
if address :all :comparator "i;ascii-casemap" :contains "From" "Apotheke" {
discard;
stop;
}
但它就是不符合我的电子邮件。例如:
[...]
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=root; d=studio24mw.com;
h=From:Subject:To:Content-Type:MIME-Version:Date:Message-ID;
[email protected];
bh=vLpX7dkYT5Q4Pa27lzI7l2QbOYaZ6KqVK8qoW3XtNXI=;
b=VIXKBd3YeXmCYVVCe/3XhlEwy/7WKjIS9PsG0c63d8P08aVkNOj0mZneGF8o2QibLFJYWQ7Xg1Pj
ckPVTrE9+PMpcUhGu40QNjl1vgSoV/CbnrY3MB3rVmmjqqW5s5wvRB1EXpCRP3fwu6BAUh11qQms
IS83UbL1wMU8sd3GF6Y=
From: "Apotheke" <[email protected]>
[...]
然后,使用命令行尝试:
# sudo -u test sieve-test -Tlevel=matching -t - /tmp/.dovecot.sieve /tmp/testmail
## Started executing script '.dovecot'
5: address test
5: starting `:contains' match with `i;ascii-casemap' comparator:
5: extracting `From' headers from message
5: parsing address header value `"Apotheke" <[email protected]>'
5: address value `[email protected]'
5: extracting `all' part from address <[email protected]>
5: matching value `[email protected]'
5: with key `Apotheke' => 0
5: finishing match with result: not matched
5: jump if result is false
5: jumping to line 7
## Finished executing script '.dovecot'
Performed actions:
(none)
Implicit keep:
* store message in folder: INBOX
sieve-test(test): Info: final result: success
似乎测试只针对地址部分,而不是完整的“发件人”标头。我尝试了 ingo 中我能想到的所有变体,但就是没有一个匹配。
有没有办法匹配完整的标题行,而不仅仅是地址?