[Dovecot] Best way to change index location on mdbox

Timo Sirainen tss at iki.fi
Sat May 19 21:28:14 EEST 2012


On Fri, 2012-05-18 at 23:44 +0200, Patrick Westenberg wrote:
> right now my index directory is part of the users home directory:
> mail_home = /var/mail/%d/%n
> mail_location = mdbox:~/mdbox
> 
> I want the indexes to be stored in a different location:
> mail_home = /var/mail/%d/%n
> mail_location = mdbox:~/mdbox:INDEX=/var/indexes/%d/%n
> 
> If I just switch this setting and reload the configuration, no e-mails 
> are shown to the user.

You must not lose indexes with mdbox or you'll lose message flags and
mails may also end up going to wrong mailboxes.

> After restoring the whole maildir I deleted all dovecot.index.*-files 
> from that user and starting dovecot with the new index directory
> setting, I got the following error after connecting.
> I expected the index files to be regenerated but I got an error:
> 
> May 18 23:11:12 imap(test at example.com): Panic: file mail-storage.c: line 
> 787 (mailbox_check_mismatching_separators): assertion fail
> ed: (strncmp(vname, ns->prefix, ns->prefix_len-1) == 0)

This is a little bit strange bug that is also happening to another guy.
I haven't been able to reproduce it.

> How can I change the index directory without losing mails?

The easiest and the most reliable solution would be to just move the
index files to their new location while Dovecot is stopped.




More information about the dovecot mailing list