1

Topic: SpamAssassin Problem: No DNS servers available - FIXED!

Sharing my solution for anyone else battling the same issue...

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 2.1.3
- Linux/BSD distribution name and version: FreeBSD 10.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Mysql
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? Yes
- Related log if you're reporting an issue: /var/log/maillog
====

Caused by a Known bug in Net::DNS -> https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7057

SpamAssasin log entry:
Oct 11 16:54:09 server spamd[474]: plugin: eval failed: available_nameservers: No DNS servers available!
Oct 11 16:54:09 server spamd[474]: rules: failed to run NO_DNS_FOR_FROM RBL test, skipping:
Oct 11 16:54:09 server spamd[474]:  (available_nameservers: [...] No DNS servers available!)
Oct 11 16:54:09 server spamd[474]: spf: lookup failed: available_nameservers: No DNS servers available!
Oct 11 16:54:09 server spamd[474]: spf: lookup failed: available_nameservers: No DNS servers available!

[root@mail ~]# locate DnsResolver.pm
/usr/share/perl5/Mail/SpamAssassin/DnsResolver.pm

you will get multiple results...  look for something similar to the one above.

Backup your DnsResolver.pm in case of emergency
[root@mail ~]# cp /usr/share/perl5/Mail/SpamAssassin/DnsResolver.pm /some_location

Grab the patch file and patch DnsResolver.pm
[root@mail ~]# cd /some_location
[root@mail ~]# wget http://files1.directadmin.com/services/ … lver.patch
[root@mail ~]# patch -p0 < dns_resolver.patch

When patch asks, tell it where the file is:
[root@mail ~]# patch -p0 < dns_resolver.patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- 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
--------------------------
File to patch: /usr/share/perl5/Mail/SpamAssassin/DnsResolver.pm
patching file /usr/share/perl5/Mail/SpamAssassin/DnsResolver.pm

Restart SpamAssassin and watch logs.

Solution adapted from: http://help.directadmin.com/item.php?id=570

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: SpamAssassin Problem: No DNS servers available - FIXED!

Thanks for sharing. smile