Monday, January 3, 2011

Making cron send mail to an external address

So, you've filled in "me@example.com" as your address in your crontab's MAILTO field, but nothing happens. Probably you're getting a message like "Mailing to remote domains not supported".

There's an easy way to send mail to an external address from a cron job: set up
http://untroubled.org/nullmailer/. It asks you for the address of an SMTP server and uses that to send your precious update notifications of that remote server you never log in on anymore.

If you have accidentally installed another mail program (like mailutils), you can dpkg-reconfigure nullmailer to make it work again.

No comments: