You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Justin Mason <jm...@jmason.org> on 2006/10/09 10:45:23 UTC

Re: First Received Header only

[btw the duplication should be fixed since Mon, 09 Oct 2006 05:45:35 -0000
(06:45 IST).]

Loren Wilton writes:
> > Here's an odd perl question: can you reference $1 and its siblings within 
> > the regex itself?  such as:
> >
> > /^\[ ip=(\d+)\.(\d+)\.(\d+)\.(\d+) rdns=\S*(0*($1|$2|$3|$4)\S){2,4}\S* 
> > [^\]]* auth= /
> 
> You can do it, but it slows down the whole regex system as soon as you have 
> a capturing regex.  Or so I'm told by the Perl regex docs.  Use backslashes, 
> not dollar signs.

Actually -- that chicken has already flown the coop ;)  There are already
plenty of capturing regexes in SpamAssassin's code, so one more won't add
that overhead.  However, in itself the use of a capture will add a little
more overhead anyway, which is why they're best avoided in rules if
possible -- but in this case, I can't see a way to implement the rule
without it.

Also, yes, that rule will work I'd say... or possibly this one:

> > /^\[ ip=(\d+)\.(\d+)\.(\d+)\.(\d+) rdns=\S*(0*(\1|\2|\3|\4)\S){2,4}\S* 
> > [^\]]* auth= /

not sure ;)

Note, btw, that if a host 4.3.2.1 HELOs as "dhcp-5-6-7-8.dsl.someisp.net"
rather than "dhcp-4.3.2.1.dsl.someisp.net", it doesn't really matter --
either way it's still a dynamic host, even if it's referring to the wrong
IP in the HELO string!  hence going to the bother of all those captures
may just be overkill.

As Clifton said, this is very similar to what the HELO_DYNAMIC_* ruleset
does.  I strongly recommend taking a look at those and getting your
head around them to ensure you don't duplicate them... and if you find
new ones with good hitrates, please drop us a line with the rules so
we can try them out ;)

--j.

Re: First Received Header only

Posted by John Rudd <jr...@ucsc.edu>.
Justin Mason wrote:


> As Clifton said, this is very similar to what the HELO_DYNAMIC_* ruleset
> does.  I strongly recommend taking a look at those and getting your
> head around them to ensure you don't duplicate them... and if you find
> new ones with good hitrates, please drop us a line with the rules so
> we can try them out ;)
> 

Except, as I've said, I'm not looking at the helo string.  I'm looking 
at the rdns hostname.  I actually don't care one little bit about the 
helo string.  I care about the rdns hostname.  :-)