• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How to patch spamassassin ( DnsResolver.pm )

U

UFHH01

Guest
At the moment, there is a tiny bug with spamassassin, that results in some (error)-info-messages like:
Code:
Feb 27 00:00:00 XXXXX spamd[XXXXX]: plugin: eval failed: available_nameservers: No DNS servers available!

Feb 27 00:00:00 XXXXX spamd[XXXXX]: rules: failed to run NO_DNS_FOR_FROM RBL test, skipping:
Feb 27 00:00:00 XXXXX spamd[XXXXX]:  (available_nameservers: [...] No DNS servers available!)
Feb 27 00:00:00 XXXXX spamd[XXXXX]: spf: lookup failed: available_nameservers: No DNS servers available!
Feb 27 00:00:00 XXXXX spamd[XXXXX]: rules: failed to run DKIM_ADSP_NXDOMAIN test, skipping:
Feb 27 00:00:00 XXXXX spamd[XXXXX]:  (available_nameservers: [...] No DNS servers available!)
Feb 27 00:00:00 XXXXX spamd[XXXXX]: spf: lookup failed: available_nameservers: No DNS servers available!

Because of some changes to the PERL module "Net :: DNS version 0.76", there are some changes for the object "nameserver", which has been changed to "nameserver4" "and "nameserver6", but these changes were not yet transported to all vendors spamassassin versions ( depending file: "DnsResolver.pm" ). To solve this issue, you could apply the suggested patch and don't have to wait any longer to solve the issue:


1. Locate your DnsResolver.pm - file on your system with:

locate DnsResolver.pm
2. Create a file with the suggested patch ( reference: https://svn.apache.org/viewvc/spama...lver.pm?r1=1603518&r2=1603517&pathrev=1603518 ) on your system with the command:

touch /root/DnsResolver.pm.patch

and edit the patch - file with the content:
PHP:
--- 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;

Please note, that the path "spamassassin/trunk/lib/Mail/SpamAssassin/" can vary to your system configuration, so please make sure, that the path matches your "locate" - command in the first step.


3. To patch the located file "DnsResolver.pm" now, you would use the command:

patch < /root/DnsResolver.pm.patch

4. Restart spamassassin with the command:

/etc/init.d/spamassassin restart
( or service spamassassin restart )


--------------------------------------------------
Please be aware that Plesk updates/upgrades/patches may overright your changes without any notice and you might have to check and re-apply the whole patch as described untill Parallels patches spamassassin as well.

If you have questions to this "How to", or experience any issues, please be so kind to include error messages, depending ( configuration ) files and mention as well your operating system, please.
 
Last edited by a moderator:
We are grateful to you, UFHH01, for this “How to”.
Thanks a lot from our team!
 
Hello,
I changed my DnsResolver.pm ad described above.
The DNS found is now gone.
But i now receive the following warnings in de mail.log

plesk spamd[16155]: Use of uninitialized value $rr_type in string eq at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/AskDNS.pm line 592

And these lines are there since i update de DnsResolver.pm.

Can you help me how to solve this??

Henk
 
Back
Top