我在 /etc/cpanel_exim_system_filter 中有此代码,以便能够搜索和过滤邮件正文和标头中的垃圾邮件发送者。我想添加一些排除此规则的域,例如 *@gmail.com、*@mail.com 如何扩展 if 命令以排除这些域?
# SPAM FILTER START
if
# Header Spam
$header_subject: contains "Pharmaceutical"
or $header_subject: contains "Viagra"
or $header_subject: contains "seo"
or $header_subject: contains "Cialis"
or $header_subject: is "The Ultimate Online Pharmaceutical"
# Body Spam
or $message_body: contains "Pharmaceutical"
or $message_body: contains "website audit"
or $message_body: contains "Pay-On-Results"
or $message_body: contains "improve your website"
or $message_body: contains "Viagra"
or $message_body: contains "sex"
or $message_body: contains "seo"
then
fail text "This message has been rejected by spam filter\n\
WARNING! THIS MESSAGE HAS NOT BEEN delivered."
seen finish
endif
# SPAM FILTER FINISHED
答案1
您可以针对 From 标头的末尾进行测试,例如,
$header_from: does not end <whitelisted domain>
导致类似的事情:
if
# Excluded domains
$header_from: does not end "example.com"
and $header_from: does not end "example.org"
...
and (
# Header Spam
$header_subject: contains "Pharmaceutical"
or ...
# Body Spam
or ...
)
then
fail text "This message has been rejected by spam filter\n\
WARNING! THIS MESSAGE HAS NOT BEEN delivered."
seen finish
endif
更多信息:http://www.exim.org/exim-html-current/doc/html/spec_html/filter_ch-exim_filter_files.html#SEC23