Command to test message score with spamassassin

MedMax

Registered
Jun 10, 2011
4
0
51
Tunisia
Hi
1/ I was trying to find a way to check the spamassassin score for outgoing test message from the command line. I did not found any way. Is there a documentation or just a command with spamassassin output for the score it gives to the message as for this online website tool?

2/trying the point1, i have this commands output:
/usr/local/cpanel/3rdparty/bin/spamd -V
SpamAssassin Server version 3.4.2 <<<<<<<<<<<<<<<<<
running on Perl 5.28.0
with SSL support (IO::Socket::SSL 2.060)
with zlib support (Compress::Zlib 2.074)

But when i send this command:
grep -R score /var/lib/spamassassin/* | less
........
........
/var/lib/spamassassin/3.004001/updates_spamassassin_org/20_pdfinfo.cf:score GMD_PDF_ENCRYPTED 0.60
/var/lib/spamassassin/3.004001/updates_spamassassin_org/20_pdfinfo.cf:score GMD_PDF_EMPTY_BODY 0.25
/var/lib/spamassassin/3.004001/updates_spamassassin_org/20_pdfinfo.cf:#score GMD_PDF_STOX_M1 3.25
/var/lib/spamassassin/3.004001/updates_spamassassin_org/20_pdfinfo.cf:#score GMD_PDF_STOX_M2 2.95


i have an old version effectively installed too on the same folder /var/lib/spamassassin
it's a little bit confusing, is spamassassin really working?
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,126
667
263
Houston
cPanel Access Level
DataCenter Provider
Can you explain exactly what you want to test for outgoing spam? This functions a bit differently than SpamAssassin for inbound mail.

I also don't understand what the significance of this is:

Code:
grep -R score /var/lib/spamassassin/* | less
........
........
/var/lib/spamassassin/3.004001/updates_spamassassin_org/20_pdfinfo.cf:score GMD_PDF_ENCRYPTED 0.60
/var/lib/spamassassin/3.004001/updates_spamassassin_org/20_pdfinfo.cf:score GMD_PDF_EMPTY_BODY 0.25
/var/lib/spamassassin/3.004001/updates_spamassassin_org/20_pdfinfo.cf:#score GMD_PDF_STOX_M1 3.25
/var/lib/spamassassin/3.004001/updates_spamassassin_org/20_pdfinfo.cf:#score GMD_PDF_STOX_M2 2.95
All this is getting is the score weight for rules in the SpamAssassin configuration.
 

MedMax

Registered
Jun 10, 2011
4
0
51
Tunisia
Hi,
What we need is to get some thing like this for such email:

"this is a test message to check the rules used by spamassassin to flag a message as spam or not"

pts rule description
---- ---------------------- --------------------------------------------------
1.0 MISSING_HEADERS Missing To: header
-0.0 NO_RELAYS Informational: message was not relayed via SMTP
1.0 MISSING_FROM Missing From: header
-0.0 NO_RECEIVED Informational: message has no Received headers
0.5 MISSING_MID Missing Message-Id: header
1.8 MISSING_SUBJECT Missing Subject: header
1.4 MISSING_DATE Missing Date: header
2.3 EMPTY_MESSAGE Message appears to have no textual parts and no
Subject: text
0.0 NO_HEADERS_MESSAGE Message appears to be missing most RFC-822 headers

######################################################
At this point SA flagged this sample msg as 8.0 score
If ever we choose in exim configuration to use SA score to reject OUTGOING messages of let's say 4 SA score, we no longer have any detail on the mail syslogs of the subject/body....etc details.
This is very important, as on shared servers, we have to provide a proof to our clients that there account has been spamming: They could not understand logs, ip, but spam subjects (at least) + SA rules + etc
Such details are very important to any hoster, because we could then, set the right score depending on our specifications.

For the second question, it's fixed. We found the exact version we use just with this command:
/usr/local/cpanel/3rdparty/bin/spamassassin --version

We have, of course, this config on exim
log_selector = +all
 
Last edited by a moderator:

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,126
667
263
Houston
cPanel Access Level
DataCenter Provider
What you're looking for isn't available with this feature at this time. Right now the header addition is just as follows:

Code:
X-OutGoing-Spam-Status: No, score=2.1
You're looking for the scoring breakdown, which I agree would be useful

This specific header as far as I understand it is added here:

Code:
/usr/local/cpanel/etc/exim/acls/ACL_OUTGOING_NOTSMTP_CHECKALL_BLOCK/outgoing_spam_scan:        add_header = X-OutGoing-Spam-Status: No, score=$spam_score
/usr/local/cpanel/etc/exim/acls/ACL_OUTGOING_NOTSMTP_CHECKALL_BLOCK/outgoing_spam_scan_over_int:        add_header = X-OutGoing-Spam-Status: No, score=$spam_score
/usr/local/cpanel/etc/exim/acls/ACL_OUTGOING_SMTP_CHECKALL_BLOCK/outgoing_spam_scan:        add_header = X-OutGoing-Spam-Status: No, score=$spam_score
/usr/local/cpanel/etc/exim/acls/ACL_OUTGOING_SMTP_CHECKALL_BLOCK/outgoing_spam_scan_over_int:        add_header = X-OutGoing-Spam-Status: No, score=$spam_score
But I can't guarantee that adding further customizations here wouldn't be overwritten if you chose to do so.


I'd really like to encourage you to open a feature request for this, if you do choose to you can do so using the link in my signature. Once it's open please update this thread with the link so that others may vote for it as well.


Thanks!