[Dovecot] Problems Converting Maildir to mdbox
Hello,
I would like to convert all users mail from maildir to mdbox. My Dovecot version is 2.0.1, converted from 1.2.13 but config was rewritten from scratch.
http://wiki2.dovecot.org/Migration/MailFormat says following: maildir -> mdbox migration. Set mail_location=mdbox:~/mdbox and run doveadm convert -u username maildir:~/Maildir
but doveadm does not know a command like "convert". Is there a _working_ way to convert maildir to mdbox ? How to do that with all Dovecot mail users (about 10000) ?
Christian
On 8/28/2010 5:35 AM, Christian Felsing wrote:
I would like to convert all users mail from maildir to mdbox. My Dovecot version is 2.0.1, converted from 1.2.13 but config was rewritten from scratch.
http://wiki2.dovecot.org/Migration/MailFormat says following: maildir -> mdbox migration. Set mail_location=mdbox:~/mdbox and run doveadm convert -u username maildir:~/Maildir
but doveadm does not know a command like "convert". Is there a _working_ way to convert maildir to mdbox ? How to do that with all Dovecot mail users (about 10000) ?
Hmmm. not sure why that page is still around, but I'm fairly sure the proper way to convert is using dsync...
http://wiki2.dovecot.org/Tools/Dsync
Towards the bottom you find:
"Converting:
Assuming that the mail_location setting in /etc/dovecot/conf.d/10-mail.conf is set to: mail_location = mdbox:~/mdbox, a logged in system user may convert her/his mails from its Maildir in her/his home directory to the mdbox mailbox format. The user has to execute the command:
dsync mirror maildir:~/Maildir
If you want to do this without any downtime, you can do the conversion one user at a time. Initially:
- Configuration uses mail_location = maildir:~/Maildir
- Set up the possibility of doing per-user mail location using userdb extra fields.
Then for each user:
- Run dsync mirror once to do the initial conversion.
- Run dsync mirror again, because the initial conversion could have taken a while and new changes could have occurred during it. This second time only applies changes, so it should be fast.
- Update mail extra field in userdb to mdbox:~/mdbox. If you're using auth cache, you need to flush it.
- Wait for a few seconds and then kill the user's all existing imap and pop3 sessions (that are still using maildir).
- Run dsync mirror once more to apply final changes that were possibly done. After this there should be no changes to Maildir, because the user's mail location has been changed and all existing processes using it have been killed.
Once all users have been converted, you can set the default mail_location to mdbox and remove the per-user mail locations from userdb."
--
Best regards,
Charles
On 28-08-2010 16:30, Charles Marcus wrote:
dsync mirror maildir:~/Maildir
I am just trying to do that now (just testing so far).
Using this command ($1 is substituted for the user): dsync -u $1 -o "mail_location=maildir:/data/mail/$1/mdir" mirror "mdbox:/data/mail/$1/mdbox"
After having learned that I need to create the destination directory first, I got this error: dsync(root): Fatal: Mail locations must use the same virtual mailbox hierarchy separator (specify separator for the default namespace)
Which I am afraid does not help me much - tried to set separator to '.' in namespace but that only ended in lda/deliver refusing to deliver mail. :-(
Thanks in advance! Kim
On 8/28/2010 11:17 AM, Kim Bisgaard wrote:
After having learned that I need to create the destination directory first, I got this error: dsync(root): Fatal: Mail locations must use the same virtual mailbox hierarchy separator (specify separator for the default namespace)
doveconf -n output?
--
Best regards,
Charles
On 28-08-2010 17:21, Charles Marcus wrote:
On 8/28/2010 11:17 AM, Kim Bisgaard wrote:
After having learned that I need to create the destination directory first, I got this error: dsync(root): Fatal: Mail locations must use the same virtual mailbox hierarchy separator (specify separator for the default namespace) doveconf -n output?
# 2.0.1: /etc/dovecot/dovecot.conf # OS: Linux 2.6.33.6-147.2.4.fc13.i686 i686 Fedora release 13 (Goddard) ext3 mail_location = maildir:/data/mail/%u/mdir mbox_write_locks = fcntl passdb { driver = pam } plugin { sieve = ~/.dovecot.sieve sieve_dir = ~/sieve sieve_extensions = +imapflags sieve_subaddress_sep = + } postmaster_address = postmaster@alleroedderne.adsl.dk protocols = imap ssl_cert =
On 8/28/2010 11:17 AM, Kim Bisgaard wrote:
After having learned that I need to create the destination directory first, I got this error: dsync(root): Fatal: Mail locations must use the same virtual mailbox hierarchy separator (specify separator for the default namespace)
Which I am afraid does not help me much - tried to set separator to '.' in namespace but that only ended in lda/deliver refusing to deliver mail. :-(
All I know now is, since you're using the default namespace (according to your -n output), the separator must be the same as the mailbox list layout separator...
I'm traveling and without access to any system for testing anything, so can't help further... sorry...
--
Best regards,
Charles
On Sat, 2010-08-28 at 17:17 +0200, Kim Bisgaard wrote:
Using this command ($1 is substituted for the user): dsync -u $1 -o "mail_location=maildir:/data/mail/$1/mdir" mirror "mdbox:/data/mail/$1/mdbox"
I guess this should work.
After having learned that I need to create the destination directory first, I got this error: dsync(root): Fatal: Mail locations must use the same virtual mailbox hierarchy separator (specify separator for the default namespace)
Which I am afraid does not help me much - tried to set separator to '.' in namespace but that only ended in lda/deliver refusing to deliver mail. :-(
What error did lda give? You probably should add:
namespace { separator = / inbox = yes }
On 31-08-2010 20:38, Timo Sirainen wrote:
On Sat, 2010-08-28 at 17:17 +0200, Kim Bisgaard wrote:
Using this command ($1 is substituted for the user): dsync -u $1 -o "mail_location=maildir:/data/mail/$1/mdir" mirror "mdbox:/data/mail/$1/mdbox" I guess this should work.
After having learned that I need to create the destination directory first, I got this error: dsync(root): Fatal: Mail locations must use the same virtual mailbox hierarchy separator (specify separator for the default namespace)
Which I am afraid does not help me much - tried to set separator to '.' in namespace but that only ended in lda/deliver refusing to deliver mail. :-( What error did lda give? You probably should add: Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-mail.conf line 54: Unknown setting: separator )
(maildir uses '.' (I think)) so I only added: namespace { separator = . }
namespace { separator = / inbox = yes } Intuitively I would have expected '.' and not '/' (default (m)dbox), since I'm converting between maildir (.) and dbox(/) - right?
On Tue, 2010-08-31 at 20:49 +0200, Kim Bisgaard wrote:
What error did lda give? You probably should add: Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-mail.conf line 54: Unknown setting: separator )
That looks like it wasn't inside namespace {} or something else was weird. Anyway, you should have gotten that same error simply by running "doveconf" (or "dovecot", or any Dovecot tool really).
(maildir uses '.' (I think)) so I only added: namespace { separator = . }
You need inbox=yes there too (or maybe it's added there by default if you have only one namespace, can't remember).
namespace { separator = / inbox = yes } Intuitively I would have expected '.' and not '/' (default (m)dbox), since I'm converting between maildir (.) and dbox(/) - right?
For dsync it doesn't matter if it's '.' or '/', both will work fine. But if you have existing IMAP clients then you should preserve the separator or they could become confused.
On 31-08-2010 21:07, Timo Sirainen wrote:
On Tue, 2010-08-31 at 20:49 +0200, Kim Bisgaard wrote:
What error did lda give? You probably should add: Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-mail.conf line 54: Unknown setting: separator ) That looks like it wasn't inside namespace {} or something else was weird. Anyway, you should have gotten that same error simply by running "doveconf" (or "dovecot", or any Dovecot tool really).
(maildir uses '.' (I think)) so I only added: namespace { separator = . } You need inbox=yes there too (or maybe it's added there by default if you have only one namespace, can't remember).
namespace { separator = / inbox = yes } Intuitively I would have expected '.' and not '/' (default (m)dbox), since I'm converting between maildir (.) and dbox(/) - right? For dsync it doesn't matter if it's '.' or '/', both will work fine. But if you have existing IMAP clients then you should preserve the separator or they could become confused.
Just tried to do it again - I think first time was an error of mine - did not remove enough comments '#' from the config file - sorry! :-[ .
This seems to work: namespace { inbox = yes location = prefix = separator = . }
Thanks!! Kim
On a side note: Postfix bounces the messages deliver cannot deliver - why does it not keep them in queues until deliver works again?
Aug 31 21:10:36 jukebox postfix/local[5087]: 910846B9D9: to=kim+dovecot@alleroedderne.adsl.dk, relay=local, delay=0.07, delays=0.02/0/0/0.05, dsn=5.3.0, status=bounced (Command died with status 89: "/usr/libexec/dovecot/deliver". Command output: doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-mail.conf line 54: Unknown setting: separator ) Aug 31 21:10:36 jukebox postfix/cleanup[5086]: A239E6B9D6: message-id=20100831191036.A239E6B9D6@jukebox.alleroedderne.adsl.dk Aug 31 21:10:36 jukebox postfix/qmgr[2218]: A239E6B9D6: from=<>, size=5386, nrcpt=1 (queue active) Aug 31 21:10:36 jukebox postfix/bounce[5135]: 910846B9D9: sender non-delivery notification: A239E6B9D6 Aug 31 21:10:36 jukebox postfix/qmgr[2218]: 910846B9D9: removed
Best regards, Kim
participants (4)
-
Charles Marcus
-
Christian Felsing
-
Kim Bisgaard
-
Timo Sirainen