Bug ID 1114761
Summary spamassassin spamd writing errors int logfile and not scanning some email
Classification openSUSE
Product openSUSE Distribution
Version Leap 15.0
Hardware x86-64
OS SUSE Other
Status NEW
Severity Minor
Priority P5 - None
Component Other
Assignee bnc-team-screening@forge.provo.novell.com
Reporter pszaban@wne.edu
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Firefox/60.0
Build Identifier: 

Lots of messages like the following are being written into LEAP 15.0
/var/log/messages file by URIDBL.pm (spamassassin-3.4.1-lp150.5.3.x86_64)
plugin:

2018-11-02T00:01:11.353456-04:00 XXXX spamd[2641]: Use of uninitialized value
$4 in concatenation (.) or string at
/usr/lib/perl5/vendor_perl/5.26.1/Mail/SpamAssassin/Plugin/URIDNSBL.pm line
1044.



Reproducible: Sometimes

Steps to Reproduce:
1.install Leap15.0, postfix and spamassassin
2.configure postfix to use spamassassin
3.start spamd and postfix
4.wait for email to come in via SMTP on port 25
5.examine /var/log/messages to see the error

    Unfortunately, I have a lot of config changes in postfix's main.cf and
master.cf. I don't think it matters, g spamassassin and postfix seems to do the
same thing.  FYI: I send mail from postfix to spamd with the following lines in
postfix's master.cf:

smtp      inet  n       -       n       -       -       smtpd
    -o content_filter=spamfilter:dummy
.
.
.
spamfilter      unix    -       n       n       -       -       pipe
  flags=Rq user=defang argv=/usr/local/bin/spamfilter.scr -f ${sender} --
${recipient}
    where /usr/local/bin/spamfilter.scr contains:

#! /bin/bash
/usr/bin/spamc --max-size=1500000 | /usr/sbin/sendmail -i "$@"
exit $?
   ...and I start spamd with:
/usr/sbin/spamd -d -i 127.0.0.1 -i ::1 -p 783 -x -m 40 -u spamd -r
/var/run/spamd.pid --siteconfigpath=/usr/local/etc/mail/spamassassin/

Actual Results:  
/var/log/messages contains things like:
2018-11-02T00:01:11.353456-04:00 XXXX spamd[2641]: Use of uninitialized value
$4 in concatenation (.) or string at
/usr/lib/perl5/vendor_perl/5.26.1/Mail/SpamAssassin/Plugin/URIDNSBL.pm line
1044.


Expected Results:  
should not have produced the error message, and should have scanned the message
for URI's and looked them up in the DNS blocklists.

 I google'd the problem and installed the following patch to
/usr/lib/perl5/vendor_perl/5.26.1/Mail/SpamAssassin/Plugin/URIDNSBL.pm.  The
patch *appears* to have solved the problem for me:
--- spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm 
2015/04/28 20:36:05     1676616
+++ spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/URIDNSBL.pm 
2015/08/04 23:16:38     1694126
@@ -942,9 +942,8 @@
     next unless (defined($str) && defined($dom));
     dbg("uridnsbl: got($j) NS for $dom: $str");

-    if ($str =~ /IN\s+NS\s+(\S+)/) {
-      my $nsmatch = lc $1;
-      $nsmatch =~ s/\.$//;
+    if ($rr->type eq 'NS') {
+      my $nsmatch = lc $rr->nsdname;  # available since at least Net::DNS 0.14
       my $nsrhblstr = $nsmatch;
       my $fullnsrhblstr = $nsmatch;

@@ -1025,9 +1024,9 @@
     }
     dbg("uridnsbl: complete_a_lookup got(%d) A for %s: %s", $j,$hname,$str);

-    local $1;
-    if ($str =~ /IN\s+A\s+(\S+)/) {
-      $self->lookup_dnsbl_for_ip($pms, $ent->{obj}, $1);
+    if ($rr->type eq 'A') {
+      my $ip_address = $rr->rdatastr;
+      $self->lookup_dnsbl_for_ip($pms, $ent->{obj}, $ip_address);
     }
   }
 }

    I'm reluctant to make many changes to the system to perform testing for
fear of losing email.  I mostly wanted to make you aware of the issue, and a
potential solution to save someone else from having to go through what I
recently went through to fix this.


You are receiving this mail because: