You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Martin <ma...@idkommunikation.com> on 2004/08/10 10:46:23 UTC

How to manually run a mail through SA at commandline?

Hi!

I wonder how i manually run a mailmessage through SA at commandline to 
see the scores?

I've got one spam that didn't get caught, and when i reported it to 
SpamCop i noticed that it was already listed.

Do i have to export the mailmessage from Outlook in any particular 
format and the import it on my SA-server?

I'm using SA + Postfix on a redhatmachine, relaying for a MS Exchangeserver.

Thanks in advance

/ Martin


Re: How to manually run a mail through SA at commandline?

Posted by Loren Wilton <lw...@earthlink.net>.
> cat message | spamassassin | less
> OR
> spamassassin < message | less
> 
> either way the resulting E-mail is trapped by the less and you can see 
> the headers added by SpamAssassin.

Or if you just want to see the rule hits and don't want to scroll

    spamassassin -t <spamthing


    Loren


Re: How to manually run a mail through SA at commandline?

Posted by Matt Kettler <mk...@evi-inc.com>.
At 07:58 AM 8/11/2004, Martin wrote:
>Matt,
>
>Alright.. so i should be careful using the -t mode on non-spam messages?

Not if you're simply testing things.. Obviously don't use -t in your normal 
mail-processing stream, but for your own manual testing/tinkering it's 
perfectly fine.

  I was just pointing out it's behavior so you won't surprised when the 
body report appears claiming the message is spam despite having a low 
score. (Several people have been surprised by this, and some have even 
opened bug reports).








Re: How to manually run a mail through SA at commandline?

Posted by Martin <ma...@idkommunikation.com>.
Matt Kettler wrote:

> Side note here: be aware that -t is "test mode" and will make SA 
> generate a spam-markup for the message, even if it's not scored high 
> enough to be sam. This has the effect of providing more information on 
> nonspam because it generates a spam report, but don't be surprised when 
> you see it claim "the following message is spam..." when it scored 
> -10.0. You asked it to force-generate a spam report, so it will :)
> 
> -D can be used with or without -t, and does definitely generate a lot of 
> information. It's very handy when debugging configuration problems, as 
> is spamassassin --lint.

Matt,

Alright.. so i should be careful using the -t mode on non-spam messages?

/ Martin


Re: How to manually run a mail through SA at commandline?

Posted by Matt Kettler <mk...@comcast.net>.
At 03:32 PM 8/10/2004 +0200, you wrote:
>jdow wrote:
>
>>Martin, the "-t" option on the above command provides more information.
>>"-t -D" provides just a whole lot more information.
>
>Thanks for sharing! Gave me even more information.

Side note here: be aware that -t is "test mode" and will make SA generate a 
spam-markup for the message, even if it's not scored high enough to be sam. 
This has the effect of providing more information on nonspam because it 
generates a spam report, but don't be surprised when you see it claim "the 
following message is spam..." when it scored -10.0. You asked it to 
force-generate a spam report, so it will :)

-D can be used with or without -t, and does definitely generate a lot of 
information. It's very handy when debugging configuration problems, as is 
spamassassin --lint.





Re: How to manually run a mail through SA at commandline?

Posted by Martin <ma...@idkommunikation.com>.
jdow wrote:

> Martin, the "-t" option on the above command provides more information.
> "-t -D" provides just a whole lot more information.

Thanks for sharing! Gave me even more information.

Thanks to you too Loren.

/ Martin


Re: How to manually run a mail through SA at commandline?

Posted by jdow <jd...@earthlink.net>.
From: "Martin" <ma...@idkommunikation.com>

> Dan Egli wrote:
> 
> > Simple. SpamAssassin (and spamc) take their message from the stdin. So 
> > you can save your message to a file (so it's by itself) and do either
> > 
> > cat message | spamassassin | less
> > 
> > 
> > OR
> > 
> > spamassassin < message | less
> > 
> > 
> > either way the resulting E-mail is trapped by the less and you can see 
> > the headers added by SpamAssassin.
> 
> Thank you Dan, exactly what i was looking for.

Martin, the "-t" option on the above command provides more information.
"-t -D" provides just a whole lot more information.

{^_^}

Re: How to manually run a mail through SA at commandline?

Posted by Martin <ma...@idkommunikation.com>.
Dan Egli wrote:

> Simple. SpamAssassin (and spamc) take their message from the stdin. So 
> you can save your message to a file (so it's by itself) and do either
> 
> cat message | spamassassin | less
> 
> 
> OR
> 
> spamassassin < message | less
> 
> 
> either way the resulting E-mail is trapped by the less and you can see 
> the headers added by SpamAssassin.

Thank you Dan, exactly what i was looking for.

/ Martin


Re: How to manually run a mail through SA at commandline?

Posted by Dan Egli <da...@eglifamily.dnsalias.net>.
Martin wrote:

> Hi!
> 
> I wonder how i manually run a mailmessage through SA at commandline to 
> see the scores?
> 
> I've got one spam that didn't get caught, and when i reported it to 
> SpamCop i noticed that it was already listed.
> 
> Do i have to export the mailmessage from Outlook in any particular 
> format and the import it on my SA-server?
> 
> I'm using SA + Postfix on a redhatmachine, relaying for a MS 
> Exchangeserver.
> 
> Thanks in advance
> 
> / Martin
> 
> 

Simple. SpamAssassin (and spamc) take their message from the stdin. So 
you can save your message to a file (so it's by itself) and do either

cat message | spamassassin | less


OR

spamassassin < message | less


either way the resulting E-mail is trapped by the less and you can see 
the headers added by SpamAssassin.

-- 
-- Dan