【发布时间】:2018-02-12 11:56:41
【问题描述】:
我是 Spamassassin、正则表达式和 Perl 的新手,所以我很感激一些帮助。我试图为发件人遵循特定模式的所有电子邮件添加垃圾邮件分数,即:
name.surname.@example.com。
这就是我想出来的
header NAME_DOT_SURNAME_DOT_FQDN From=~((?:[a-z]+))(\\.)((?:[a-z]+))(\\.)(@)((?:[a-z][a-z\\.\\d\\-]+)\\.(?:[a-z][a-z\\-]+))(?![\\w\\.])
score NAME_DOT_SURNAME_DOT_FQDN 3.0
但是,它似乎不起作用。当我运行spamassassin --lint 时,我得到以下输出:
Feb 12 12:52:59.521 [32767] warn: Use of ?PATTERN? without explicit operator is deprecated at /etc/spamassassin/local.cf, rule NAME_DOT_SURNAME_DOT_FQDN, line 1.
Feb 12 12:52:59.522 [32767] warn: rules: failed to compile Mail::SpamAssassin::Plugin::Check::_head_tests_0_3, skipping:
Feb 12 12:52:59.522 [32767] warn: (Unmatched ) in regex; marked by <-- HERE in m/: [...][a-z]+) <-- HERE )(\\.)((/ at /etc/spamassassin/local.cf, rule NAME_DOT_SURNAME_DOT_FQDN, line 1.)
Feb 12 12:52:59.620 [32767] warn: lint: 1 issues detected, please rerun with debug enabled for more information
运行spamassassin --lint -D 只会产生包含相同错误的文本墙。
谁能指出我正确的方向?提前致谢。
【问题讨论】:
标签: regex perl spamassassin