spamassassin throws errors in amavis cron job

The spamassassin install uses a cron job to do sync and cleanup called amavisd-new-cronjob. This job throws up errors on the Debian 7.

error creating a DNS resolver socket: Network is unreachable at 
/usr/share/perl5/Mail/SpamAssassin/DnsResolver.pm line 235.
plugin: eval failed: error closing socket: Bad file descriptor at 
/usr/share/perl5/Mail/SpamAssassin/DnsResolver.pm line 568.

Looking into it the culprit is the check for whether Bayesian filtering is enabled at all, i.e. these lines:

if ! perl -MMail::SpamAssassin -e "my \$spamtest = Mail::SpamAssassin->new();
\$spamtest->compile_now (); \$spamtest->{conf}->{use_bayes} ? exit 0 : exit 1"
then
 #bayes is disabled - just exit
 exit
fi

Why it does not work and what precisely it needs, I have no idea and no desire to chase the error. Some Perl module or a plugin may be missing. Anyway, since Bayesian is enabled, I simply commented out the above lines in the /usr/sbin/amavisd-new-cronjob file and left it at that.

If you know how to fix it – let me know, please.

One thought on “spamassassin throws errors in amavis cron job

  1. Not much help, but I am having exactly the same issue. Debian 7, configured using ISPConfig so-called “perfect server” set up.

    And an error message gets issued by email on the 18th minute of every third hour, that reads:-

    error creating a DNS resolver socket: Network is unreachable at /usr/share/perl5/Mail/SpamAssassin/DnsResolver.pm line 235.
    plugin: eval failed: error closing socket: Bad file descriptor at /usr/share/perl5/Mail/SpamAssassin/DnsResolver.pm line 568.

    Totally baffled. But it might be reassuring for you that you are not the only person facing this problem.

Comments are closed.