Help with migration to Dovecot from raw files

Stefano Antonelli dovecot at intheworks.ca
Thu Mar 26 12:11:58 EET 2020


Hello list,

I recently migrated to Dovecot from a very old version of IceWarp 
running on failing hardware running Windows XP.  I had a lot of issues 
downloading mail through imap.  What I have instead are the email files 
directly off the harddrive from IceWarp's mail store.

I rearranged the mail files to look like a Dovecot maildir and tried to 
use these emails directly.  Dovecot did not complain, but I ran into my 
first problem.  The emails were out of order on the client side.  None 
of my imap clients store email.  They all just fetch headers and 
download mail as it's required.  So a resync is not a problem.  I just 
can't figure out how and I don't know if the filenames are a problem.

The files I'm working with have this format:

2020032512105639B0-000001000000D2D45079615C.imap

The first part is the date and all the the filenames appear to be 
unique.  Is it okay to leave them this way or should I rename them in 
the same fashion as Dovecot?  If so, is there a tool I can use or do I 
need to write a script?  If I have to write a script, could someone help 
me decipher this filename:

1585197800.M440284P10160.hostname,S=2812,W=2875:2,S

I understand the first bit is a unix timestamp.  I couldn't find out 
what M440284P10160 means or how I might create that number myself to use 
in a renaming script.  Additionally, I'd like to customise the hostname 
without changing the machine's hostname and I understand that the S and 
W can also be omitted.  I'm not using quotas.  I couldn't find anywhere 
in the documentation where it talked about any configuration options for 
the filenames.  Are there any or do I have to patch the source?

I was also planning on directly backing up the email using rsync, but 
the changing filenames with flags is obviously an issue.  I understand 
that dovecot can store flags in a file instead, if the mailbox is shared 
or public.  Is there any way to have this behaviour with a private 
mailbox?  Ideally the filenames are not touched after creation in which 
case rsync will work nicely to my NAS.

The last issue is that since Dovecot went live, I've started receiving 
mail.  For the time being, I have left my "yet to be migrated" mail 
outside of maildir.  So Dovecot doesn't know about it.  I will need to 
merge this newly received mail with my "yet to migrated mail" once I 
sort out exactly how to migrate that mail.  And I would really like all 
the mail to sort properly.

 From what I can tell doveadm is the tool for the job, but I just can't 
make sense of the documentation.

Thanks,
Stef

Dovecot version:  2.3.4.1 (f79e8e7e4)


More information about the dovecot mailing list