#1039704 Sendmail does not notice when /etc/resolv.conf changes

#1039704#5
Date:
2023-06-28 12:13:07 UTC
From:
To:
Hi,

As far as I understood, since Debian 12, isc-dhcp-client is considered
obsolete, and dhcpcd is recommended instead.

However, dhcpcd appears to be slightly slower, with the result that on
startup sendmail sees an empty /etc/resolv.conf file.

Apparently, sendmail only reads this file once at startup (and on
reload), meaning that it won't be able to process outbound mails, as it
can't look any domain names up.

There actually *is* a /usr/share/sendmail/dynamic script meant to reload
sendmail when the network changes (i.e. nameservers become available),
but unfortunately it only leaves 2 choices:
  1. DAEMON_NETMODE="Static"  => do not reload sendmail on network change

  2. DAEMON_NETMODE="Dynamic" => recompile the entire configuration, and
reload sendmail on network change

Not only is Static the default (which means that people having newly
upgraded to Debian 12 might miss it), but Dynamic is over the top (we
don't need a complete recompilation of the configuration: it never
mentions the server's anywhere)

So could we have a "Semi-Dynamic" setting instead, which would be the
default after upgrade, and which would only do the reload, without
preceding config recompilation?

Thanks,

Alain

#1039704#10
Date:
2023-11-03 08:12:04 UTC
From:
To:
Please check how network is handled. Sendmail must be started after
all networking stuff is set up. Maybe check the discussing about moving
from sysvinit startscripts to systemd, so relevant parts can be
included in the systemd unit.

How is nsswitch.conf set?
Is a caching server like systemd-resolve or dnsmasq active?
Is nscd being used?

Maybe ask in newsgroup comp.mail.sendmail how sendmail handles DNS
lookups (does it really look up the resolv.conf or does it use glibc?).

From the sendmail 4th edition:

|But even if your sendmail binary supports DNS, site configuration
|might not. If your host supports a service-switch file, for instance,
|make sure that file lists dns as the method used to fetch information
|about hosts.

For met it looks like it doesn't directly read resolv.conf, so it might
be a general DNS problem on your system.

Can you change it and provide a patch?