I have a server with Gentoo and Postfix. Postfix is configured so that all e-mail messages are routed through an external relay which requires a particular address in 'From'.
relayhost = relay.example.com
I also have a cron task, which I'd like to send e-mail from. But the 'From' address is 'user@hostname', which is not allowed on a relay. Is it possible to substitute the correct address to cron for sending messages or fix the Postfix configuration in some way?