reconstructing mailboxes from backup
ellie timoney
ellie at fastmail.com
Tue Jun 23 20:41:26 EDT 2020
Hi Tim,
It's worth observing that, in Cyrus, the user "george"'s IMAP inbox is the "user/george" folder. Which means, on disk, this user has another folder called "INBOX" within their inbox. Depending on the Cyrus version, and maybe depending on your server's value of "altnamespace", this is invalid -- and it looks like your reconstruct has skipped it and everything under it, unsurprisingly.
It's also worth observing that there is both a "Deleted Messages" folder as a subdirectory of the bad "INBOX", and an "INBOX^Deleted Messages" directory that looks like maybe the result of unixhierarchysep being changed out from under the client, or something like that. Looks like reconstruct has pulled the latter one in, cause it's not technically bad (but it will be very weird/confusing for the user to have a folder called "INBOX.Deleted Messages" in their client that is neither their inbox, nor their Deleted Messages folder, nor a directory hierarchy of the two).
So, it looks like reconstruct has found all the valid folders, and skipped the invalid INBOX and everything in it. That seems coherent.
If you can start again from scratch: then I'd suggest renaming, on disk, that "INBOX" folder to something like "old inbox", and optionally renaming the "INBOX^Deleted Messages" folder to something like "old deleted messages", before you run the reconstruct. Then the reconstruct will be able to find everything, and the user can then move the messages from the "old..." folders back into wherever they want them to be just over IMAP.
If you can't start again from scratch: then you should only rename the bad "INBOX" folder on disk, and then reconstruct. The previous reconstruct already found and repaired the "INBOX^Deleted Messages" folder, so renaming it on disk now might make a new mess. But it can be renamed over IMAP, either by an admin session or the user.
Hope this helps :)
ellie
On Tue, Jun 23, 2020, at 11:42 PM, Tim Coote wrote:
> Hullo
>
> I have a cyrus implementation on Fedora for a small (~10) users that’s
> been migrated through many versions of the various components,
> including several different of IMAP clients.
>
> Realising the fragility of the setup, I thought I’d restore from a
> backup. However, I’m finding that several of the mailboxes are not
> being recovered. I feel that I am missing somethign obvious, but I
> cannot spot it.
>
> The restoring version of cyrus-imap is: cyrus-imapd-3.0.13-2.fc32.x86_64,
>
> The restored filesystem layout can be summarised thus:
>
> `sudo find /var/spool/imap/g | grep cyrus.header`:
>
> /var/spool/imap/g/user/george/Notes/cyrus.header
> /var/spool/imap/g/user/george/cyrus.header
> /var/spool/imap/g/user/george/Sent Messages/cyrus.header
> /var/spool/imap/g/user/george/Deleted Messages/cyrus.header
> /var/spool/imap/g/user/george/Sent/cyrus.header
> /var/spool/imap/g/user/george/Trash/cyrus.header
> /var/spool/imap/g/user/george/INBOX/Sent Messages/cyrus.header
> /var/spool/imap/g/user/george/INBOX/Deleted Messages/cyrus.header
> /var/spool/imap/g/user/george/INBOX/Drafts/cyrus.header
> /var/spool/imap/g/user/george/INBOX^Deleted Messages/cyrus.header
> /var/spool/imap/g/user/george/Drafts/cyrus.header
>
> [so I would expect all of the subdirectories to be reconstructed as mailboxes]
>
> however, using:
> `sudo -u cyrus reconstruct -r -f user/george`
>
> I only get:
> user/george
> user/george/Deleted Messages
> user/george/Drafts
> user/george/INBOX.Deleted Messages
> user/george/Notes
> user/george/Sent
> user/george/Sent Messages
> user/george/Trash
>
> ie no subdirectories below the top level, but excluding those
> directories below INBOX.
> Should there be a file:
> `/var/spool/imap/g/user/george/INBOX/cyrus.header`?
>
> Is there anything that I should be doing/how can I recover the other mailboxes?
>
> ----
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus
More information about the Info-cyrus
mailing list