1

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'.

From /etc/postfix/main.cf:

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?

Starfish
  • 2,735
  • 25
  • 28
artvolk
  • 309
  • 2
  • 10

1 Answers1

1

I use vixie-cron and ssmtp for a similar situation. What I do, especially for root jobs, is pipe the output of the command through | mail -r "required_user@external-domain.com" target_user@wherever.com; it's tedious but it works.

ΤΖΩΤΖΙΟΥ
  • 1,048
  • 1
  • 10
  • 19
  • Yes, I also have vixie-cron. Unfortunatelly this is a custom built VDS even without 'mail' command. Finally I wrap the call to my task in php which captures output and emails it. You solution should work too, so I mark it as an answer. – artvolk Nov 16 '10 at 10:27