Hi, This appears to be some sort of dovecot bug. When I use the -r option to recursively delete a mailbox and sub-folders, it removes the sub-folders but not the inbox. It gives me the error below: doveadm mailbox delete -u denise at lifelinetechnique.com.au -r -s inbox doveadm(denise at lifelinetechnique.com.au): Error: Can't delete mailbox inbox: INBOX can't be deleted. Our user database is in ldap and I am using dovecot-ee v2:2.2.31.2-1. Could you please acknowledge that this is a bug or let me know the correct way of recursively deleting a mailbox as there is nothing in the man page about the -r option. Thanks Murray Regards, Murray T. Level 3 Project Manager P: +61 8 9422 0894 F: +61 8 9422 0801 www.DreamscapeNetworks.com<http://www.dreamscapenetworks.com/> [dreamscape]<http://www.dreamscapenetworks.com/> DISCLAIMER: This e-mail and/or attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender immediately and do not disclose the contents to other persons or use it for any purpose or store or copy the information in any medium. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Dreamscape Networks. Copyright (c) 2017 www.DreamscapeNetworks.com<http://www.dreamscapenetworks.com/>, All rights reserved.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, 17 Aug 2017, Murray T. | Dreamscape wrote:> This appears to be some sort of dovecot bug. When I use the -r option to recursively delete a mailbox and sub-folders, it removes the sub-folders but not the inbox. It gives me the error below: > > doveadm mailbox delete -u denise at lifelinetechnique.com.au -r -s inbox > doveadm(denise at lifelinetechnique.com.au): Error: Can't delete mailbox inbox: INBOX can't be deleted. > > Our user database is in ldap and I am using dovecot-ee v2:2.2.31.2-1. Could you please acknowledge that this is a bug or let me know the correct way of recursively deleting a mailbox as there is nothing in the man page about the -r option.It's on purpose: if (mailbox_is_any_inbox(box)) { /* IMAP protocol allows this, but I think it's safer to not allow it. */ mailbox_free(&box); client_send_tagline(cmd, "NO INBOX can't be deleted."); return TRUE; } Why do you want to delete the INBOX of the user? - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEVAwUBWZVFPXz1H7kL/d9rAQIs2wf/X2l5XvHLit36SV9ZwEp6xXccfEv4W+92 nelVf0hk9pSAB5Ai2OkjnTyEMWdCB5hOsoz7saNazjTK6IXd/0C2mIRgZvkUVSXT tEYIf7rd+IAVYSwzmYKxYagcmf36lwzzqMx8PR5bC4w5n9XvyrO6VNVdULvFu8G1 7jzdBWDcSeLocgQj+V5VtVjOnSqyD3jsRZ1uUW7vLeeJPm97DDtAuIzKs39TfvHt tNBGRje0kGIs2jjdsE9CIDNG053LaLb6bz2BnCBPsRL39uE/L6++I/IF9Gk8nTTk 4skKAWdZTfinQh0w2zaFR2KiBLN5cdJtI4MpN51uIxKH+zKdHaAhpw==MhpO -----END PGP SIGNATURE-----
Hi Steffen, Thanks for the reply. We have a regular need to purge mailboxes completely. Our users delete the mailboxes through a GUI and we use a script to delete the mailbox via a doveadm mailbox delete command. We need the mailbox and contents completely removed to prevent orphaned mailboxes lying around to save us disk storage. The user also expects the mailbox and its contents to be removed. We are currently using the command below to try and purge the contents of the mailbox but it doesn't seem to always purge all the contents. doveadm -o doveadm_password=$doveadm_pass expunge -S $mailstore:24245 -u $mail mailbox '*' all" When I saw there was a new -r option to doveadm mailbox delete I thought that would do what we need but it doesn't appear so. Please let me know if there is another way we can remove mailbox and all of its sub-folders and contents via doveadm. Thanks Murray -----Original Message----- From: Steffen Kaiser [mailto:skdovecot at smail.inf.fh-brs.de] Sent: Thursday, 17 August 2017 3:27 PM To: Murray T. | Dreamscape <murray.t at dreamscapenetworks.com> Cc: 'dovecot at dovecot.org' <dovecot at dovecot.org> Subject: Re: Can't recursively delete mailboxes -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, 17 Aug 2017, Murray T. | Dreamscape wrote:> This appears to be some sort of dovecot bug. When I use the -r option to recursively delete a mailbox and sub-folders, it removes the sub-folders but not the inbox. It gives me the error below: > > doveadm mailbox delete -u denise at lifelinetechnique.com.au -r -s inbox > doveadm(denise at lifelinetechnique.com.au): Error: Can't delete mailbox inbox: INBOX can't be deleted. > > Our user database is in ldap and I am using dovecot-ee v2:2.2.31.2-1. Could you please acknowledge that this is a bug or let me know the correct way of recursively deleting a mailbox as there is nothing in the man page about the -r option.It's on purpose: if (mailbox_is_any_inbox(box)) { /* IMAP protocol allows this, but I think it's safer to not allow it. */ mailbox_free(&box); client_send_tagline(cmd, "NO INBOX can't be deleted."); return TRUE; } Why do you want to delete the INBOX of the user? - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEVAwUBWZVFPXz1H7kL/d9rAQIs2wf/X2l5XvHLit36SV9ZwEp6xXccfEv4W+92 nelVf0hk9pSAB5Ai2OkjnTyEMWdCB5hOsoz7saNazjTK6IXd/0C2mIRgZvkUVSXT tEYIf7rd+IAVYSwzmYKxYagcmf36lwzzqMx8PR5bC4w5n9XvyrO6VNVdULvFu8G1 7jzdBWDcSeLocgQj+V5VtVjOnSqyD3jsRZ1uUW7vLeeJPm97DDtAuIzKs39TfvHt tNBGRje0kGIs2jjdsE9CIDNG053LaLb6bz2BnCBPsRL39uE/L6++I/IF9Gk8nTTk 4skKAWdZTfinQh0w2zaFR2KiBLN5cdJtI4MpN51uIxKH+zKdHaAhpw==MhpO -----END PGP SIGNATURE-----
On 17 Aug 2017, at 9.31, Murray T. | Dreamscape <murray.t at dreamscapenetworks.com> wrote:> > doveadm mailbox delete -u denise at lifelinetechnique.com.au <mailto:denise at lifelinetechnique.com.au> -r -s inbox > doveadm(denise at lifelinetechnique.com.au <mailto:denise at lifelinetechnique.com.au>): Error: Can't delete mailbox inbox: INBOX can't be deleted.I guess you're using Maildir format? With that INBOX can't be deleted, because the Maildir root directory is the INBOX directly. With other mailbox formats it would work. And I think if you used mail_location = ...:INBOX=~/Maildir/INBOX or something like that, it would also work.