r***@falu.nl
2014-10-10 09:20:00 UTC
Number: 49268
Category: pkg
Synopsis: SpamAssassin can't find DNS servers [with patch]
Confidential: no
Severity: serious
Priority: high
Responsible: pkg-manager
State: open
Class: sw-bug
Submitter-Id: net
Arrival-Date: Fri Oct 10 09:20:00 +0000 2014
Originator: Rhialto
Release: NetBSD 6.1.5
System: NetBSD murthe.falu.nl 6.1.5 NetBSD 6.1.5 (MURTHE6.1.5) #0: Sun Oct 5 01:15:04 CEST 2014 ***@vargaz.falu.nl:/usr/src/sys/arch/amd64/compile/MURTHE6.1.5 amd64Category: pkg
Synopsis: SpamAssassin can't find DNS servers [with patch]
Confidential: no
Severity: serious
Priority: high
Responsible: pkg-manager
State: open
Class: sw-bug
Submitter-Id: net
Arrival-Date: Fri Oct 10 09:20:00 +0000 2014
Originator: Rhialto
Release: NetBSD 6.1.5
Architecture: x86_64
Machine: amd64
After updating to the new stable pkgsrc-2014Q3 branch,
SpamAssassin started to pass a lot more spam than it used to.
Looking in the /var/log/maillog, I saw repeated blocks of
Oct 10 10:33:18 murthe spamd[8172]: spamd: processing message <***@msgid.spamcop.net> for rhialto:1000
Oct 10 10:33:18 murthe spamd[8172]: plugin: eval failed: available_nameservers: No DNS servers available!
Oct 10 10:33:18 murthe spamd[8172]: plugin: eval failed: available_nameservers: No DNS servers available!
Oct 10 10:33:18 murthe spamd[8172]: rules: failed to run NO_DNS_FOR_FROM RBL test, skipping:
Oct 10 10:33:18 murthe spamd[8172]: (available_nameservers: [...] No DNS servers available!)
Oct 10 10:33:18 murthe spamd[8172]: rules: failed to run DNS_FROM_AHBL_RHSBL RBL test, skipping:
Oct 10 10:33:18 murthe spamd[8172]: (available_nameservers: [...] No DNS servers available!)
Googling provided this message: https://major.io/2014/06/20/fixing-broken-dns-lookups-in-spamassassin/
leading to https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7057
leading to this patch:
https://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm?r1=1603518&r2=1603517&pathrev=1603518&view=patch
I applied the patch, and after that SpamAssassin seemed much
better. The log messages didn't reappear.
Additionally, I checked it with "spamassassin -D dns -t <test.msg".
The currently latest version of SpamAssassin seems to be 3.4.0,
the same as what pkgsrc has, so currently this fix isn't in a
release version (the bug report mentions fixing it in svn in
comment 5).
--- spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm 2014/06/18 16:47:04 1603517
+++ spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm 2014/06/18 16:48:04 1603518
@@ -204,8 +204,10 @@
@ns_addr_port = @{$self->{conf}->{dns_servers}};
dbg("dns: servers set by config to: %s", join(', ',@ns_addr_port));
} elsif ($res) { # default as provided by Net::DNS, e.g. /etc/resolv.conf
- @ns_addr_port = map(untaint_var("[$_]:" . $res->{port}),
- @{$res->{nameservers}});
+ my @ns = $res->UNIVERSAL::can('nameservers') ? $res->nameservers
+ : @{$res->{nameservers}};
+ my $port = $res->UNIVERSAL::can('port') ? $res->port : $res->{port};
+ @ns_addr_port = map(untaint_var("[$_]:" . $port), @ns);
dbg("dns: servers obtained from Net::DNS : %s", join(', ',@ns_addr_port));
}
return @ns_addr_port;
-Olaf.
--
___ Olaf 'Rhialto' Seibert -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl -- 'this bath is too hot.'
___ Olaf 'Rhialto' Seibert -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl -- 'this bath is too hot.'