On Fri, 12. Feb 2010, 18:43:19 -0500, Nathan Weston wrote:
I'm using msmtp on my desktop machine to get output from cron jobs, etc
at my usual email address instead of a local mailbox.
Unforunately, cron will sometimes send email to root, and msmtp will try
to deliver such messages to root on my ISP's SMTP server, leading to
cranky phone calls from their sysadmins.
I can set the MAILTO environment variable in cron. But if I screw that
up, or some other program decides to send mail to root, I'll have the
same problem, and I won't know it's happening until the poor admin gets
sick of it and calls me again.
Is there a way for smtp to either a) use an alias for root or b) reject
email when the to address has no domain? Or is there some other way
around this problem?
While msmtp can be used as a minimal, special-purpose system MTA, this
is not its main purpose and it lacks many important features of a real
MTA.
For your situation, msmtp should support /etc/aliases and/or local
deliveries.
It is possible to restructure msmtp and integrate support for these
features. This is suggested repeatedly, but I currently do not have
the time to do this myself. However, patches are welcome :)
In the meantime, it may be a good idea to have a look at real MTAs
to solve your problem.
Martin