Mac Installation Email 101
1:00 am in Technology by Gaz
This is the fourth part of a short series of posts about installing Mac OS X. Today’s article covers my email setup. If you missed earlier parts, links are at the end of this post. After this I’ll cover the last few installation goodies in the upcoming final part of the series.
Having locked down and configured my macBook configuration and then installed my favourite productivity applications as described in the earlier parts of the series, one of the last things I need to do is set up my Email access.
I’ve used a huge number email clients over the years (my first job out of University sat me opposite Malc Arnold, author of the esoteric AF), but despite it’s limitations Apple Mail is so well integrated with the OS that, for all the times I’ve become annoyed with it and flirted with other clients, I’ve always come back to Apple Mail. There are also a tremendous swathe of addons and plugins that can fill in for some of the worst missing features.
Here’s what I do to Apple Mail to have it work just the way I like…
1. Edit in Textmate
Apple mail is a nice place to manage all my email, but I certainly don’t want to be stuck with it for editing my emails when I have TextMate installed on my machine already. Among its many talents, TextMate makes a fine email editor capable of refilling quoted paragraphs correctly while still keeping the quote marks nested properly, among others. The feature isn’t well documented but involves installing an input manager from TextMate. In the TextMate menu on the cog button in the middle of the Textmate status bar is an entry called Install "Edit in TextMate"... which guides you through the process.
You might need to set up the syntax colouring for nested quotes in the Fonts & Colors preferences for your colour theme. But that is simply a matter of creating elements for various levels of nested markup.quote scope selectors, and attaching appropriate colours as usual.
Once installed, reply to emails with Mail as usual, but select Edit in TextMate from the Edit menu to transfer the contents of the reply window into TextMate. When you’re done, press Command-S Command-W to save your reply and transfer it back into Mail ready for sending.
Price: €39, but TextMate is much more than a just a swanky email editor.
2. GPGMail
I always digitally sign all of my outgoing mail (unless I’m stranded with only someone else’s machine and webmail), and GPGMail is a bundle that wraps the FSF‘s GPG cryptographic toolkit up for Mail.
It doesn’t come with its own copy of GPG, which is a good thing because it hasn’t been updated in a while, and I like to run with the latest stable GPG from MacPorts. GPGMail looks for a GPG binary at /usr/local/bin/gpg, so after MacPorts has built its GPG in /opt/local/bin/gpg, you have to create a softlink to keep GPGMail happy:
$ sudo ln -s /opt/local/bin/gpg /usr/local/bin/
After I first upgraded to a macBook, I noticed that Apple Mail would often forget to mark messages I’d looked at as read on the IMAP server, so when I next started it up, a few dozen messages from the last few days in each folder would be marked as unread again. Eventually, I narrowed it down to a bug in GPGMail which allowed the local cached copy of messages to be correctly marked read, but often stopped the IMAP server from being updated. To stop this happening be sure to deselect the following options in the Viewing tab of GPGMail’s preferences:
- Authenticate Messages Automatically
- Decrypt Messages Automatically
For security, I have GPGMail set to always ask me for my passphrase, and then discard it from memory, so it wasn’t able to automatically authenticate or decrypt without prompting me anyway. Turning off those options doesn’t actually degrade GPGMail, but it does keep the IMAP server properly informed of which messages I have read.
Price: $0
3. LetterBox
With a widescreen macBook, it’s a shame to waste a lot of real estate by stacking the message list and the message view vertically. You can see some screen shots of how Apple Mail looks with the LetterBox plugin installed in this older post. Rather than compromising with either a tiny view of the message list, or having to scroll down on every message in the viewer to get to the reply text, LetterBox allows full height for both panes by putting them next to each other horizontally.
Price: $0
4. Mail Act-On
For keeping track of actions that come at me via email, Mail Act-On is a godsend for me. It hooks into Mail’s existing rules configuration, allowing you to run anything you can do with a Mail rule with a simple key press. And if that isn’t already flexible enough for you, it is written by the author of Mail Tags, so the two work together extremely well.
Price: $0
5. Mail Tags 2
I bought a license for Mail Tags to help me implement my Digital Third with Journler. I still need to find time to evaluate iGTD as a replacement for Journler, especially as it has such excellent Mail Tags integration. More on that in another post. In the mean while, I can continue using the Mail Tags based workflow I’ve become used to over the last six months or so.
Price: $29.95 with a 21 day free trial.
6. Next Unread
One of the major gripes I used to have with Apple Mail is the lack of a next unread mail shortcut. I attach the following Applescript to Command-N using a Quicksilver trigger. With Quicksilver set to only fire this trigger in Mail, I can now press Command-N, and focus moves to the next unread message in the current folder:
tell application “Mail”
- - Get date & subject of first selected message
set theSelection to selection
set theDate to date received of item 1 of theSelection
set theSubject to my trimRe(subject of item 1 of theSelection)
- - Make a list of unread messages in selected mailboxes newer
than currently selected message
set messageList to {}
get selected mailboxes of message viewer 1
repeat with thisBox in result
- - Use “read date < theDate” to find previous unread message
set messageList to messageList & (messages of thisBox
whose date received > theDate and read status
is false)
end repeat
set nextMessage to {}
- - Remove the following block unless you “Organize by Thread”
repeat with thisMessage in messageList
if my trimRe(subject of thisMessage) is theSubject then
set nextMessage to {(thisMessage)}
end if
end repeat
- - If there is a newer unread message, select it.
try
if nextMessage‘s length > 0 then
set message viewer 1′s selected messages to nextMessage
else
- - Use “{(messageList’s first item)}” to find previous unread message
set message viewer 1′s selected messages to {(messageList‘s last item)}
end if
activate
on error
beep
end try
end tell
- - Trim all ‘Re: ‘ prefixes from theSubject
on trimRe(theSubject)
set thePrefix to characters 1 thru 4 of theSubject as string
repeat while thePrefix is “Re: “
set theSubject to characters 5 thru end of theSubject
as string
set thePrefix to characters 1 thru 4 of theSubject as string
end repeat
return theSubject
end trimRe
Currently the script is optimised for viewing in threaded mode with all threads expanded. If you don’t organize by thread, then you should remove the repeat loop for setting nextMessage before compiling the script. Also, this will find your previous unread mail if you sort your messages with newest at the top, but again, the script is easy to fix. Unfortunately, the Mail Applescript dictionary doesn’t supply any means for the script to interact with message threading, or I could have made the script automatically select the appropriate behaviour.
As it stands, if you seem to lose the message selection after pressing Command-N, it’s probably focused inside a collapsed thread… just remember to Expand All Threads before stepping through unread messages.
Price: A Pint of Guinness if you like it!
7. Postfix Enabler
As a frequent traveler, it’s impossible to rely on having an always-on internet connection. If I wasn’t lazy (and laziness is a virtue for an engineer!), I could remember to save drafts of my outgoing emails when I’m not connected, and then send them manually when my connection next comes up. Postfix Enabler is a straight forward GUI to tweak the configuration in Mac OS X’s bundled mail daemon so that it will do all that for me. I simply point Mail.app at localhost, and I can reply to and send emails to my hearts content, safe in the knowledge that my suitably enabled Postfix daemon will queue the messages, and resend automatically when the opportunity arises.
Another benefit of running Postfix as a smart forwarder is that I have some scripts set up to fire notification emails to the appropriate mailing lists when I commit changes to the GNU projects I contribute to. By pointing those scripts at localhost:25, sending those emails is easy even from a shell script.
Price: $9.99
It sure would be nice if they have fixed the mailto: issue in Thunderbird too, but I have a sneaking suspicion that the dialogue doesn’t actually change the default in Mac OS…
Also, if there is an option to change it after installation, then it is very well hidden in the latest stable TB release :-(
Nice to see the Thunderbird team finally closed that darn Address Book issue. After downloading the latest nightly build and following the instructions, it seems to allow me to select entries from my Mac OS X Address Book, although support seems to only be one way (though that is not so much an issue).
Unfortunately, its not quite release quality yet (crash) so i think i’ll have to pass on Thunderbird for now. :)
With regard to mailto links, Thunderbird (the nightly build again) asked me i wanted to set it as the default e-mail client for the system when i first started it up, so i guess you can do it in Thunderbird rather than going through Apple Mail.
Correo is new to me, and looks like a project to keep an eye on. Thanks for the link :-)
With my Zaurus, I’m still impressed with TinyMail, though it is just a framework and needs someone to build a full featured client around it.
Thunderbird is one of only two MUA’s that threads messages properly by using In-Reference-To headers and Message-Ids rather than just comparing Subject header contents (the other one is Mutt), and for that reason alone was my client of choice when I still used Linux as my main OS. Note that the Bug 203927 – Add ability to read from Mac OS X system Address Book Issue was closed in TB Bugzilla just today, so the trunk now interacts with the Mac AB :-D
Octavia uses Thunderbird and FireFox on her Mac, and last week asked me why mailto: links in FireFox try to bring up Apple Mail for sending the message when she hasn’t even been through the configuration wizard for Apple Mail. It turned out that the default mailto: handler is set in the Preferences of Apple Mail, so I had create a dummy account just to get to that Preference to tell Mac OS that Octavia uses Thunderbird!!
Mac OS is hooked so deeply into Apple Mail that no matter how you slice it, it seems a lot easier to twist Apple Mail to work for you than to jump ship entirely for a third party MUA. Antitrust lawsuit anyone? ;-)
Interesting set of solutions.
A while ago, i had a look round for alternative e-mail clients for Mac OS X (since i was getting a little fed up of Mail and its dodgy IMAP support). The only vaguely promising ones i found (that were free) were Thunderbird, Correo, GNUMail, and Mulberry.
Thunderbird was sadly missing crucial integration with the Address Book. GNUMail didn’t seem so bad (looked a bit like Panther’s Mail.app), but it missed crucial support for HTML e-mail’s, plus it followed the open source philosophy of being difficult to configure in places.
As for the other two, i haven’t really tried them. Correo is not very old, whilst Mulberry seems to be the offshoot of a long-dead company, although i did notice it supported signing & encrypting messages so its not that bad.
In any case, i don’t think any of them support features like 3, 4, or 5. :(