IMAP Push Notification with Boxcar and Procmail

Apple’s iOS supports push notification of new email, but not for generic IMAP servers, and the last thing I ever want to do is set up an Exchange server or switch to Yahoo Mail.

I prefer to run my own mail server, but sometimes I would still like immediate notification of new email messages. The Boxcar service allows you to accomplish this by forwarding your email to a secret address they give you. They then use the Apple Push Notification Service to notify you of the sender and subject on your iOS device.

Now, I certainly don’t want notification for every message, but I do want to know when certain people or organizations have emailed me. If you’re a gmail user, you can play with their filters to try and accomplish this. I use that favorite tool of mail administrators everywhere: procmail.

Here’s an example procmail recipe I use to provide me with selected notifications (make sure SENDMAIL is set to the full path to your sendmail program):

# Send on to Boxcar push notification service certain messages' headers
* ^Subject:.*New.Voicemail*|\
| formail -X"From" -X"Subject" | $SENDMAIL

This way, if I get a voicemail message (I use Telemessage, which does vmail-to-email conversion), a message from my sister, mother, or BFF, or from any address at one of my clients, the From: and Subject: headers are forwarded on to Boxcar, which then sends an immediate pop-up to my phone.

Note that you can send Boxcar the entire message and they promise to throw away the body of the message. I feel better avoiding any possible data leak by sending them the bare minimum of what they need; hence the formail -X"From" -X"Subject", which strips the message of everything but those two headers.

Of course procmail is extremely flexible and you should be able to adjust your .procmailrc file to specify exactly which files to send on to Boxcar. Note that Boxcar also provides many other notifications besides email, such as Twitter mentions and a whole lot more.

No Comment

No comments yet

Leave a reply