Lately, the mail relay I use stopped accepting the “From” my Debian system was sending by default for the cron jobs results, something like:
I don’t have any MX records for “mydomain.fr”, nor a mail server for it, even locally.
Exim is configured to relay all non-local emails to a smart host, and I had some entries in
to forward the emails for root and some other users to my real mailboxes, e.g. for cron jobs. That worked fine for the “To” field, but not the “From”.
I started to look at Exim rewriting rules, but there is a much more straightforward solution. Exim supports the /etc/email-addresses file, that does cover exactly this use case. Check it out: