[Dovecot] dsync problems

Timo Sirainen tss at iki.fi
Tue Nov 15 22:43:24 EET 2011


On Tue, 2011-11-15 at 14:24 -0500, Micah Anderson wrote:
> When a user renames their username, I am using dsync to copy their mail
> over to the new username's mail location[0]. 
> 
> Some of the dsyncs are failing with errors that I dont know how to work
> with, for example:
> 
> dsync(<username>): Error: Trying to open a non-listed mailbox with guid=41fcd40303c8a64e432300007ef44c7a
> dsync(<username>): Error: msg iteration failed: Couldn't open mailbox 41fcd40303c8a64e432300007ef44c7a
> dsync(<username>): Error: Trying to open a non-listed mailbox with guid=41fcd40303c8a64e432300007ef44c7a

These shouldn't really happen. Something's going internally wrong with
dsync. Can you reproduce this reliably somehow?

> The errors cause a non-zero exit code from dsync, which causes my rename
> script to bail out. What are these errors, and how can I fix them?

Does a second dsync on error succeed? :)

> 0. Why use dsync instead of a simple mv operation? This seems to be
> necessary for two corner cases:
> 
> 1. dovecot creates the new mailbox automatically when the user logs in
> or receives a mail, so if the user changes their mail and logs in or
> receives an email before the move has been done, then the mailbox is
> created and then a move command will fail.
>     
> 2. If there has been new mail created under the new name, we can't just
> simply remove the stuff that is automatically created there and replace
> it with the old things because we could potentially be removing mail
> that has been delivered in the mean time.

You could temporarily change the permissions for the home directory so
that no new mailboxes/mails could be created during the move (e.g. 0700
root).



More information about the dovecot mailing list