我有Exim过滤器,如下条件, 如果域名未结束.com.au且电子邮件主题包含单词“viagra”,则会返回发件人错误消息“您的邮件包含垃圾邮件错误代码xxx”
我想要添加的是文件中列出白名单的域名,而不是每个过滤器都添加所有列入白名单的域名。我给了一个过滤器作为一个例子,因为我有数百个过滤器,白色列表非常方便。
原始过滤器
if
# Header Spam
$sender_address does not end ".au" and
$header_subject: contains "viagra"
then
fail text "This message has been rejected by spam filter\n\
WARNING! THIS MESSAGE HAS NOT BEEN delivered. error code 002"
seen finish
endif
希望过滤器
if
# Header Spam
$sender_address does not matches /etc/eximwhitelistdomain and
$sender_address does not end ".au" and
$header_subject: contains "viagra"
then
fail text "This message has been rejected by spam filter\n\
WARNING! THIS MESSAGE HAS NOT BEEN delivered. error code 002"
seen finish
endif
if
# Header Spam
$sender_address does not matches /etc/eximwhitelistdomain and
$sender_address does not ends ".au" and
$header_subject: contains "cialis"
then
fail text "This message has been rejected by spam filter\n\
WARNING! THIS MESSAGE HAS NOT BEEN delivered. error code 003"
seen finish
endif
如果我可以在此文件的顶部定义一些变量并从每个过滤器调用变量,我也接受另一种可能的解决方案
第二个希望的过滤器
#variable
whitelistemails= email@gmail.com,email2@gmail.com;
if
# Header Spam
$sender_address does not matches whitelistemails and
$sender_address does not end ".au" and
$header_subject: contains "viagra"
then
fail text "This message has been rejected by spam filter\n\
WARNING! THIS MESSAGE HAS NOT BEEN delivered. error code 002"
seen finish
endif
if
# Header Spam
$sender_address does not matches whitelistemails and
$sender_address does not end ".au" and
$header_subject: contains "cialis"
then
fail text "This message has been rejected by spam filter\n\
WARNING! THIS MESSAGE HAS NOT BEEN delivered. error code 003"
seen finish
endif