On 7/12/21 3:20 AM, Chris Vine wrote:
> That can indeed be useful where you have, say, a laptop which relies
> on a wireless connection for internet access which may not always be
> present. Running your own MTA daemon on port 25 on the laptop enables
> you to use the daemon to queue emails from user programs and then
> automatically send them when an internet connection is established.
> This saves the user having to queue messages in the email client and
> having to send them herself from the email client explicitly when a
> wireless connection becomes available.
This concept; connection / lack of connection, comes into play in many
different ways. Wireless, or the lack there of, is just a contemporary
example of a perpetual problem with networking.
> Unfortunately sendmail does not handle this situation: it will not
> send email via an IP interface (say, wlan0) which isn't up when
> the sendmail daemon is started.
I've not tested this particular scenario so I don't have first hand
experience. But, that being said, I believe this to be a
(mis)configuration problem.
The first thing that comes to mind is what interface(s) the daemon is
configured to listen on. You can't get a daemon to listen on an
interface / socket (IP & port pair) that is not available when the
daemon starts. However you can tell most daemons to listen on /all/
interfaces / sockets (IP & port pairs) on the system. The subtle nuance
is that the second option; all, will usually allow for IP addresses to
be added and / or removed from the system while the daemon is running.
At least that's been my experience.
The second thing that comes to mind is that you have to specifically
tell Sendmail to use the same IP to send email out as the email came in
on /if/ that's what you want. Which means that Sendmail will receive
and send email on different interfaces by default. As such, Sendmail
should be quite capable of receiving email on loopback and sending from
eth0 / wlan0 / ppp0 without reconfiguring things.
The third thing that comes to mind is that Sendmail doesn't care about
how the kernel does the IP routing, nor does it have any effective way
to influence it. -- Yes, you can get into some really weird minutia /
gyrations to effect some influence, but they are so atypical that they
are effectively a non-issue.
Sendmail, or arguably /any/ daemon, /really/ *SHOULD* be able to run in
the scenario you describe above.
> Or at least that was the case when I stopped using sendmail, partly
> for that reason (its lack of intelligible documentation and bizarre
> syntax was another reason).
I agree that Sendmail's documentation, history, and lore are ... less
than favorable. But that doesn't make it any less capable, just more
difficult to use. ;-)
> Postfix handles this situation fine and is also very well documented.
I question if Postfix and Sendmail had the same type of configuration,
as in what IPs were they listening on. Or if their configurations were
subtly different; Sendmail configured for only specific interfaces while
Postfix was listening to all interfaces.
> I run postfix on my laptops for that explicit purpose, and I set it
> up to forward to
smtp.gmail.com when a wireless connection is up.
Do you alter Postfix's state or let it continue to try and fail while
the connection is down then succeed when the connection is up?
> On my desktop, which always has an interface which is up, I have some
> monitoring processes which from time to time send out emails (usually
> to my mobile telephone) and those processes forward to
smtp.gmail.com
> directly using mailx without an intermediate MTA. Each to their own.
It has to do with the scope of the solution. A local MTA is effectively
system wide solution. Conversely mailx is only a solution for things
that use mailx. I tend to favor solutions that apply to more things or
at the very least cover all of the things that I need / want to be covered.