On Mon, 2014-09-08 at 18:08 -0600, Amir Caspi wrote:
> On Sep 8, 2014, at 4:09 PM, Karsten Bräckelmann <guent...@rudersport.de> 
> wrote:
> 
> > Pulled the sample from pastebin and fed to spamassassin -D with your
> > custom rule added as additional configuration. That rule hits.
> 
> It does not hit on mine, and I think I've figured out why.  I'm using
> SA 3.3.2 with perl 5.8.8 on CentOS 5.10.  Yes, I know I should be
> using 3.4, but I haven't yet had a chance to try the RPM that a couple
> of people have built.  Nonetheless, with SA 3.3.2, it appears that the
> URI engine doesn't like the .club TLD.  See below.

Good one. Yes, it's the TLD.


> Sep  8 20:02:58.897 [9267] dbg: rules: ran uri rule AC_ALL_URI ======> got 
> hit: "negative match"
> 
> So, for some reason, the URI engine is not picking out these .club
> URIs, it's getting "negative match."  Is it because the engine in
> 3.3.2 doesn't like that TLD?  To test this, I manually changed the TLD
> of the second spam URI (out.blah) to .us or .org, and then the engine
> picked it out just fine:

At the time of the 3.3.2 release, the .club TLD simply didn't exist. It
has been accepted by IANA just recently. Of course I was conveniently
using a trunk checkout for testing and kind of shrugged off that TLD in
question.

FWIW, this is not actually a 3.3.x issue. It's the same with 3.4.0. Yes,
that is a *recent* TLD addition... *sigh*


> Sep  8 20:03:43.151 [9197] dbg: rules: ran uri rule AC_ALL_URI ======> got 
> hit: "http://out.dosearchcarsonsale.us";
> Sep  8 20:04:35.578 [9227] dbg: rules: ran uri rule AC_ALL_URI ======> got 
> hit: "http://out.dosearchcarsonsale.org";
> 
> So, it seems to me that the URI engine is barfing on the TLD, and
> that's the problem...

> Is there a patch I can apply that would fix this, until I can upgrade to 3.4?

SVN revision 1615088. The "text changed" link shows the diff and
has a link to the plain patch.

  http://svn.apache.org/viewvc?view=revision&revision=1615088

Dunno if that the patch applies cleanly to 3.3.2, though.

You also can change M::SA::Util::RegistrarBoundaries manually. As per
the svn diff above, two blobs are involved:  (a) the VALID_TLDS hash
foreach() definition and  (b) the VALID_TLDS_RE.

So you could get those out of trunk and edit RegistrarBoundaries.pm
locally. It also should be possible to simply replace that Perl module
with the current trunk version.

And last but not least, generation ob both these TLD blobs is documented
in the code right before their definition. You can always generate it
fresh.


-- 
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; }}}

Reply via email to