My goal is to send everything that gets output from the cron daemon (no matter which crontab) to an external email address with the correct TO
email header.
I set MAILTO
in /etc/default/cron
to MAILTO=root
and set /etc/postfix/virtual
to root [email protected]
. This setup works, output from each crontab is delivered to [email protected]
, but the annoying thing is that, the TO
email header does not change, it's still [email protected]
- the only change is that an additional Delivered-To: [email protected]
is added. Even though the message is received by the external email address I don't like the fact that I have a wrong TO
- I want to have a clean and tidy setup. That means to me that I'm doing something wrong here.
If I set MAILTO
in each crontab separately the correct TO
header is set - but this is to much work, I have to alter each crontab, that's why I want to have a general solution.
How do I send everything that gets output from the cron daemon to an external email address with the correct TO
email header?