[Dovecot] MBOX to Maildir preserving the UIDL (outlook-tested, no redownloading)
Horn Wijaya
hwijaya at nodens.biz
Fri May 9 02:27:18 EEST 2008
Hi Dmitry,
Understood.
My outlook in regards to imap, even though it changed folder, it didn't ask
for redownload, because Dovecot UID is the same.
I have tried 444 messages on Drafts, Sent Items and INBOX, all change folder
to Maildir folder.
Anyway, point taken. Thanks for the input.
------------------------------------------
Warmest Regards From:
Horn Wijaya
Consultant
hwijaya at nodens.biz
http://www.nodens.biz/
Nodens Solutions Pte Ltd
"where there is freedom in your choice"
-----Original Message-----
From: dovecot-bounces+hwijaya=nodens.biz at dovecot.org
[mailto:dovecot-bounces+hwijaya=nodens.biz at dovecot.org] On Behalf Of Dmitry
Filonov
Sent: Thursday, May 08, 2008 11:42 PM
To: dovecot at dovecot.org
Subject: Re: [Dovecot] MBOX to Maildir preserving the UIDL (outlook-tested,
no redownloading)
Horn Wijaya wrote:
> TESTED AND RUNNING, MIGRATING from MBOX to MAILDIR, PRESERVE UID and
OUTLOOK
>
> 1. mb2md-3.20.pl -s /var/mail/hwijaya -d home/hwijaya/Maildir/
> that's converting 444 emails from mbox to 444 files in the Maildir/cur
> folder
> 2. cd /home/hwijaya/Maildir/cur
> 3. grep IMAPbase *
> and I get
> 1210219860.000000.mbox:2,S:X-IMAPbase: 1202794557 19944
> The last 2 strings are the KEY to the ORIGINAL UID
> 4. So in order to prepare the environment to fool it, some calculations
are
> needed:
> How do we get 19501 as the first counter? as expected in the first POP
> TEST above:
> 19944 - 444 emails + 1 = 19501
> 5. cd /home/hwijaya/Maildir
> 6. echo '3 V1202794557 N19501' > dovecot-uidlist
>
Hello,
First of all, I was looking into this problem of getting the right
converter for couple years. You can search list archives for that -
there are more problems with perfect migration, than you know of.
Second, your calculations assume two things, that are not always true -
1) original mailbox already has X-IMAPbase header (not every mail server
puts these headers)
2) first message UID is last message UID-<number of messages>, which is
not true, if you have deleted some messages in between.
Third, usually servers use different UIDL format, not time+number.
Last, if you are migrating from mbox to Maildir on IMAP server, then
you have more than one folder. Probably you have "/" as folder separator
on mbox-based system. And will have "." on Maildir. That means, Outlook
will need to refresh it's folder list anyway. And that involves
re-downloading all messages.
Yes, in your case you might be able to make a perfect migration tool,
but this won't be ideal for everybody.
P.S. After couple years of thinking, planning and looking for a ideal
solution I have modified mb2md-3.20.pl script a little and was able to
migrate about 200Gb of mail with no problem. Yes, most clients had to
re-download all their messages (I had to force POP3 clients to empty
their server mailboxes), but it wasn't that big of a deal, as I was
afraid of. And now, even with much slower hardware I see about 10 times
lower LA than with mbox.
FiL
More information about the dovecot
mailing list