Hi all, I have a user (coworker) that accidentally deleted a mailbox and all its sub-mailboxes. I use Maildir format storage. I have backups. Is it enough to put the mailbox folder back where it was? I'm talking about the folder that contains 'cur', 'new', 'tmp', 'dovecot-uidlist', etc. Or would this desynchronize or otherwise confuse dovecot? Or is it preferable to use some doveadm command? Or...? Thanks, Sean
I've done so with no issues as long as permissions and ownership are accurate. Ted Hatfield On Wed, 27 Apr 2022, Sean McBride wrote:> Hi all, > > I have a user (coworker) that accidentally deleted a mailbox and all its sub-mailboxes. > > I use Maildir format storage. I have backups. > > Is it enough to put the mailbox folder back where it was? I'm talking > about the folder that contains 'cur', 'new', 'tmp', 'dovecot-uidlist', > etc. Or would this desynchronize or otherwise confuse dovecot? Or is > it preferable to use some doveadm command? Or...? > > Thanks, > > Sean > >
On 4/27/22 16:18, Sean McBride wrote:> I have a user (coworker) that accidentally deleted a mailbox and all its sub-mailboxes. > > I use Maildir format storage. I have backups. > > Is it enough to put the mailbox folder back where it was? I'm talking about the folder that contains 'cur', 'new', 'tmp', 'dovecot-uidlist', etc. Or would this desynchronize or otherwise confuse dovecot? Or is it preferable to use some doveadm command? Or...?Disclaimer:? I am not affiliated with the project, and I am definitely not an expert.? I've been running dovecot for my personal mail server for a long time, thankfully with very few incidents.? I have done some manual surgery on my maildir mailbox and seen how it reacts.? Dovecot is very resilient. What you describe should be sufficient.? It's how I would proceed with a restore.? In most cases I would copy the backup on top of any existing structure, rather than doing a wholesale replace, because any new mail received should have different filenames than what is in the backup. If it were me, I would probably delete all the files that have a filename starting with "dovecot" in that user's mailbox, and restart dovecot, letting dovecot rebuild those files when the user connects.? I don't really have any experience with how things operate over POP3, I've always used IMAP with dovecot. I'm interested to know whether the real experts here have different advice than this, in case I ever find myself in that situation.? There might be some doveadm commands that accomplish the dovecot* file rebuilding in a cleaner way. Thanks, Shawn
Well, I finally had time to try this (with a test account) and it did not work for me. I restored the .mailboxname folder (and all its contents, and with permissions preserved) and even ran: sudo doveadm force-resync -u testuser mailboxname but I don't see the folder restored from my IMAP client (roundcube). Anyone have any suggestions? Thanks, Sean On 27 Apr 2022, at 18:53, Ted Hatfield wrote:> I've done so with no issues as long as permissions and ownership are accurate. > > Ted Hatfield > > On Wed, 27 Apr 2022, Sean McBride wrote: > >> Hi all, >> >> I have a user (coworker) that accidentally deleted a mailbox and all its sub-mailboxes. >> >> I use Maildir format storage. I have backups. >> >> Is it enough to put the mailbox folder back where it was? I'm talking about the folder that contains 'cur', 'new', 'tmp', 'dovecot-uidlist', etc. Or would this desynchronize or otherwise confuse dovecot? Or is it preferable to use some doveadm command? Or...? >> >> Thanks, >> >> Sean >> >>