You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Karl Johnson <ka...@gmail.com> on 2014/08/29 17:27:54 UTC

Add spamassassin triggered rules in logs when email is blocked

Hello,

I'm using amavisd-new-2.9.1 and SpamAssassin v3.3.1. I would like to know
if it's possible to add Spamassassin triggered rules when an email is
blocked because I discard the email when it's spam and I want to know why
it's blocked (which rules).

For now I only have the score (hits) in maillog:

Aug 24 04:04:36 relais amavis[3475]: (03475-08) Blocked SPAM
{DiscardedInternal}, MYNETS LOCAL [205.0.0.0]:54459 [205.0.0.0] <
bluewate@zzz.zzz.ca> -> <z...@zzz.ca>, Message-ID: <E1...@zz.zz.ca>,
mail_id: 4RZ-Vm0_iZmi, Hits: 13.573, size: 4269, 10089 ms

I would like to add in logs for example:

DATE_IN_FUTURE_06_12=0.001, DCC_CHECK=4,
SPF_PASS=-0.001,TVD_SPACE_RATIO=0.001

Is that possible?

Karl

Re: Add spamassassin triggered rules in logs when email is blocked

Posted by Karl Johnson <ka...@gmail.com>.
On Fri, Aug 29, 2014 at 3:11 PM, Karsten Bräckelmann <guenther@rudersport.de
> wrote:

> On Fri, 2014-08-29 at 11:27 -0400, Karl Johnson wrote:
> > I'm using amavisd-new-2.9.1 and SpamAssassin v3.3.1. I would like to
> > know if it's possible to add Spamassassin triggered rules when an
> > email is blocked because I discard the email when it's spam and I want
> > to know why it's blocked (which rules).
>
> Wrong place, that is an Amavis question. SA does not reject, discard or
> otherwise block mail. Amavis does, based on the SA score.
>
>
Yes but I thought a lot of people are probably using SA with Amavis here so
I asked. I found the answer if other people are also looking for it:

Add [? %#T ||, Tests: \[[%T|,]\]]#'  in the log template.

Karl

Re: Add spamassassin triggered rules in logs when email is blocked

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Fri, 2014-08-29 at 11:27 -0400, Karl Johnson wrote:
> I'm using amavisd-new-2.9.1 and SpamAssassin v3.3.1. I would like to
> know if it's possible to add Spamassassin triggered rules when an
> email is blocked because I discard the email when it's spam and I want
> to know why it's blocked (which rules).

Wrong place, that is an Amavis question. SA does not reject, discard or
otherwise block mail. Amavis does, based on the SA score.


> For now I only have the score (hits) in maillog:
> 
> Aug 24 04:04:36 relais amavis[3475]: (03475-08) Blocked SPAM
> {DiscardedInternal}, MYNETS LOCAL [205.0.0.0]:54459 [205.0.0.0]
> <bl...@zzz.zzz.ca> -> <z...@zzz.ca>, Message-ID:
> <E1...@zz.zz.ca>, mail_id: 4RZ-Vm0_iZmi, Hits: 13.573,
> size: 4269, 10089 ms

That log line is generated by Amavis. SA has no control of its contents.


> I would like to add in logs for example:
> 
> DATE_IN_FUTURE_06_12=0.001, DCC_CHECK=4,
> SPF_PASS=-0.001,TVD_SPACE_RATIO=0.001
> 
> Is that possible?

-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}