You are using an outdated browser which puts all net citizens at risk. As an incentive to upgrade to a current and thus much more secure product (we recommend the free Firefox browser), you won't be able to visit this site in its cute design, but in this rather boring printer-ready version only. Thank you for considering a browser update!

Sendmail via Growl

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.

Postfix or sSMTP

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.

Sendmail via Growl

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

(Sven Schwyn)

(We are remaking our web presence and therefore comments are temporary disabled.)