Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 925750 - mail-filter/spamassassin: spamassassin.service starts before resolv.conf setup, causing DNS resolution errors
Summary: mail-filter/spamassassin: spamassassin.service starts before resolv.conf setu...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Philippe Chaintreuil
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-29 12:31 UTC by Dennis Lamm
Modified: 2024-03-02 11:22 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Lamm gentoo-dev 2024-02-29 12:31:02 UTC
It seems that spamassassin.service can start before the network or DNS resolution is fully configured, resulting in errors like the following:

spamd: dns: error creating a DNS resolver socket: Network is unreachable at /usr/lib64/perl5/vendor_perl/5.38/Mail/SpamAssassin/DnsResolver.pm line 436.
spamd: dns: unable to connect to [172.16.100.1]:53, no more alternatives

In the systemd service file it is started after network.target but it should be started after network-online.target


Reproducible: Always

Steps to Reproduce:
1.Use systemd service (maybe only occurs when systemd-resolved is used)
2.Inspect journal

Actual Results:  
Warning is logged

Expected Results:  
No warning is logged
Comment 1 Philippe Chaintreuil 2024-03-02 11:22:23 UTC
I'm pretty hesitant to make this change.

1.  I don't see any of the other mail-filter packages doing this.

2.  None of the MTA (eg: Postfix) wait for network-online.target either.  That means the MTA will be up, but spamd will not be.  Feels like if I make this change, I'm going to get far more bugs on that side: "My MTA can't talk to SpamAssassin because it's waiting for full-online."

I suspect that this general lack of waiting for network-online.target is that these services want to be up, initialized, and ready once online happens.


Some questions for you while I see if anyone with more systemd experience has advice:

A.  I see "After=network.target nss-lookup.target" in some places (eg: opendmarc).  Does that work for you as an alternative to waiting for full-online?

B.  Is the error during spamd startup from what you can tell, or do you have messages that are being processed before your DNS is setup?  (eg: command-line sent messages, maybe?  Or mail waiting in a serialized, disk queue for processing.)


Thanks.