Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
Tried this and it worked without issue! Thanks! –  reedog117 Aug 4 at 17:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.