On Tue, 15 Nov 2011 22:43:24 +0200, Timo Sirainen <t...@iki.fi> wrote: > 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?
Well, I dont know if I can do it reliably, but its been happening a lot. One point of information that might be useful is that these users were converted from courier maildir to mdbox, and their courier bits are still around in the source mailbox (I haven't become brave enough to remove them yet). > > > 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? :) Before I tried it again, I looked at their mailboxes: # doveadm mailbox list -u <username Trash_084ed82bc59ca54eb53700007ef44c7a Sent Drafts INBOX_094ed82bc59ca54eb53700007ef44c7a INBOX Then I tried it again, and I got an error: dsync(<username>): Info: INBOX: only in dest (guid=14bf0409fa08c04e682900007ef44c7a) dsync(<username>): Error: Trying to open a non-listed mailbox with guid=14bf0409fa08c04e682900007ef44c7a dsync(<username>): Error: msg iteration failed: Couldn't open mailbox 14bf0409fa08c04e682900007ef44c7a dsync(<username>): Error: Trying to open a non-listed mailbox with guid=14bf0409fa08c04e682900007ef44c7a and the mailboxes: # doveadm mailbox list -u <username> Trash_084ed82bc59ca54eb53700007ef44c7a Sent Drafts INBOX_094ed82bc59ca54eb53700007ef44c7a I tried it a third time, and... it worked, no error, and now their mailbox list: # doveadm mailbox list -u <username> Trash Sent Drafts INBOX This particular user only has one test email > > > 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). The problem is there are a number of users on the system and all the mail is stored under /srv/mailstorage/<letter>/<username>. So if "foo" wants to change their username to "bar" -- I dont have a deterministic way of determining that "bar" exists yet because mail could be delivered or they could login and dovecot would create it and I can't set /srv/mailstorage/<letter> 0700 root or nobody would be able to receive mail. micah
pgpRFlbnVOgtn.pgp
Description: PGP signature