[Dovecot] need convert-tool advice
Hi folks, I've got a few thousand accounts that I'd like to convert from mbox to maildir. I'm looking at using convert-tool from the command line to do this, but I'm uncertain about the command line syntax, so I hope someone can take a moment to go over this with me.
I'm running dovecot 1.1.6 on this system. Mail accounts are not tied to UNIX system accounts, I'm using the dovecot LDA, users do not have home directories, everything is controlled from a database, and mail directories take the form of:
/var/spool/mail/<domainname>/<username>/...
The mail directories contain mbox-style spool files, including "inbox" and any user-created mbox-format folders. The entire hierarchy is owned by vmail.vmail.
I'd like to batch-convert these offline in such a way that it's transparent to users. Here's what I have so far:
mv ${user} ${user}-mbox
convert_tool ${user}
/var/spool/mail/${domain}/${user}
mbox:/var/spool/mail/${domain}/${user}-mbox:
INBOX=/var/spool/mail/${domain}/${user}-mbox/inbox
maildir:/var/spool/mail/${domain}/${user}
(sorry about that incomprehensibly long command line, I tried to break it intelligently)
...then I'll change the "mail" field returned by the database query to include maildir instead of mbox. I'll wrap the whole thing in a script and do it in one run.
Is this correct usage of convert_tool's command line options? The thing that confuses me is the "home directory" command line option, not sure what that's for, as my mail users don't have home directories...at least not in the UNIX sense, does it mean something else? Will the users notice anything different here, with respect to UIDs, indices, or anything like that?
If this is completely the wrong way to do it, I'm not opposed to using a different tool like mb2md.pl, but I looked at that and couldn't quite figure out how to make it work within my current directory structure.
Thanks,
-Dave
-- Dave McGuire Port Charlotte, FL
On 31.7.2010, at 2.14, Dave McGuire wrote:
I've got a few thousand accounts that I'd like to convert from mbox to maildir. I'm looking at using convert-tool from the command line to do this, but I'm uncertain about the command line syntax, so I hope someone can take a moment to go over this with me.
I'd suggest instead using mb2md.pl from http://wiki.dovecot.org/Migration/MailFormat. It can preserve more metadata. v2.0 also has a much better dsync utility for conversion.
mv ${user} ${user}-mbox
convert_tool ${user}
/var/spool/mail/${domain}/${user}
mbox:/var/spool/mail/${domain}/${user}-mbox:
INBOX=/var/spool/mail/${domain}/${user}-mbox/inbox
maildir:/var/spool/mail/${domain}/${user}Is this correct usage of convert_tool's command line options?
Probably.. Although the INBOX= is unnecessary, since that's the default anyway.
The thing that confuses me is the "home directory" command line option, not sure what that's for, as my mail users don't have home directories...
http://wiki.dovecot.org/VirtualUsers/Home - I don't remember why convert-tool wants the home. Probably unnecessary.
at least not in the UNIX sense, does it mean something else? Will the users notice anything different here, with respect to UIDs, indices, or anything like that?
Yes, UIDs change. That's why you should use mb2md.pl instead to preserve them.
If this is completely the wrong way to do it, I'm not opposed to using a different tool like mb2md.pl, but I looked at that and couldn't quite figure out how to make it work within my current directory structure.
Well, I don't know about that. :) Never used it myself..
participants (2)
-
Dave McGuire
-
Timo Sirainen