the-djmaze / snappymail

Simple, modern & fast web-based email client
https://snappymail.eu
GNU Affero General Public License v3.0
994 stars 121 forks source link

Spam score is always "acceptable" #1228

Closed Bagu closed 1 year ago

Bagu commented 1 year ago

Describe the bug I have a spam score mark as acceptable even if i have this in header :

X-Spam-Checker-Version: SpamAssassin 4.0.0 at Fri, 04 Aug 2023 17:34:45 +0200
X-Spam-Info: Spam : YES
X-Spam-Level: ******************
X-Spam-X-hMailServer-Reason-Score: 18.8
X-Spam-Status: 18.8/5.0, autolearn=no autolearn_force=no, shortcircuit=_SC_, bayes=0.5000
X-Spam-Report: 
 *  3.3 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS 
 *      [128.77.167.57 listed in zen.spamhaus.org] 
 *  2.5 URIBL_DBL_SPAM Contains a spam URL listed in the Spamhaus DBL 
 *      blocklist 
 *      [URI: findsearch.fr] [URI: www.findsearch.fr] 
 *  0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 
 *  0.9 RAZOR2_CHECK Listed in Razor2 (http://razor.sf.net/) 
 *  0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily 
 *      valid 
 * -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's

 *       domain 
 * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 
 *  9.0 KAM_BODY_URIBL_PCCC Body contains URI listed in PCCC WILD RBL 
 *      (https://raptor.pccc.com/RBL) 
 *      [URI: tradedoubler.com] 
 *  0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% 
 *      [score: 0.5000] 
 *  0.0 HTML_MESSAGE BODY: HTML included in message 
 *  0.0 HTML_FONT_LOW_CONTRAST BODY: HTML font color similar or identical to

 *     background 
 * -0.0 T_SCC_BODY_TEXT_LINE No description available. 
 *  0.2 KAM_LOTSOFHASH Emails with lots of hash-like gibberish 
 *  1.9 RAZOR2_CF_RANGE_51_100 Razor2 gives confidence level above 50% 
 *      [cf: 100] 
 *  0.2 RCVD_IN_SPAMDONKEY_L2 RBL: Sender listed in SpamDonkey Level-2 
 *      [128.77.167.57 listed in dnsbl.spamdonkey.com]

Expected behavior Have a correct spam score or a way to tell snappy witch header to use for spam score detection

Please complete the following information:

Bagu commented 1 year ago

An other test shown as "acceptable" :

X-hMailServer-Envelope-From: emddaspfz@mega.nz
X-Spam-Checker-Version: SpamAssassin 4.0.0 at Sat, 05 Aug 2023 16:13:15 +0200
X-Spam-Flag: YES
X-Spam-Level: ****************************
X-Spam-Status: 28.7
X-Spam-Bar: ****************************
X-Spam-X-hMailServer-Reason-Score: 28.7
X-Spam-Info: 28.7/5.0, autolearn=no autolearn_force=no, shortcircuit=_SC_, bayes=1.0000
X-Spam-Report: 
 *  0.4 RCVD_IN_XBL RBL: Received via a relay in Spamhaus XBL 
 *      [82.157.63.105 listed in zen.spamhaus.org] 
 *  3.3 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS 
 *      [82.157.63.105 listed in zen.spamhaus.org] 
 *  0.0 SPF_FAIL SPF: sender does not match SPF record (fail) 
 *      [SPF failed: Please see http://www.openspf.org/Why?s=mfrom;id=emddaspfz%40mega.nz;ip=82.157.63.105;r=wwwbagubiz]

 *  0.0 SPF_HELO_FAIL SPF: HELO does not match SPF record (fail) 
 *      [SPF failed: Please see http://www.openspf.org/Why?s=helo;id=mega.nz;ip=82.157.63.105;r=wwwbagubiz]

 *  3.0 DMARC_REJECT DMARC reject policy 
 *  0.0 KAM_DMARC_STATUS Test Rule for DKIM or SPF Failure with Strict 
 *      Alignment 
 *  0.2 BAYES_999 BODY: Bayes spam probability is 99.9 to 100% 
 *      [score: 1.0000] 
 *  3.5 BAYES_99 BODY: Bayes spam probability is 99 to 100% 
 *      [score: 1.0000] 
 *  3.1 MSGID_SPAM_CAPS Spam tool Message-Id: (caps variant) 
 *  1.4 MIME_BOUND_DD_DIGITS Spam tool pattern in MIME boundary 
 *  1.8 BOTNET_NORDNS Relay's IP address has no PTR record 
 *      [botnet_nordns,ip=82.157.63.105] 
 *  1.5 BOTNET Relay might be a spambot or virusbot 
 *      [botnet0.9,ip=82.157.63.105,maildomain=mega.nz,nordns] 
 *  3.2 DATE_IN_FUTURE_12_24 Date: is 12 to 24 hours after Received: date 
 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider 
 * [emddaspfz(at)mega.nz] 
 *  1.1 RCVD_IN_SPAMDONKEY_L5 RBL: Sender listed in SpamDonkey Level-5 
 *    [82.157.63.105 listed in dnsbl.spamdonkey.com] 
 *  1.5 T_LOCAL_UNAUTHUNSEC Score on unauthenticated unsecure connections 
 * 1.9 MISSING_MIMEOLE Message has X-MSMail-Priority, but no X-MimeOLE 
 * -0.0 T_SCC_BODY_TEXT_LINE No description available. 
 *  0.8 RDNS_NONE Delivered to internal network by a host with no rDNS 
 *  0.8 T_LOCAL_RCVD_MISMATCH EHLO/HELO Mismatch 
 *  0.0 SPOOFED_FREEMAIL No description available. 
 *  1.3 MSMAIL_PRI_ABNORMAL Email priority often abused 
 *  0.0 SPOOFED_FREEMAIL_NO_RDNS From SPOOFED_FREEMAIL and no rDNS 
 *  0.0 XPRIO Has X-Priority header
the-djmaze commented 1 year ago

I have no idea why, but the headers you show are corrupted. Although both say "SpamAssassin 4.0.0", the headers are completely different.

For example: X-Spam-Status: 18.8/5.0, ... vs X-Spam-Info: 28.7/5.0, ...

So i've made some changes that might work