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
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.