[Dovecot] Duplicated (but only for unread) messages after second rsync pass...

Timo Sirainen tss at iki.fi
Sun Dec 22 17:37:01 EET 2013


On 22.12.2013, at 17.13, Charles Marcus <CMarcus at Media-Brokers.com> wrote:

> Ok, I know I should probably be using dsync for this, but I'm more familiar with rsync, and didn't think this would be a problem.
> 
> Here is what I am doing, and what is apparently happening (only done this once, but I'm guessing it will happen each time):
> 
> rsync -avHP /mnt/vmail/example.com/user1/ /var/vmail/example.com/user1/
> 
> chown -R vmail:vmail /var/vmail/example.com
> 
> Ok, so far so good, everything works fine accessing the mails (I'm using Thunderbird).
> 
> Now I do another rsync, but this time I did  the entire mailstore:
> 
> rsync -avHP /mnt/vmail/example.com/ /var/vmail/example.com/
> 
> chown -R vmail:vmail /var/vmail/example.com
> 
> Right after I started up dovecot again, I hot a bunch of these in the logs:
> 
> 2013-12-22T09:52:51-05:00 newhost dovecot: imap(user1 at example.com): Warning: Maildir /var/vmail/example.com/user1/: Expunged message reappeared, giving a new UID (old uid=45516, file=1387468268.Vfe02Ic1343fM845754.oldhost.sub.example.com:2,ST)
> 2013-12-22T09:52:51-05:00 newhost dovecot: imap(user1 at example.com): Warning: Maildir /var/vmail/example.com/user1/: Expunged message reappeared, giving a new UID (old uid=45518, file=1387468645.Vfe02Ic73e0eM530539.oldhost.sub.example.com:2,ST)
> 
> The problem is, it looks like every single message that was flagged as unread is now duplicated on the new system.
> 
> Also - not that this is a problem, but all of the old messages have the fqdn of the old server in the individual email file names - oldhost.sub.example.com - while the new ones only have the local hostname (newhost)

The hostname doesn't matter.

> Did I do something wrong? Or is this going to be an unavoidable problem if I want to use rsync to do the final migration that using dsync would avoid?

Use rsync --delete to get rid of the extra mails in destination. And of course don't deliver any new mails to destination before that is done. :)



More information about the dovecot mailing list