0

I have looked at the following and didn't see a solution to my issue:

Migrating from any IMAP/POP3 server to Dovecot

Creating Dovecot Master users/passwords doesn't work

Move Maildir safely on running server

Sync between two Mail Servers

I have server A that was setup with Postfix/Dovecot and using ~/Maildir format in a system users account (i.e. not virtual users). I also have server B that has been configured in the same manner, and may or may not have mails existing in ~/Maildir.

If ~/Maildir doesn't exist for a user on server B, then it seems safe to assume I can just rsync the server A ~/Maildir to server B ~/Maildir and it will preserve folders, mails read, other meta data, etc.

If ~/Maildir exists on both servers each with existing mail, how can I safely merge the data from server A into the ~/Maildir on server B? In principle the data files themselves should be unique, and it should just come down to the Dovecot meta data files that would exist on both servers.

I was looking here, but that is a generic move, and I think since the server configuration is similar if not identical, then my scenario should be much easier:

https://wiki2.dovecot.org/Migration/Dsync

This last one makes it seem trivial and oversimplified given the content of other questions. It isn't clear to me if this is intended for virtual users or system users.

https://serverfault.com/a/866298/386414


I figured I didn't have much to lose, and discovered that for a single user, I could just run:

doveadm import maildir:~/old_mail/Maildir "" all

but that imported the mails as Unread, rather than whatever state they were in for the old Maildir. How would I fix that?

I think this does more what I want, since with import you can only run it once as it will indiscriminately bring email in more than once:

doveadm sync maildir:~/old_mail/Maildir

but it still has the same problems with all mail being unread.

  • Do you need "one time" sync or periodic sync? – AnFi Jun 28 at 6:36
  • This was for a move from one server to another. Say either restoring a backup, or hardware switch or whatever. – Brian Jun 28 at 16:20
0

This:

Dovecot Migration and old mails

Says this:

Maildir actually uses a unique format that makes this quite easy. Simply place the mail in new/ directory inside the mail users mailroot if you want it to show up as new. Otherwise it goes in the cur/ directory.

I'm not sure how this applies in your scenario (or even if it does) but it might be worth checking into.

  • Yeah, I looked at that one (forgot to include it), but it doesn't mention anything about preserving state of the mails. I was hoping for something a bit more sophisticated either in the commands I already found, or something new. To be honest it has been a while since I used IMAP and a mail client, so I'm not even that familiar with various features to be preserved. – Brian Jun 23 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.