I am currently running dovecot 2.x on a server with the following layout for mailboxes:

mail_location = maildir:~/Maildir

I would like to change the layout to this format:

mail_location = maildir:~/Maildir:LAYOUT=fs:INBOX=~/Maildir/INBOX

Is there a way to convert the mailbox layout for all mail accounts currently on the server? I was looking at dsync, but all examples in Dovecot's wiki are for converting between mbox and Maildir.

I was also looking at potentially writing a script to manually rename directories/move files around to match the new format, but wasn't sure whether that would mess with UIDs or other dovecot internals.

1 Answer 1


Because you do not need to change anything inside each Maildir directory (i.e. inside the folder that contains the cur, new, tmp directories and the dovecot indices), moving the directories around with a script will be perfectly safe, and quite sufficient.

The only exception to this is for INBOX itself, because you have it directly in ~/Maildir now and you would like to move it to a subdirectory. But even then, I think that a script that is careful about what files it moves and which ones it doesn't is the best way to go. If you move every plain file from ~/Maildir to ~/Maildir/INBOX (covers all Dovecot index files) plus cur, new, tmp (covers the contents themselves) and leave all other subdirectories alone (covers other folders) then I think that should do the trick.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .