An IMAP Configuration for Mutt

Usually, I download all my email via fetchmail, sort it into folders using procmail and read the mails with mutt. This works reasonably well and I've been using this mail setup without major changes for about 10 years. Since I recently bought a netbook, I also wanted to read mails with it, but without touching my existing mail setup. The netbook should only read mails directly on the server without downloading anything to local disk.

My mail service provider 1&1 supports IMAP and a webmail client that I sometimes use, so I decided to follow the webmail client's conventions regarding folder names. This way, I can use mutt on the netbook and the webmail client interchangeably.

Based on a mutt configuration for gmail, I ended up with the following IMAP-related settings:

set from = "your.address@example.invalid"
set realname = "Your Real Name"

set imap_user = "my.username@domain.invalid"
set imap_pass = "*******"

set smtp_url = "smtp://$imap_user@smtp.1und1.de:587/"
set smtp_pass = $imap_pass

set folder = "{imap.1und1.de/ssl}"
set spoolfile = "+INBOX"
set record = "+Gesendete Objekte"
set postponed = "+Entwürfe"
set trash = "+Papierkorb"

set move = no

mailboxes "+INBOX"

set header_cache = "~/.cache/mutt/headers"

The most important account settings are imap_user, imap_pass (optional, mutt will prompt for it), and folder. Folder names prefixed with a + sign are relative to folder. Note that I disabled moving read mails to the mbox folder; I want to keep everything in my inbox. Because of the record setting, all sent mails are recorded in a folder on the IMAP server.

To speed things up, I enabled the header cache. You could also cache entire messages, but since mutt doesn't expire them yet, I don't use this feature.

What doesn't work: Neither fetchmail nor the 1&1 server propagate the IMAP "seen" flag of the emails to a BSD mbox-style "Status: RO" header. Because of this, I have to mark all downloaded mails as read manually.

social