On 11/14/2011 3:07 PM, Mike Koleszar wrote:
> Hi all, I would like to put together a script that will show me the spam 
> score of emails that come in. I was hoping that someone could help push 
> me in the right direction to do this. I'm hoping there is a simple way 
> to do this, using one of the SpamAssassin exe files over command-line. I 
> appreciate any advice or suggestions. Thank you.


There are a couple of ways to do this.

First off, SpamAssassin will not block anything by itself, so one way is
to set it up in your mail server so that it scans all of the incoming
email.  Each email will have a header added showing the SA score. 
Emails determined to be spam will have a more detailed report in the
header.  Unless you configure your mailserver to check the scores, the
mail will still be delivered normally.  This is the most accurate way to
do it.

If you want a more manual way, you can check each email with a command. 
First, you need to get the email in a text file.  If your mailserver
uses the maildir storage format, then you can just pull the messages
from there.  Otherwise, you will need to save the messages in some
manner that preserves all of the message headers.  If the headers are
changed in any way, the scoring may be affected.  Once you have the
message, you can test it like this:

spamassassin -t < messagefile.txt

This will output the original message plus a report at the bottom.  It
will *always* claim the message is spam, so ignore that and just look at
the scores.

NOTE:  The above command line is in linux format.  The windows command
may be slightly different.

-- 
Bowie

Reply via email to