Protocols

Folder separators: Dovecot / versus Courier .

The symptom is easy to recognise: a tidy folder tree on the old server, a flat list with dots or slashes in the names on the new one. One character is to blame — the one the protocol never standardised.

Where the problem comes from

In IMAP, nesting is carried by a string rather than a structure: Clients/2025 is the folder 2025 inside the folder Clients. Which character separates them is the server decision, and the protocol allows that.

Dovecot and most modern servers use a slash. Courier has always used a dot. Older Cyrus builds use a dot as well, and Exchange gateways sometimes present a backslash.

A client is supposed to ask the server for the separator with LIST and use that one. Skip it — as simple scripts and some in-house tools do — and the folder name travels to the other server unchanged, where it now means something else.

The server announces its own separator
Dovecot:  * LIST (\HasChildren) "/" "Clients"
Courier:  * LIST (\HasChildren) "." "INBOX.Clients"

What the breakage looks like

Three typical pictures that give the diagnosis away immediately.

What automatic mapping does

A proper tool asks both sides for their separator and rewrites names as it copies: slash to dot, dot to slash, adding or stripping the INBOX prefix where it belongs.

That is what folder auto-mapping means. In the overwhelming majority of migrations it does exactly the right thing with no intervention.

A manual rule is worth it in exactly one case: when a folder name contains the character that serves as the separator on the receiving side. Then you replace it explicitly — the dot in Acme Ltd. Contracts with a hyphen, say — because otherwise any automatic rule will create nesting that was never there.

What to check before the migration

A minute spent on the folder list saves an evening of cleanup after.

  1. Look at the folder list on both sides before starting: the separator is immediately visible.
  2. Find folders whose names contain a dot or a slash and decide what to do with them.
  3. Leave auto-mapping on unless you have a reason not to.
  4. After the migration compare tree depth as well as message counts: matching counts with a collapsed structure is not success.

FAQ

Common questions

Why did every folder land inside the Inbox?

That is how Courier works: user folders live under INBOX. Moving to Dovecot has to strip the prefix, which auto-mapping does.

Can a wrong separator lose messages?

No, the messages arrive. What breaks is the structure: they land in the wrong folders and the names look odd.

Can folders be renamed during the migration?

Yes, with a replacement rule. That is also how you work around a dot or slash inside a folder name.

How do I find out my server separator?

It is the quoted second field in the LIST response. The migration tool shows it in the folder list.

Where to next

Move your mail with MoveMailbox

More posts

Find out how big your mailbox is. It costs nothing.

Connect two servers, look at the size and decide. Or take the client and keep everything on your side.

Code on GitHub · built on imapsync · no sign-up