https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7338

            Bug ID: 7338
           Summary: Unexpected parenthesis in DNS RR
           Product: Spamassassin
           Version: 3.4.1
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Plugins
          Assignee: [email protected]
          Reporter: [email protected]

In module URIDNSBL.pm

When Net::DNS returns a resource record, especially for domains with really
long names, the RR has parentheses in the results. Routines complete_ns_lookup
and complete_a_lookup don't handle the parentheses very well.

For example:
Instead of returning

hostname.org. IN A 192.168.0.1

sometimes a result returns:

hostname.org. IN A ( 192.168.0.1 )

My fix was to remove the parentheses:

*** URIDNSBL.pm.orig    2016-08-02 14:37:56.131847168 -0400
--- URIDNSBL.pm 2016-08-02 15:12:28.534143316 -0400
***************
*** 942,947 ****
--- 942,948 ----
      next unless (defined($str) && defined($dom));
      dbg("uridnsbl: got($j) NS for $dom: $str");

+     $str =~ s/[()]//g;
      if ($str =~ /IN\s+NS\s+(\S+)/) {
        my $nsmatch = lc $1;
        $nsmatch =~ s/\.$//;
***************
*** 1026,1031 ****
--- 1027,1033 ----
      dbg("uridnsbl: complete_a_lookup got(%d) A for %s: %s", $j,$hname,$str);

      local $1;
+     $str =~ s/[()]//g;
      if ($str =~ /IN\s+A\s+(\S+)/) {
        $self->lookup_dnsbl_for_ip($pms, $ent->{obj}, $1);
      }

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

Reply via email to