New Year’s Resolution number 2 (number 1 is domestic) is, taking
inspiration from Neil Gaiman, to spend less time on Twitter and more
time on long-form – or at least, paragraphs-long-forms – of writing.
So to ease myself in gently, here’s a plug for DavMail

It might be overstating the case slightly to claim that one of the
worst things about working at $JOB is that everyone has to use
Outlook, but it’s certainly not one of the better things. So, having
a spot of time between Christmas and the New Year to improve my
working environment, I started looking for other ways to address the
Exchange server.

DavMail is a POP/IMAP/SMTP/Caldav/Carddav/LDAP exchange gateway
allowing users to use any mail/calendar client (e.g. Thunderbird with
Lightning or Apple iCal) with an Exchange server, even from the
internet or behind a firewall through Outlook Web Access.

This bit went smoothly.

(Step 1.1 was to Paypal the DavMail author a small amount of cash:
this is already making my work environment so much nicer)

Step 2: install and configure offlineimap. It would be neat if using
offlineimap didn’t require one to learn Python (folder filtering
syntax, I am looking at you) but I told it my ‘remote’ server was
reachable at localhost:1143 and cargo culted some stuff to drop all
the boring folders full of crap, and off it went (very slowly)
downloading my mail. This is approximately how my .offlineimaprc
looks:

Step 4: Oh but, dear Lord, this thing could not find an uglier way to
render HTML email, what’s up with that? Turns out this is because the
Emacs app in Homebrew wasn’t built with libxml support. Turns out
this is because the bundled libxml in MacOS Lion (other Bloodthirtsy
Yet Cuddly Big Cats are available) is missing the file that
pkg-config needs so that any app that might want to build against it
can find it. So:

Step 3.9: Building your own Mac Emacs is surprisingly easy – just
follow the instructions in nextstep/INSTALL – but unless you take steps
to make libxml show up, the resulting app will suffer the same problem
as Homebrew’s binary. So:

Step 3.8 Install the homebrew libxml package, and (2) add the .pc
file it provides to PKG_CONFIG_PATH, because – as it doesn’t want to
clash with the broken builtin libxml – it installs into some obscure
out-of-the-way place that nobody will ever find it. “I eventually had
to go down to the Cellar”. “Yes, Mr Dent, that’s the display
department”.

$ pkg-config --cflags libxml-2.0
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
$ PKG_CONFIG_PATH=/opt/boxen/homebrew/opt/libxml2/lib/pkgconfig/ pkg-config --cflags libxml-2.0
-I/opt/boxen/homebrew/Cellar/libxml2/2.9.1/include/libxml2

Your Pathnames May Vary. You get the idea. When is Macos Shaved Yak
planned for release?

But after all that, it Just Works. Mostly. Sometimes it complains
that files go missing, but I think that’s because I’m still checking
mail occasionally (so causing them to be marked as read) in Outlook
and this makes them jump from new/ to cur/. And I haven’t yet
figured out how to deal with calendaring or contacts, but the former
is a minor annoyance and the latter is probably just a matter of
finding a way to make Gnus talk LDAP to the LDAP proxy in DavMail