This blog article is out of date, check out sendmail-notifier instead.
If you have never seen the shell prompt of your Mac, then this post is not for you. However, if you are used to work with more than just the eyecandy parts of Mac OS X, you probably have come across the following problem at some point: Some asynchronous system tools such as Cron or Portage from Gentoo Prefix pipe their output to sendmail and hope someone will receive it. Yet, that won’t happen with the current default settings.
There are several ways to fix this. You could configure the Postfix MTA bundled with Mac OS X to relay the messages to your SMTP host. Unless you know quite a bit about Postfix already, you should however cancel your plans for the rest of the day. Or go for some frontend GUI application if you don’t mind it to mess around with your configuration.
You could also install sSMTP as a really simple replacement MTA which is a breeze to configure. Unfortunately, it doesn’t do SASL (unless you build from Andrew Wansink’s fork bfg branch). And without SASL, delivery will quite silently fail if the recipient address relies on greylisting to reduce SPAM.
Time to take one step back: Is it really necessary to deliver these messages? If this were a server, the answer would be an unconditional “yes”, but we are talking about a Mac OS X workstation here, so there shouldn’t be any root cronjobs and the Mac shouldn’t be on all day and night – for our planet’s sake. Why not just display a Growl notification?
It is pretty easy to turn sendmail messages piped to sendmail into Growl notifications, so I’ve written a little script for this purpose. Download sendmail-via-growl, move it to /usr/local/bin and make it executable. As always, you are using this script at your own risk.
To enable Growl notifications:
sendmail-via-growl --on
To test Growl notifications:
echo “Let’s test this!” | sendmail
The Growl notification strips all mail headers beginning with “X-”. If you want to read the complete message, look for it in /tmp/sendmail-via-growl where old messages are kept for 30 days.
And you can of course revert back to the original sendmail:
sendmail-via-growl --off
(We are remaking our web presence and therefore comments are temporary disabled.)