Re: rule problem basing on X-Spam-ASN

2013-04-26 Thread Karsten Bräckelmann
On Sat, 2013-04-27 at 03:57 +0200, Benny Pedersen wrote: > Karsten Bräckelmann skrev den 2013-04-26 02:03: > > The metadata pseudo-headers are missing. Header rules can match against > > these, but not against X-Spam headers, which are added at the end of the > > process. > > imho also bayes used

Re: rule problem basing on X-Spam-ASN

2013-04-26 Thread Benny Pedersen
Karsten Bräckelmann skrev den 2013-04-26 02:03: The metadata pseudo-headers are missing. Header rules can match against these, but not against X-Spam headers, which are added at the end of the process. imho also bayes used it ?, when it works :) if its ressolved in 3.4 then its more time to

Re: rule problem basing on X-Spam-ASN - not a rule problem

2013-04-26 Thread Benny Pedersen
Frank Gadegast skrev den 2013-04-25 10:18: But it looks like add_header can only be used to insert lines starting with X-Spam-, is there any other way to tell SA to insert a header line wich is starting with something else ? there is a well dokumented reason for not have it possible to add

Re: rule problem basing on X-Spam-ASN - not a rule problem

2013-04-26 Thread Benny Pedersen
Christian Recktenwald skrev den 2013-04-25 08:56: perhaps this might be worth a bug report. it will just delay sa 3.4.x even more, and it would be marked invalid, if it does not work, check local add headers, docs is "perldoc Mail::SpamAssassin::Conf" -- senders that put my email into body

Re: rule problem basing on X-Spam-ASN

2013-04-25 Thread RW
On Fri, 26 Apr 2013 02:03:30 +0200 Karsten Bräckelmann wrote: > On Thu, 2013-04-25 at 13:57 +0100, RW wrote: > > I was just looking at the ASM plugin and it defines tags, but not a > > metadata "pseudo-header". With other plugins, header tests run > > against that metadata header. > > Doh! Spot o

Re: rule problem basing on X-Spam-ASN

2013-04-25 Thread Karsten Bräckelmann
On Thu, 2013-04-25 at 13:57 +0100, RW wrote: > I was just looking at the ASM plugin and it defines tags, but not a > metadata "pseudo-header". With other plugins, header tests run against > that metadata header. Doh! Spot on. The metadata pseudo-headers are missing. Header rules can match against

Re: rule problem basing on X-Spam-ASN - not a rule problem

2013-04-25 Thread Dave Funk
On Thu, 25 Apr 2013, Frank Gadegast wrote: And SA is doing it right, to remove all X-Spam-lines before its starting, so that spammer cannot trick SA. And whatever line is inserted by ASN.pm, it needs to be stripped too, and thats why its programmed like it is. But I have no still no idea how t

Re: rule problem basing on X-Spam-ASN

2013-04-25 Thread RW
On Wed, 24 Apr 2013 16:45:42 +0200 Frank Gadegast wrote: > > Hi all, > > I like to set extra score on mail coming from some ASns > using the asn.pm > > Lets say I like to reject all mail from BELPAK.BY I wrote > > header LOCAL_AS6697 X-Spam-ASN =~ / AS6697 / > describe LOCAL_AS6697 Sende

Re: rule problem basing on X-Spam-ASN - not a rule problem

2013-04-25 Thread Frank Gadegast
Christian Recktenwald wrote: On Thu, Apr 25, 2013 at 10:18:43AM +0200, Frank Gadegast wrote: And SA surely strips all head-lines starting with "X-Spam-" before its doing anything. In Mail/SpamAssassin.pm there is some special handling of "X-Spam-" prefixed mail headers. So it's really not abou

Re: rule problem basing on X-Spam-ASN - not a rule problem

2013-04-25 Thread Christian Recktenwald
On Thu, Apr 25, 2013 at 10:18:43AM +0200, Frank Gadegast wrote: > And SA surely strips all head-lines starting with "X-Spam-" before > its doing anything. In Mail/SpamAssassin.pm there is some special handling of "X-Spam-" prefixed mail headers. So it's really not about subsequent dashes. -- Ch

Re: rule problem basing on X-Spam-ASN - not a rule problem

2013-04-25 Thread Frank Gadegast
Christian Recktenwald wrote: I ran some tests which indicate one may not have subsequent '-' after 'X-' in header lines: Thats a great test, many thnx for it. It simply indicates, that ASN.pm is running nearly at first, before SA does its messurements. And SA surely strips all head-lines star

Re: rule problem basing on X-Spam-ASN - not a rule problem

2013-04-24 Thread Christian Recktenwald
I ran some tests which indicate one may not have subsequent '-' after 'X-' in header lines: given this "message": X-SpamASN: AS3701 140.211.0.0/16 X-Spam-ASN: AS3701 140.211.0.0/16 body... and those rules: header _LOCAL_XAS1 X-SpamASN =~ /AS3701 / de

Re: rule problem basing on X-Spam-ASN - not a rule problem - proof

2013-04-24 Thread Frank Gadegast
Hi again, I checked the rule now by inserting a line like ASN: AS3701 140.211.0.0/16 in the test-msg, modified the asn-rule to header TEST_AS3701 ASN =~ /^AS3701 / describe TEST_AS3701Sender IP in AS from friendly SA user score TEST_AS3701 -0.1 tested, and ... X-Spam-Status: No

Re: rule problem basing on X-Spam-ASN - not a rule problem

2013-04-24 Thread Frank Gadegast
Karsten Bräckelmann wrote: Frank Gadegast skrev den 2013-04-24 16:45: header LOCAL_AS6697 X-Spam-ASN =~ / AS6697 / The ASN plugin documentation [1] shows the AS number at the beginning of the header's value. The leading space prevents your header rule from matching, and should instead eve

Re: rule problem basing on X-Spam-ASN

2013-04-24 Thread Benny Pedersen
Karsten Bräckelmann skrev den 2013-04-25 01:04: space needs to be excaped, [...] Just... No. okay no, always good to have more then one input to be sure -- senders that put my email into body content will deliver it to my own trashcan, so if you like to get reply, dont do it

Re: rule problem basing on X-Spam-ASN

2013-04-24 Thread Karsten Bräckelmann
On Thu, 2013-04-25 at 01:04 +0200, /me fat-fingered: > > > header LOCAL_AS6697 X-Spam-ASN =~ / AS6697 / > > The ASN plugin documentation [1] shows the AS number at the beginning of > the header's value. The leading space prevents your header rule from > matching, and the RE should instead ev

Re: rule problem basing on X-Spam-ASN

2013-04-24 Thread Karsten Bräckelmann
> Frank Gadegast skrev den 2013-04-24 16:45: > > > header LOCAL_AS6697 X-Spam-ASN =~ / AS6697 / The ASN plugin documentation [1] shows the AS number at the beginning of the header's value. The leading space prevents your header rule from matching, and should instead even anchor the RE at the

Re: rule problem basing on X-Spam-ASN

2013-04-24 Thread John Hardin
On Thu, 25 Apr 2013, Benny Pedersen wrote: Frank Gadegast skrev den 2013-04-24 16:45: header LOCAL_AS6697 X-Spam-ASN =~ / AS6697 / /\ AS6697\ / or /\bAS6697\b/ -- John Hardin KA7OHZhttp://www.impsec.org/~jhardin/ jhar...@impsec.orgFALaholic #11174 pgpk -

Re: rule problem basing on X-Spam-ASN

2013-04-24 Thread Benny Pedersen
Frank Gadegast skrev den 2013-04-24 16:45: header LOCAL_AS6697 X-Spam-ASN =~ / AS6697 / /\ AS6697\ / space needs to be excaped, does it match ? spamassassin 2>&1 -D -t msg | grep LOCAL_ | less describe LOCAL_AS6697 Sender IP in AS-block from BELBAK.BY score LOCAL_AS6697 9.0 --

rule problem basing on X-Spam-ASN

2013-04-24 Thread Frank Gadegast
Hi all, I like to set extra score on mail coming from some ASns using the asn.pm Lets say I like to reject all mail from BELPAK.BY I wrote header LOCAL_AS6697 X-Spam-ASN =~ / AS6697 / describe LOCAL_AS6697 Sender IP in AS-block from BELBAK.BY score LOCAL_AS6697 9.0 but the X-Spam-A