Furor Teutonicus blog | over | volg | teuto | lyme | archief | doneer | todo
🕰️
  ⬩  
✍️ Evert Mouw
  ⬩  
⏱️ 1 min

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

Deze blogpost werd in december 2022 overgezet van WordPress naar een methode gebaseerd op Markdown; het is mogelijk dat hierbij fouten of wijzigingen zijn ontstaan t.o.v. de originele blogpost.