Posting here in case anyone stumbles across this thread while researching the same error message, I finally solved it.
At some point to be able to view the results of my backups I had configured my test dovecot server (maildev.domain.com) to access the same maildir location used by the backups. I never disabled that. A cron job runs on maildev that creates an email in my inbox on maildev assigning the next UID in sequence. The result is an email on the backup with the same UID as the source but a different GUID.
I read elsewhere that dsync deletes the destination mailbox and rebuilds it when it encounters this type of conflict, but inbox being a "special" folder cannot be deleted and rebuilt.
The messages reported in my logs explain exactly what was happening. In simple terms:
Message: dsync(doug): Warning: Deleting mailbox 'INBOX': UID=133060 already exists locally for a different mail: GUIDs don't match (1657786027.M158587P19048.maildev.domain.com vs 581a08178e8ecf62f04700002bad4ea1) Explanation: dsysnc found a mismatch in the source and destination that it could not resolve and will delete the mailbox
Message: dsync(doug): Error: Couldn't delete mailbox INBOX: INBOX can't be deleted. Explanation: I tried to delete Inbox and rebuild it, but can't.
-- Doug
On 7/14/2022 9:24 AM, Doug wrote:
Hi,
Running dovecot version 2.3.18 with mdbox storage. I run daily backups using dsync on the same server into maildir format. Several times per week I will get an error like the one below that prevents backups from completing. The error is always on my user, never any of my other couple dozen users. dsync(doug): Warning: Deleting mailbox 'INBOX': UID=133060 already exists locally for a different mail: GUIDs don't match (1657786027.M158587P19048.maildev.domain.com vs 581a08178e8ecf62f04700002bad4ea1) dsync(doug): Error: Couldn't delete mailbox INBOX: INBOX can't be deleted. Subsequent backups typically have a slightly different error. dsync(doug): Warning: Deleting mailbox 'INBOX': UID=132994 GUID=407c871b0ec1c562b51000002bad4ea1 is missing locally dsync(doug): Error: Couldn't delete mailbox INBOX: INBOX can't be deleted. Notice the UID and GUID are different from the first error. At this point I will identify 407c871b0ec1c562b51000002bad4ea1 in the source mailbox, and move it to another folder. More often than not that clears things up.
The backup command I am using is dsync -u doug all backup maildir:/home/doug/.mailbkup/mailboxes
My questions are:
Is the "locally" referring to the source or the target of the backup?
What might be causing this problem?
What the heck is this guid: 1657786027.M158587P19048.maildev.domain.com"
Note: The server is actually named mail.domain.com, not maildev.domain.com All file names in the backup maildir have mail.domain.com in them No files exist in the target maildir directory that begin with 1657786027* My original migration from mbox format to mdbox was tested and run on a server named maildev.domain.com. Is that why I am seeing a reference to maildev here? Is that name cached somewhere? Can it be corrected? Does it matter?
Are there any options I should add to the dsync command to fix this problem?
-- Doug