I've got msmtp setup on Ubuntu 10.10 so that cron can send me emails. That works like a champ, for the most part.
However, emails coming to my gmail account show up as coming from (unknown sender), and the headers show:
From: root (Cron Daemon)
How can I set the From header to a valid email address?
I've just got msmtp symlinked as /usr/sbin/sendmail
The one possible solution I've found is here: http://tech.bluesmoon.info/2010/01/pretty-print-cron-emails.html
However, I'm curious if there's a simpler way.
Best Answer
I've found two solutions:
set_from_header on
configuration setting, which can override the existingFrom:
unlike the earlieradd_missing_from_header
which could only add it when missingmsmtp-mta
package, now useless,/usr/local/bin/msmtp-pseudo-mta.bash
chmod 755 /usr/local/bin/msmtp-pseudo-mta.bash
Idea from: https://serverfault.com/a/441414/17379