Spamassassin的自定义规则(用于主题行过滤)不起作用

时间:2019-10-29 23:13:35

标签: regex email spam spam-prevention spamassassin

我正在设置Spamassassin,以便与isbg一起使用以过滤IMAP邮件帐户中的邮件。我的ISP已经有一个不错的垃圾邮件过滤器,它在检测到的每条邮件的主题行之前添加“ [SPAM]” ;因此,我在Spamassassin中设置了一个自定义规则,以便为主题行以“ [SPAM]”开头的任何邮件添加高分。我的 user_prefs 文件是:

 required_score     9
 score HTML_COMMENT_8BITS   0
 score UPPERCASE_25_50      0
 score UPPERCASE_50_75      0
 score UPPERCASE_75_100 0
 score OBSCURED_EMAIL          0

 score SUBJ_ILLEGAL_CHARS      0

header SPAM_FILTRADO    Subject =~ /^\s*\[SPAM\]/
score  SPAM_FILTRADO    20

但是,当我向其发送垃圾邮件以对其进行测试时,它似乎并未触发我的规则。我用此主题行向其发送电子邮件,例如:

Subject: [SPAM] See Drone X Pro in action

我以这种方式进行分析:

[paulo@myserver mails]$ spamc -R < spam7.txt 
9.3/9.0
Spam detection software, running on the system "myserver", has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
@@CONTACT_ADDRESS@@ for details.

Content preview:  Big Drone Companies Are Terrified Of This New Drone That Hit
   The Market <http://www.fairfood.icu/uisghougw/pjarx44255sweouci/I31AAdtTTKmLsu_A6Dq7ZK_a47Ko45fCRXk7Fr9fqm4/BbYMgcZjieuj_YxMOSmnXetiI6e4Z37yS9H2zVIeHEilOpatuk8V8Mt0EtJDfLLE1llzj6MiwlLzR99DGODekcqeM7kn63lcFcp8fJutAsw>
   [...] 

Content analysis details:   (9.3 points, 9.0 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
 2.4 DNS_FROM_AHBL_RHSBL    RBL: Envelope sender listed in dnsbl.ahbl.org
 2.7 RCVD_IN_PSBL           RBL: Received via a relay in PSBL
                            [193.17.4.113 listed in psbl.surriel.com]
-0.0 SPF_PASS               SPF: sender matches SPF record
 1.3 HTML_IMAGE_ONLY_24     BODY: HTML: images with 2000-2400 bytes of words
 0.0 HTML_MESSAGE           BODY: HTML included in message
 1.6 RCVD_IN_BRBL_LASTEXT   RBL: RCVD_IN_BRBL_LASTEXT
                            [193.17.4.113 listed in bb.barracudacentral.org]
 1.3 RDNS_NONE              Delivered to internal network by a host with no rDNS

我的规则没有任何内容。

我知道我的 user_prefs 正在加载,因为在我上面粘贴的部分之后,我在白名单中设置了一些电子邮件地址,并且在分析来自这些地址的电子邮件时,Spamassassin可以正确检测到他们。

我的规则出了什么问题?

1 个答案:

答案 0 :(得分:1)

默认情况下,user_prefs文件中对自定义规则的支持处于关闭状态。
您可以在全局配置中使用item_allow_user_rules进行更改。