#741521 spamassassin: DNS resolving should get reloaded

#741521#5
Date:
2014-03-13 12:41:36 UTC
From:
To:
Hello,

spamd is emitting loads of this in my msyslog:

Mar 13 07:54:31 type spamd[9954]: dns: sendto() to [127.0.0.1]:53 failed: Connection refused, no more alternatives

and DNS-based rules do not work.

Simply restarting spamassassin gets this error away. I indeed do not
have a DNS server on my laptop, and do not plan to.

What happens is that when spamassassin gets started at system bootup,
/etc/resolv.conf is empty, because I don't have wired network on my
laptop, and I only switch on the wireless network later, and thus
/etc/resolv.conf contains DNS servers only later. Since spamassassin
instantiates Net::DNS::Resolver only once, the late filling of
/etc/resolv.conf is not noticed by spamassassin, and thus the DNS
resolving errors mentioned above keep happening until I restart
spamassassin.

So I would say that spamassassin should somehow reload the resolver, to
re-read /etc/resolv.conf with the new DNS server information. This has
to be done even if /etc/resolv.conf was not empty, since a laptop could
move from one wifi network to another, with varying DNS configuration
parameters.

Samuel
That's a city in Bosnia.  Right?
(Discussion in comp.os.linux.misc on the intuitiveness of commands.)

#741521#10
Date:
2017-03-25 20:12:02 UTC
From:
To:
Have you tried adding this:
ConditionDirectoryNotEmpty=/etc/resolv.conf
to the Unit section of:
  /usr/lib/systemd/system/spamassassin.service

#741521#15
Date:
2022-10-30 16:28:55 UTC
From:
To:
As a reminder, mails sent to nnn@bugs.debian.org are *not* sent to the
bug submitter, so I had never received that reply:

John Damm Sørensen, le sam. 25 mars 2017 21:12:02 +0100, a ecrit:

No, but that would still fail the case when "a laptop could move from
one wifi network to another, with varying DNS configuration parameters."

Samuel

#741521#20
Date:
2023-06-21 13:37:16 UTC
From:
To:
FWIW, I run into this too.

I reported #1034347 which has been fixed, but this only addresses DNS
issues on bootup.

But whenever I move my laptop to a new wifi network, I have to restart
spamd manually.