Le 18/09/2022 à 00:32, Greg Wooledge a écrit :
On Sat, Sep 17, 2022 at 11:11:51PM +0200, Yvan Masson wrote:
My question is: how cron daemon and mail command know that they should
contact openSMTPd, and how? Do they try by default on localhost:25 or
/run/smtpd.sock? I could not find any clue, nor in cron manpages nor in
mailutils online documentation.

mail(1) or mailx(1) or similar utilities run the /usr/sbin/sendmail
program to inject a new message into the local MTA.

/usr/sbin/sendmail was of course originally provided by the sendmail
package.  But later MTAs implement a /usr/sbin/sendmail compatible wrapper
so that all the utilities that send mail don't have to change.

Thanks Greg!

Indeed, just to confirm for other interested on this topic, this is documented for `mail` command on https://mailutils.org/manual/mailutils.html#Mail-Variables, and for Vixie/ISC cron (default cron daemon on Debian) on https://salsa.debian.org/debian/cron/-/blob/master/config.h.

So the `mailutils` package with `mail` command is optional: `sendmail` could be used directly in scripts (but it might be a bit less practical to use, see for example https://www.computerhope.com/unix/usendmai.htm#examples).

Regards,
Yvan

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to