You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2007/06/11 20:31:40 UTC

[Bug 5509] New: uribl timeouts do not name the failing rule or zone

http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5509

           Summary: uribl timeouts do not name the failing rule or zone
           Product: Spamassassin
           Version: 3.2.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P5
         Component: Libraries
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: Mark.Martinec@ijs.si


While trying to troubleshoot URIBL timeouts, the following debug
output was not very helpful, seems like uribl timeouts do not
log the rule or zone they are associated with:

dbg: dns: timeout for rfci_envfrom after 6 seconds
dbg: dns: timeout for after 6 seconds
dbg: dns: timeout for after 6 seconds
dbg: dns: timeout for after 6 seconds
dbg: dns: timeout for ahbl after 6 seconds
dbg: dns: timeout for bsp-firsttrusted after 6 seconds
dbg: dns: timeout for after 6 seconds
dbg: dns: timeout for after 6 seconds
dbg: dns: timeout for sorbs-lastexternal,sorbs after 6 seconds

The associated code in Dns.pm harvest_dnsbl_queries is:
    my $string = '';
    if (defined @{$query->{sets}}) {
      $string = join(",", grep defined, @{$query->{sets}});
    }
    elsif (defined @{$query->{rules}}) {
      $string = join(",", grep defined, @{$query->{rules}});
    }
    my $delay = time - $self->{async}->get_last_start_lookup_time();
    dbg("dns: timeout for $string after $delay seconds");

Apart from it failing to report rule names, idioms like:
  defined @{$query->{rules}}
do not seem right. Perl perlfunc man page says:

  Use of defined on aggregates (hashes and arrays) is deprecated.
  It used to report whether memory for that aggregate has ever been
  allocated. This behavior may disappear in future versions of Perl.


Attached is a patch to make debugging output more informative,
and fix the @$ref issue. The new printout looks like:

dbg: dns: timeout for openwhois, DNS_FROM_OPENWHOIS, DNSBL-A,
  dns:A:nasserarchitects.com.bl.open-whois.org. after 2 seconds
dbg: dns: timeout for URI-NS, NS:mycome.hk after 2 seconds
dbg: dns: timeout for WHOIS_SECUREWHOIS, URI-DNSBL,
  DNSBL:bl.open-whois.org.:mycome.hk after 2 seconds
dbg: dns: timeout for bsp-firsttrusted, DNSBL-TXT,
  dns:TXT:5.79.187.195.sa-trusted.bondedsender.org. after 2 seconds
dbg: dns: timeout for URIBL_RHS_DOB, URI-DNSBL,
  DNSBL:dob.sibl.support-intelligence.net:mycome.hk after 2 seconds



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5509] [review] uribl timeouts do not name the failing rule or zone

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5509


maddoc@maddoc.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|needs 1 vote                |can be commited




------- Additional Comments From maddoc@maddoc.net  2007-06-15 19:07 -------
+1



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5509] uribl timeouts do not name the failing rule or zone

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5509


jm@jmason.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|Undefined                   |3.2.2






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5509] uribl timeouts do not name the failing rule or zone

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5509





------- Additional Comments From Mark.Martinec@ijs.si  2007-06-11 12:18 -------
Incidentally, why is the statement:
  my $delay = time - $self->{async}->get_last_start_lookup_time();
within the  "for my $query (@left) {}"  loop ?

The get_last_start_lookup_time does not depend on a $query entry,
and time() is not changing much while writing a few log entries.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5509] [review] uribl timeouts do not name the failing rule or zone

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5509


jm@jmason.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From jm@jmason.org  2007-06-18 09:30 -------
thanks guys -- applied to 3.2.2:

: jm 169...; svn commit -m "bug 5509: improve URIBL timeout debugging messages,
: jm 170... >>; thanks to Mark Martinec" lib/Mail/SpamAssassin/Dns.pm
Sending        lib/Mail/SpamAssassin/Dns.pm
Transmitting file data .
Committed revision 548401.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5509] [review] uribl timeouts do not name the failing rule or zone

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5509


jm@jmason.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|uribl timeouts do not name  |[review] uribl timeouts do
                   |the failing rule or zone    |not name the failing rule or
                   |                            |zone
  Status Whiteboard|                            |needs 2 votes






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5509] uribl timeouts do not name the failing rule or zone

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5509


jm@jmason.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
Attachment #3984 is|0                           |1
           obsolete|                            |




------- Additional Comments From jm@jmason.org  2007-06-14 11:25 -------
Created an attachment (id=3988)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=3988&action=view)
updated patch




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5509] uribl timeouts do not name the failing rule or zone

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5509





------- Additional Comments From Mark.Martinec@ijs.si  2007-06-11 11:32 -------
Created an attachment (id=3984)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=3984&action=view)
the promised patch




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5509] [review] uribl timeouts do not name the failing rule or zone

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5509


sidney@sidney.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|needs 2 votes               |needs 1 vote




------- Additional Comments From sidney@sidney.com  2007-06-15 18:36 -------
+1




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5509] uribl timeouts do not name the failing rule or zone

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5509





------- Additional Comments From jm@jmason.org  2007-06-14 11:24 -------

> The associated code in Dns.pm harvest_dnsbl_queries is:
>     my $string = '';
>     if (defined @{$query->{sets}}) {
>       $string = join(",", grep defined, @{$query->{sets}});
>     }
>     elsif (defined @{$query->{rules}}) {
>       $string = join(",", grep defined, @{$query->{rules}});
>     }
>     my $delay = time - $self->{async}->get_last_start_lookup_time();
>     dbg("dns: timeout for $string after $delay seconds");
> 
> Apart from it failing to report rule names, idioms like:
>   defined @{$query->{rules}}
> do not seem right. Perl perlfunc man page says:
> 
>   Use of defined on aggregates (hashes and arrays) is deprecated.
>   It used to report whether memory for that aggregate has ever been
>   allocated. This behavior may disappear in future versions of Perl.

actually, that's 
  grep defined, @{$query->{sets}})
which evals as
  grep { defined } @{$query->{sets}}
but slightly more efficiently.  still, it's confusing -- and
the improved debugging output is nicer -- so I'm happy to apply
the patch.


> Attached is a patch to make debugging output more informative,
> and fix the @$ref issue. The new printout looks like:
> 
> dbg: dns: timeout for openwhois, DNS_FROM_OPENWHOIS, DNSBL-A,
>   dns:A:nasserarchitects.com.bl.open-whois.org. after 2 seconds
> dbg: dns: timeout for URI-NS, NS:mycome.hk after 2 seconds
> dbg: dns: timeout for WHOIS_SECUREWHOIS, URI-DNSBL,
>   DNSBL:bl.open-whois.org.:mycome.hk after 2 seconds
> dbg: dns: timeout for bsp-firsttrusted, DNSBL-TXT,
>   dns:TXT:5.79.187.195.sa-trusted.bondedsender.org. after 2 seconds
> dbg: dns: timeout for URIBL_RHS_DOB, URI-DNSBL,
>   DNSBL:dob.sibl.support-intelligence.net:mycome.hk after 2 seconds

thanks -- applied.  I also fixed that use of time() inside the loop you mentioned.

: jm 185...; svn commit -m "bug 5509: improve URIBL timeout debugging messages,
thanks to Mark Martinec" lib/Mail/SpamAssassin/Dns.pm
Sending        lib/Mail/SpamAssassin/Dns.pm
Transmitting file data .
Committed revision 547347.


new patch on the way:



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.