wingologA mostly dorky weblog by Andy Wingo2008-04-08T23:50:11Ztekutihttps://wingolog.org/feed/atomAndy Wingohttps://wingolog.org/hear, memoryhttps://wingolog.org/2008/04/08/hear-memory2008-04-08T23:50:11Z2008-04-08T23:50:11Z

A few months ago I wrote about my mail setup. In summary, on the server side, the MTA delivers to a Maildir, which is then exposed to me via IMAP, which I mirror locally to a Maildir via offlineimap, and expose locally via a local IMAP server. It's a complicated solution, but on the other hand it is fairly robust, and provides me with distributed backups.

Since writing some minor things changed, and some remained undocumented, so now I write, as Quim says, "for your eyes and my memory".

reading mail

I switched from Courier IMAP to Dovecot, basically because Fedora doesn't have courier packages. (I built some, but found about about dovecot before getting to actually configure them.) I've found Dovecot to be much easier to configure. A simple yum install, and edits to the well-commented /etc/dovecot.conf, and I had imap working. Here are the three variables that I set:

protocols = imap
listen = 127.0.0.1
mail_location = maildir:~/.mail

The rest, I left as it came. I suppose I could have figured out some way to run the daemon as my own user, but that doesn't matter much. Dovecot's namespacing is different from Courier's, though -- it doesn't put all folders as subfolders of "INBOX" -- so I did have to tweak my mail filters.

Speaking of which, I now use Gnus for mail. Gnus is a mail reader that runs on Emacs, started using M-x gnus. The thing is, Emacs has really grown on me, like an infectious disease or something. (Fingernail clippings in a bowl of oatmeal, according to one L. Wall.) Gnus is really hard to configure, though, and I don't yet use it to its maximum efficacy. Perhaps some bits from my .gnus.el will make it to these (web) pages at some point.

sending mail

So that's how I read mail. I send mail using esmtp, a simple MTA that can relay to a remote host via secure SMTP, manage a queue, and run as a normal user. It doesn't do local delivery, which makes it quite simple.

Reportedly, esmtp works with gmail as well. I did edit the esmtp-wrapper script to not run the queue when invoked as sendmail, so that it would always return 0 instead of failing if network wasn't present (and thus confusing gnus). Messages are queued, of course.

"Hear, memory"

Andy Wingohttps://wingolog.org/dealing with mailhttps://wingolog.org/2007/08/03/dealing-with-mail2007-08-03T16:23:11Z2007-08-03T16:23:11Z

For most of this year there has been a part of my mind nagging me to deal with my email inbox, which now staggers above the thousand-message mark, after filtering. As it is easier to blame tools than to blame myself, I decided to switch away from my old system and start trying a new one. Here's a writeup of what I'm doing now, including a nifty patch.

the basics

I do not believe that there is a sane email solution that does not involve IMAP, Maildir, and offlineimap. IMAP, so that you can read the same mail from multiple machines; Maildir, so that there is no chance of corrupting your mail; and offlineimap, so that you can (1) access your IMAP mail without being connected to the network and (2) distribute backups of your mail across multiple machines.

I am willing to concede that GMail might work for you, although they do not yet have an offline solution. Apart from Google, on a technical level I would not trust any other organization to keep backups for me. So, if you are not willing to use GMail (as I am not), backing up mail via multiple maildirs on multiple machines with IMAP+offlineimap is the only solution. If my server dies, the copy of the mail I have on my machine is just as valid as the one that was on the server.

The same cannot be said for any other offline mail solution that I know of.

the user agent

I have been using Evolution to read mail. I'm in the process of a switch, but will write about that later. However I found that Evo didn't deal well with offlineimap changing the maildirs that it was trying to read. This was a while back; perhaps things have changed since then.

It turns out that most user agents (mail readers) don't deal well with multiple folders of maildir mail. Either they get the folder nesting wrong, take forever to read them, have problems keeping their indices in sync with the data, or simply don't support maildirs at all.

However, most of them do support IMAP well. The solution? Run a local IMAP server! Inspired by a response to this most excellent mail rant, I'm running a local Courier IMAP server, which I then use to access my mail. It's fast and robust.

Now it's easy to read and filter mail offline. You have to set up offlineimap to name its local maildirs like Courier expects, but there is an example of that in the default offlineimap configuration file.

The problem comes in if you want to create new folders locally. Courier will happily and correctly create the new maildirs, but offlineimap will not sync them to the server. This has bothered me since a few years ago, but today I sat down and decided to fix it. Two hours later, I have a patch that Works For Me But Might Eat Your Mail. Back up before trying it!

I'm still getting used to my new MUA, but when all that is done, there will be more blog ranting. Until then, enjoy the summer sun!