Spamassassin score and rules hit by a particular email

Use this forum for discussions about SpamAssassin and anti-spam in general.
Post Reply
Masterseo
New user
New user
Posts: 5
Joined: 2017-10-31 03:30

Spamassassin score and rules hit by a particular email

Post by Masterseo » 2017-10-31 03:45

Hello all,
I would like to know how to create a test script to test the “spaminess” of a particular email and the rules it has hit (like the link below).

http://spamassassin.apache.org/old/tests_3_3_x.html
It’s my first post in here and hoping you guys can help me learn more.

Thanks a lot.
R.

User avatar
mattg
Moderator
Moderator
Posts: 20134
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Spamassassin score and rules hit by a particular email

Post by mattg » 2017-10-31 04:05

So you only want to test your SpamAssassin tests?

Use the TEST button in hMailserver will tell which tests failed.
That assumes no headers and no relays, if you wish to test for headers etc then you need a real message to pass though your system.

All mail marked as spam by Spamassassin can be told to include the tests failed and scores in the message headers
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Masterseo
New user
New user
Posts: 5
Joined: 2017-10-31 03:30

Re: Spamassassin score and rules hit by a particular email

Post by Masterseo » 2017-10-31 04:25

Basically I would like to create an email and send it to a real mailbox (like mail-tester.com) and get its spamscore breakdown (not just the x-spam score). My understanding is you have to interact somehow with spamd but not sure about the logic. I have not been able to find much on github (excluding some 3rd party specific scripts)
Hope that clarifies what I am looking for.
Thanks
R.

User avatar
mattg
Moderator
Moderator
Posts: 20134
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Spamassassin score and rules hit by a particular email

Post by mattg » 2017-10-31 06:56

just google online spam testing - there are heaps

https://www.mail-tester.com/ I've used before
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
jimimaseye
Moderator
Moderator
Posts: 8131
Joined: 2011-09-08 17:48

Re: Spamassassin score and rules hit by a particular email

Post by jimimaseye » 2017-10-31 09:55

c:>spamassassin < SavedSpammyEmail.eml > output.log

then look at the output.log.

(or just leave off the output.log redirect to view it to screen)
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

Masterseo
New user
New user
Posts: 5
Joined: 2017-10-31 03:30

Re: Spamassassin score and rules hit by a particular email

Post by Masterseo » 2017-11-01 02:58

jimimaseye wrote:c:>spamassassin < SavedSpammyEmail.eml > output.log

then look at the output.log.

(or just leave off the output.log redirect to view it to screen)
Thanks for your response... it’s almost what I need. The output log shows the summary (from what I got)... I was more looking for the breakdown of the score like this:
http://spamassassin.apache.org/old/tests_3_3_x.html
I am looking forward to your reply.

R.

User avatar
mattg
Moderator
Moderator
Posts: 20134
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Spamassassin score and rules hit by a particular email

Post by mattg » 2017-11-01 03:29

Did you try this link?

They give a detailed report on a default install of SpamAssassin
mattg wrote:https://www.mail-tester.com/ I've used before
You'd get a different score from my SpamAssassin, but that's the point of me customising my system
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Masterseo
New user
New user
Posts: 5
Joined: 2017-10-31 03:30

Re: Spamassassin score and rules hit by a particular email

Post by Masterseo » 2017-11-01 04:00

mattg wrote:Did you try this link?

They give a detailed report on a default install of SpamAssassin
mattg wrote:https://www.mail-tester.com/ I've used before
You'd get a different score from my SpamAssassin, but that's the point of me customising my system
Yes that is why I want to create my own testing tool. I have already used it but I want to build my own. I just need to find the right logs to parse

User avatar
mattg
Moderator
Moderator
Posts: 20134
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Spamassassin score and rules hit by a particular email

Post by mattg » 2017-11-01 05:19

It's probably not logs that are parsed, it is mail headers
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
jimimaseye
Moderator
Moderator
Posts: 8131
Joined: 2011-09-08 17:48

Re: Spamassassin score and rules hit by a particular email

Post by jimimaseye » 2017-11-01 10:18

Masterseo wrote: Thanks for your response... it’s almost what I need. The output log shows the summary (from what I got).
It will only output what is configured by your setup ie, it will depend on your 'report_safe' level/setting. (I dont know if from your post and the link you are expecting it but remember that RULE descriptions and explanations are never described fully or even easy to find).

I simply use the command given and use BARETAIL.exe to view the top of the log (without 'tailing' enabled).
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

Post Reply