This page was exported from Furor Teutonicus [ https://www.furorteutonicus.eu ]
Export date: Tue Jan 19 9:29:17 2021 / +0000 GMT

IMAP folder separator for Dovecot and Mutt


This is a short technical howto post. I couldn't easily find this information on the webs, especially the neomutt error messages related to this subject, so I store this on my blog for my future self and for others.

Folder Separator

Dovecot uses the dot (.) as separator by default for Maildir and IMAP folders; Courier also uses the dot. Instead of a dot, one can also use a forward slash (/) or something else. The forward slash is very common and you might prefer it.

Open for editing: /etc/dovecot/conf.d/10-mail.conf

Under namespace inbox {, set:
separator = /
prefix =
inbox = yes
subscriptions = yes

Don't forget a systemctl restart dovecot and you're good to go.

(Neo)Mutt

I sometimes use Mutt to read my mail from the CLI. For folder subscriptions, I use:
mailboxes =Sent
mailboxes =Drafts
mailboxes =Archives/`date +%Y`

Also I use a save-hook, which is an extra feature of neomutt compared to mutt:
save-hook . +Archives/`date +%Y`

Note the forward slashes to indicate a yearly subfolder. If Dovecot is using its default setting, then you have to change replace those slashes to dots; or you can change your Dovecot configuration. If you don't do this, then you will get error messages such as:
imap_copy_messages [a0021 NO [CANNOT] Invalid mailbox name: Name must not have ‘/' characters

[CANNOT] Invalid mailbox name: Name must not have ‘/' characters

neomutt screenshot
neomutt
Excerpt: A short tech post on folder separators for an IMAP server and a client (Dovecot and Mutt).
Post date: 2020-12-24 11:52:04
Post date GMT: 2020-12-24 10:52:04
Post modified date: 2020-12-24 12:20:26
Post modified date GMT: 2020-12-24 11:20:26
Powered by [ Universal Post Manager ] plugin. HTML saving format developed by gVectors Team www.gVectors.com