You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Karsten Bräckelmann <gu...@rudersport.de> on 2010/03/03 17:10:55 UTC

Re: [Bug 6335] add domain-only and IP-only lookups for URIDNSBL, for Spamhaus DBL

On Wed, 2010-03-03 at 15:56 +0000, Justin Mason wrote:
> 2010/3/3 Karsten Bräckelmann <gu...@rudersport.de>:

> > Anyway, as I just said in a previous post, do we
> > need that? The comment now is correct. However, it guards the
> >
> > +      if ($dnsbl_lookup_ips) {
> > +        $self->lookup_dnsbl_for_ip($scanner, $obj, $dom);
> >
> > call exactly then. Called, if *any* URIBL supports IPs. Not called only
> > in the corner case, if all URIBLs are unhappy with IPs. Is it worth the
> > loop, to prevent that function call? lookup_dnsbl_for_ip() has the
> > tflags check now itself.
> 
> OK, that's a fair point, it would be more optimal to omit that
> loop, but I don't think it's a big deal as it is. ;)

Yes, not a big deal in run-time.

However, it still is code that doesn't serve any purpose in almost all
cases, but adds unnecessary complexity. I'd rather not introduce the
code in the first place, where we now have the opportunity to do so.
Particularly, since you agree it is less optimal with that loop.


> > Also, in sub lookup_dnsbl_for_ip():
> >
> > +    next if ($tflags->{$rulename} =~ /\b(?:ips_only|domains_only)\b/);
> >
> > No IP lookup, with tflags ips_only?
> 
> the "tflags ips_only" case with "urirhsbl/urirhssub"-type rules is handled
> by the lookup_single_dnsbl() loop slightly further down, not in that loop
> at all.  lookup_dnsbl_for_ip() is used for a different style of BL --
> the traditional "uridnsbl/uridnssub" type like URIBL_SBL.  That was
> part of my initial bug.

Err -- OK, back to looking at code for me then.


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