dischord.org » More mutt on OSX
In my quest to return to using the (seemingly) anachronistic mailer that is mutt I’ve come across quite a few obstacles. The configuration outlined here is adequate with two exceptions: a) You’re not especially impatient and b) You have a stable, permanent Internet connection - otherwise no mail. I’m definitely impatient so it’s already bad enough living with (a), and considering I spend most of my time on a laptop which may or may not be online at any given moment you can see where using mutt as my primary MUA falls flat on its face.
So this means moving my mail store off my server and back to having it local, but again because I switch from machine to machine that idea presents various problems. Using POP everywhere is messy and would almost certainly mean that I’d lose the supposedly ’stateless’ advantage that using IMAP can provide, so I’d rather stick to the IMAP approach. One solution would be to replicate the IMAP store on my server locally, synchronising changes when they happen, and luckily there’s already a handy tool for doing exactly that - OfflineIMAP:
OfflineIMAP is a tool to simplify email reading. It allows you to read the same mailbox from multiple computers and ensures that your changes will be automatically reflected on all computers. You can use various mail clients to read a single box or read mail while offline with full synchronization when you reconnect.
OfflineIMAP is in darwinports so it’s easy to install and get up and running. One problem I did come across however is when synchronising emails with sizeable attachments, such as anything > 1MB in size. This seems to be a problem with some Darwin and Python specifics (so you shouldn’t see this problem on any platform other than OSX) that cause Python to choke with a memory error. I’ve come across a workaround which appears to do the trick, however. You need to edit:
/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/socket.py
and change the line that says:
recv_size = max(self._rbufsize, left)
To say:
recv_size = min(self._rbufsize, left)
Instead.
Another consideration is outbound mail and queueing should your relay host be unavailable. esmtp doesn’t provide any way of doing this, so I’ve switched to nbsmtp (the ‘No Brainer SMTP client’) which comes with a handy wrapper script called nbqueue which will queue outbound mails.
Aside from that mutt requires a little reconfiguration to switch back to local Maildir mailstores and then you’re away. Now mutt is nice and quick (as it’s reading from local Maildirs) and I can read and compose mails whilst offline. Easy! :)