我正在尝试设置 exim 系统过滤器,某些收件人应该跳过它,但条件总是失败:
过滤器如下所示:
# Exim filter
if foranyaddress $h_to: ( $thisaddress contains "lists.example.loc" )
then
finish
elif $h_X-SIGN-ADDED: is not contains "yes"
then
headers add "X-SIGN-ADDED: yes"
seen pipe "/etc/mailsystem/sign/sign.py $sender_address $recipients"
endif
我的 test.msg 是
Message-ID: <[email protected]>
Date: Mon, 25 Jun 2012 12:39:18 +0400
From: Hikaru <[email protected]>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0
MIME-Version: 1.0
To: <[email protected]>
Subject: 1
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
1
运行测试的命令是:
exim -bF exim.filter -f [email protected] -bfd lists.example.loc <test.msg
为什么它总是运行管道到脚本?提前致谢
答案1
在我看来,我发现了它不起作用的原因:“foranyaddress”条件等待地址列表,如果只有一个收件人,它将不起作用。因此,如果“收件人:”标头将扩展到多个地址,则一切都会起作用。