cyrusimap / cyrus-imapd

Cyrus IMAP is an email, contacts and calendar server
http://cyrusimap.org
Other
549 stars 150 forks source link

3.2.6: deletemailbox does not delete mailbox and messages from filesystem #3874

Open stfast opened 2 years ago

stfast commented 2 years ago

Hi,

I am in process migrating mailboxes from cyrus-imapd 2.4.17 to 3.2.6. Mailboxes are successfuly transfered via xfer to new 3.2.6 server, but I get wierd behaviour deleting mailboxes.

localhost> lm user/10g@ftp.com user/10g@ftp.com (\HasNoChildren)

localhost> deletemailbox user/10g@ftp.com deletemailbox: Permission denied

localhost> listaclmailbox user/10g@ftp.com 10g@ftp.com lrswipkxtecdan

localhost> setaclmailbox user/10g@ftp.com cyrus lrswipkxtecda

localhost> deletemailbox user/10g@ftp.com

$ cat /var/log/maillog Jan 23 00:28:10 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g Jan 23 00:28:10 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g Jan 23 00:28:10 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.Deleted Messages Jan 23 00:28:10 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.Deleted Messages Jan 23 00:28:10 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1 Jan 23 00:28:10 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1 Jan 23 00:28:10 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2002 Jan 23 00:28:10 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2002 Jan 23 00:28:10 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2003 Jan 23 00:28:10 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2003 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2004 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2004 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2005 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2005 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2006 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2006 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2007 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2007 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2008 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2008 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2009 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2009 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2010 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2010 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2011 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2011 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2012 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2012 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2013 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2013 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2014 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2014 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2015 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2015 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: mboxlist: deleting intermediate with no children: ftp.com!user.10g.test1 (12f9507a5c9e518c) Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test1.2016 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test1.2016 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2002 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2002 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2003 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2003 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2004 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2004 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2005 Jan 23 00:28:11 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2005 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2006 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2006 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2007 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2007 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2008 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2008 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2009 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2009 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2010 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2010 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2011 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2011 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2012 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2012 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2013 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2013 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2014 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2014 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2015 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2015 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: mboxlist: deleting intermediate with no children: ftp.com!user.10g.test11 (12f9507a5c9e518c) Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test11.2016 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test11.2016 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2002 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2002 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2003 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2003 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2004 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2004 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2005 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2005 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2006 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2006 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: twoskip: checkpointed /var/lib/imap/domain/f/ftp.com/user/q/10g.conversations (84 records, 16888 => 7520 bytes) in 0.014 seconds Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2007 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2007 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2008 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2008 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2009 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2009 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2010 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2010 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2011 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2011 Jan 23 00:28:12 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2012 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2012 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2013 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2013 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2014 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2014 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2015 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2015 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2016 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2016 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2017 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2017 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: mboxlist: deleting intermediate with no children: ftp.com!user.10g.test2 (12f9507b5c9e5195) Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test2.2018 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test2.2018 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2002 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2002 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2003 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2003 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2003.2012 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2003.2012 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2003.2013 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2003.2013 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2003.2014 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2003.2014 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2003.2015 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2003.2015 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2003.2016 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2003.2016 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2003.2017 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2003.2017 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: mboxlist: deleting intermediate with no children: ftp.com!user.10g.test3.2003 (144bb1915c9e55d5) Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2003.2018 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2003.2018 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2004 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2004 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2005 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2005 Jan 23 00:28:13 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2006 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2006 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2007 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2007 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2008 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2008 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2009 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2009 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2010 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2010 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2011 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2011 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2012 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2012 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2013 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2013 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2014 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2014 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2015 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2015 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2016 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2016 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2017 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2017 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: mboxlist: deleting intermediate with no children: ftp.com!user.10g.test3 (12f9507c5c9e51e9) Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: conversations_rename_folder: deleted ftp.com!user.10g.test3.2018 Jan 23 00:28:14 cyrus1 cyrus/imaplocal[105250]: Deleted mailbox ftp.com!user.10g.test3.2018

elliefm commented 2 years ago

What value do you have set for delete_mode in your imapd.conf?

delete_mode: delayed The manner in which mailboxes are deleted. In the default delayed mode, mailboxes that are being deleted are renamed to a special mailbox hierarchy under the deletedprefix, to be removed later by cyr_expire(8).

In immediate mode, the mailbox is removed from the filesystem immediately.

Allowed values: immediate, delayed

If you do not have delete_mode set, the default value is "delayed", which will give you behaviour like you see. You can either set up cyr_expire to run periodically to clean these up later, or you can set delete_mode to "immediate" to have deleted mailboxes removed from the filesystem immediately.

The default in 2.4 used to be "immediate", which might be why you expect that behaviour. It changed to "delayed" in 2.5. Many other things have changed between 2.4 and 3.2; you should review the release notes for the versions you have skipped to see what else you may need to consider.

stfast commented 2 years ago

I am acquainted with new releases and actually started with default delete_mode: delayed setting and did some testing - delete messages, folders, delete mailbox and reconstruct mailbox back from DELETED prefix.

Than I switched and restarted cyrus-imapd with delete_mode: immediate, since this behaviour is prefferable for our needs, having problem (not deleting from filesystem), only for mailboxes deleted previously under delayed delete mode. There are no problems for mailboxes created under immediate delete mode, they are deleted immediately from filesystem, that's why this is so weird. Even If I recreate mailbox with same name back and reconstruct from data left on filesystem, it again does not delete files from filesystem on next delete.

Manual cyr_expire (-E 1h -D 1h -X 1h) does not delete anything. Looks like some kind of timestamp transaction from delayed delete mode in cyrus db's is holding mailbox deletes from filesystem.

stfast commented 2 years ago

Now I managed to solve an issue, but explanations are welcome.

I deleted all maiboxes for domain, and there were leftovers (all data) on filesystem:

[root@cyrus1 domain]# ls -al ftp.com/user total 32 drwx------. 8 cyrus mail 4096 Jan 25 02:12 . drwx------. 3 cyrus mail 4096 Jan 25 02:12 .. drwx------. 2 cyrus mail 4096 Jan 25 02:12 100m drwx------. 2 cyrus mail 4096 Jan 25 02:12 10g drwx------. 2 cyrus mail 4096 Jan 25 02:12 1g drwx------. 2 cyrus mail 4096 Jan 25 02:12 500m drwx------. 2 cyrus mail 4096 Jan 25 02:12 5g

Than I deleted files from filesystem and run reconstruct:

[root@cyrus1 domain]# rm -rf ftp.com

[cyrus@cyrus1 ~]$ reconstruct -f |grep ftp ftp.com!user.100m: Mailbox does not exist Failed to reconstruct mailbox ftp.com!user.10g: Mailbox does not exist Failed to reconstruct mailbox ftp.com!user.1g: Mailbox does not exist Failed to reconstruct mailbox ftp.com!user.500m: Mailbox does not exist Failed to reconstruct mailbox ftp.com!user.5g: Mailbox does not exist Failed to reconstruct mailbox

Created cyrus mailboxes back and reconstruct:

[root@cyrus1 domain]# ls -al ftp.com/user total 32 drwx------. 8 cyrus mail 4096 Jan 25 02:14 . drwx------. 3 cyrus mail 4096 Jan 25 02:12 .. drwx------. 2 cyrus mail 4096 Jan 25 02:15 100m drwx------. 2 cyrus mail 4096 Jan 25 02:15 10g drwx------. 2 cyrus mail 4096 Jan 25 02:15 1g drwx------. 2 cyrus mail 4096 Jan 25 02:15 500m drwx------. 2 cyrus mail 4096 Jan 25 02:15 5g

[cyrus@cyrus1 ~]$ reconstruct -f |grep ftp user/100m@ftp.com user/10g@ftp.com user/1g@ftp.com user/500m@ftp.com user/5g@ftp.com

After these steps deletemailbox does delete mailbox(es) successfuly from filesystem.

elliefm commented 2 years ago

I'm glad you've managed to solve it.

I don't have a definitive explanation, but I do have a guess: I think, when delete_mode: intermediate is in effect, mailboxes that were previously deleted under delete_mode: delayed might be partially or completely ignored by cyr_expire and other tools. This would explain them not being cleaned up by cyr_expire; it might also explain the strange permission problem when trying to delete them (again) using cyradm.

If this is the case, it would suggest that when planning to switch from delayed mode to intermediate mode, one should first run cyr_expire to clean up the previously-deleted mailboxes, and only then change modes. That seems like a detail the documentation could mention.

stfast commented 2 years ago

For this kind of secenario It would be good knowing to understand whole mechanism/procedure restoring cyrus-imapd system from mailboxlist and filesystem files (ctl_mboxlist -d > mailbox.dump ; ctl_mboxlist -U < mailbox.dump ; reconstruct -f from filesystem files, which is not good enough).

Actualy you don't care for old delete transations, you just care for mailboxlist and data on filesystem for mailbox restore.

I speculate that old delete transactions under delayed delete_mode are stored in

/var/lib/imap/mailbox.db and /var/lib/imap/domain/*/user/*.conversations.

Should they possibly be deleted (rm -rf /var/lib/imap/domain/*) before reconstruct with -f option?