Spamd error after Apply Changes in Spam Assassin

SYSTEM INFORMATION
OS type and version Linux 4.18.0-477.13.1.el8_8.x86_64 on x86_64 AlmaLinux 8.8
Virtualmin version 7.7

When i click in the Apply Changes in Spam Assassin Mail Filter page, i get the following error in the log: spamd[1152830]: dns: bad dns reply: bgread: recv() failed: Connection refused at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/DnsResolver.pm line 742.

Line 742: defined $peeraddr or die "bgread: recv() failed: $!";

I dont host DNS in my virtualmin, i use Cloudflare for it.

Local DNS resolution isn’t working. Has nothing to do with where your domains are hosted.

These days, it’s hard to say where resolvers are configured (as it could be configured in NetworkManager, configured via DHCP, or configured statically in the traditional way), but you might start by checking /etc/resolv.conf just to see where it think it’s coming from and make sure it’s reasonable.

Most modern systems manage resolv.conf with some service rather than configuring it statically. Rocky docs may or may not apply to your server: Network Configuration - Documentation (you’re looking for the IPV4 DNS settings)

You need every DNS server you’re trying to use for resolution to work as a recursive name server.

Thanks Joe, i’ve checked the /etc/resolv.conf and it has the following:

nameserver 127.0.0.1

nameserver 161.97.189.x

nameserver 161.97.189.y

myhostname.tld

161.97.189.x and 161.97.189.y are both Contabo’s ips, where i host this box, not my box external ip(which i think its all right).

It looks resonable as far as i can tell.
In the docs from Rocky, all tests seems to be working normally.

Remove, joe said local isn’t working.
You could also look at using public name servers like google for example

1 Like

It worked, i removed 127.0.0.1, went to spamassassin and apply the changes. Logs seems normal:

18:40:43 servidor spamd[1217439]: prefork: child states: II Jun 4 18:40:43 servidor spamd[1217439]: prefork: child states: IS Jun 4 18:40:43 servidor spamd[1217439]: spamd: server successfully spawned child process, pid 1217462 Jun 4 18:40:43 servidor spamd[1217439]: spamd: server successfully spawned child process, pid 1217461 Jun 4 18:40:43 servidor spamd[1217439]: spamd: server pid: 1217439 Jun 4 18:40:43 servidor spamd[1217439]: spamd: server started on IO::Socket::IP [127.0.0.1]:783 (running version 3.4.6)

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.