November 24, 2019 4:34 PM, "Andrew Kanaber" <akana...@chiark.greenend.org.uk> wrote:
> Hi, > > I'm setting up an embedded machine that won't be able to send mail to > the internet and it seems excessive to leave smtpd running just so root > can receive cron job output, but I can't see a way to cut smtpd out of > the delivery chain because mail.local doesn't implement sendmail-style > command-line options (in particular it doesn't have the -t option to > extract the recipient from the message headers) so I can't use it in > place of smtpctl in /etc/mailer.conf. > > I could probably get cron to mail.local delivery working by editing and > recompiling cron to change the popen arguments but that seems like more > trouble than it's worth in the long run. > or simpler, you can write a wrapper to mail.local and use that wrapper in the mailwrapper config, but bear in mind that mail.local requires root as it writes to /var/mail, so your wrapper must either be restricted to root crontab or be setuid with all that implies. > Is there some other way to do this? Is there a reason I've missed that > this is actually just a bad idea? > I'd use a wrapper... but I'd also leave smtpd because it's idle when not in work so the cost of running it vs hacking a work-around is not too in favor of the work-around as far as I'm concerned.