doveadm mailbox delete not working
I have a user who has several folders in his mailbox, which we can not delete, neither via IMAP nor via doveadm:
root@ka-nfs-mail:~# doveadm mailbox list -u <username> | grep hbereiche | cat -v INBOX/[Fachbereiche ^M INBOX/Fachbereiche ^M INBOX/hbereiche^M INBOX/hbereiche/LAGen]^M INBOX/hbereiche/LAG^M INBOX/[Fachbereiche^M INBOX/[Fachbereiche/LAGen]^M INBOX/[Fachbereiche]^M INBOX/[Fachbereiche]/LAGen]^M INBOX/[Fachbereiche]/LAGe^M root@ka-nfs-mail:~# doveadm mailbox delete -u <username> 'INBOX/Fachbereiche ' doveadm(<username>): Info: Mailbox deleted: INBOX/Fachbereiche root@ka-nfs-mail:~# doveadm mailbox list -u <username>| grep hbereiche | cat -v INBOX/[Fachbereiche ^M INBOX/Fachbereiche ^M INBOX/hbereiche^M INBOX/hbereiche/LAGen]^M INBOX/hbereiche/LAG^M INBOX/[Fachbereiche^M INBOX/[Fachbereiche/LAGen]^M INBOX/[Fachbereiche]^M INBOX/[Fachbereiche]/LAGen]^M INBOX/[Fachbereiche]/LAGe^M
As far as I tried none of these folders can be deleted (I added single quotes for trailing space and tried to delete subfolders first).
Mailbox is in mdbox format on a replication pair under Dovecot 2.2.36 and I tried both nodes of the replication with same result.
Any ideas?
Ralf
-- Ralf Becker EGroupware GmbH [www.egroupware.org] Handelsregister HRB Kaiserslautern 3587 Geschäftsführer Birgit und Ralf Becker Leibnizstr. 17, 67663 Kaiserslautern, Germany Telefon +49 631 31657-0
can you turn on mail_debug=yes and run doveadm -Dv mailbox delete and provide output and logs from both servers?
---Aki TuomiDovecot oy -------- Original message --------From: Ralf Becker rb@egroupware.org Date: 14/08/2018 16:13 (GMT+02:00) To: dovecot@dovecot.org Subject: doveadm mailbox delete not working I have a user who has several folders in his mailbox, which we can not delete, neither via IMAP nor via doveadm:
root@ka-nfs-mail:~# doveadm mailbox list -u <username> | grep hbereiche | cat -v INBOX/[Fachbereiche ^M INBOX/Fachbereiche ^M INBOX/hbereiche^M INBOX/hbereiche/LAGen]^M INBOX/hbereiche/LAG^M INBOX/[Fachbereiche^M INBOX/[Fachbereiche/LAGen]^M INBOX/[Fachbereiche]^M INBOX/[Fachbereiche]/LAGen]^M INBOX/[Fachbereiche]/LAGe^M root@ka-nfs-mail:~# doveadm mailbox delete -u <username> 'INBOX/Fachbereiche ' doveadm(<username>): Info: Mailbox deleted: INBOX/Fachbereiche root@ka-nfs-mail:~# doveadm mailbox list -u <username>| grep hbereiche | cat -v INBOX/[Fachbereiche ^M INBOX/Fachbereiche ^M INBOX/hbereiche^M INBOX/hbereiche/LAGen]^M INBOX/hbereiche/LAG^M INBOX/[Fachbereiche^M INBOX/[Fachbereiche/LAGen]^M INBOX/[Fachbereiche]^M INBOX/[Fachbereiche]/LAGen]^M INBOX/[Fachbereiche]/LAGe^M
As far as I tried none of these folders can be deleted (I added single quotes for trailing space and tried to delete subfolders first).
Mailbox is in mdbox format on a replication pair under Dovecot 2.2.36 and I tried both nodes of the replication with same result.
Any ideas?
Ralf
-- Ralf Becker EGroupware GmbH [www.egroupware.org] Handelsregister HRB Kaiserslautern 3587 Geschäftsführer Birgit und Ralf Becker Leibnizstr. 17, 67663 Kaiserslautern, Germany Telefon +49 631 31657-0
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 14 Aug 2018, Ralf Becker wrote:
Date: Tue, 14 Aug 2018 15:13:12 +0200 From: Ralf Becker rb@egroupware.org To: dovecot@dovecot.org Subject: doveadm mailbox delete not working
I have a user who has several folders in his mailbox, which we can not delete, neither via IMAP nor via doveadm:
root@ka-nfs-mail:~# doveadm mailbox list -u <username> | grep hbereiche | cat -v INBOX/[Fachbereiche ^M
Any ideas?
I haven't seen this idea and you've wrote nothing about the ^M:
The ^M means that there is a "\015" / \r at the end of the output. Where does this char come from? In "normal" output, this char is almost invisible, esp. at the end of a line. I don't know how Dovecot handles this char internally.
The char should show up in the JSON formatted list, Aki suggested, too:
doveadm -fjson mailbox list -u user INBOX/*
But I haven't seen the output in your replies.
Can you verify in the filesystem, if the char is there, too? E.g. ls -1 | cat -v
Maybe
doveadm mailbox delete -u <username> 'INBOX/Fachbereiche '"\015" Would help?
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBW3QxbcQnQQNheMxiAQJ1vggAmYnlV4xnMJmec34RnpkQpHlz+NK+JnPY JYB3HsI4RwShJwFp7kDpa8GQDub4Hml249v2Hy2TAd270j7QYJn258vyLMJjrIzy Gi82Q/M65mF6seYtOXsR6sl9qqXcEZaVPsSUmHTpP+JfNEGye1RCfuqoaoV0pSuu Kdv8naUDtdTvXVqJfe3McPRbx/+PZouMGLk1AuH3ol0fM+K4SMM65eZDp4VlbZvb ZBklQleH7K8bz2p1rV6yhsJ/1KooS/QgaGz4Ejfm5U2FVFb2dpuAkVFNMu1LpJP9 gD9Y5cH6CbuPYlp2t/8xrozIUpZ/q7CBfdRZVdm3DsaiEnRtq4g4Lg== =OaBM -----END PGP SIGNATURE-----
Hi Steffen,
Am 15.08.18 um 15:58 schrieb Steffen Kaiser:
On Tue, 14 Aug 2018, Ralf Becker wrote:
Date: Tue, 14 Aug 2018 15:13:12 +0200 From: Ralf Becker rb@egroupware.org To: dovecot@dovecot.org Subject: doveadm mailbox delete not working
I have a user who has several folders in his mailbox, which we can not delete, neither via IMAP nor via doveadm:
root@ka-nfs-mail:~# doveadm mailbox list -u <username> | grep hbereiche | cat -v INBOX/[Fachbereiche ^M
Any ideas?
I haven't seen this idea and you've wrote nothing about the ^M:
The ^M is the regular CR from the doveadm output converted by cat -v and I used it to show there is a trailing space.
The ^M means that there is a "\015" / \r at the end of the output. Where does this char come from? In "normal" output, this char is almost invisible, esp. at the end of a line. I don't know how Dovecot handles this char internally.
The char should show up in the JSON formatted list, Aki suggested, too:
doveadm -fjson mailbox list -u user INBOX/*
But I haven't seen the output in your replies.
Can you verify in the filesystem, if the char is there, too? E.g. ls -1 | cat -v
root@ka-nfs-mail:/poolN/dovecot/imap/<domain>/<user>/mdbox/mailboxes# ls -1|cat -v|grep hbereich [Fachbereiche [Fachbereiche [Fachbereiche] Fachbereiche hbereiche
So there is no ^M/CR in the filename itself.
Ralf
Maybe
doveadm mailbox delete -u <username> 'INBOX/Fachbereiche '"\015" Would help?
-- Steffen Kaiser
-- Ralf Becker EGroupware GmbH [www.egroupware.org] Handelsregister HRB Kaiserslautern 3587 Geschäftsführer Birgit und Ralf Becker Leibnizstr. 17, 67663 Kaiserslautern, Germany Telefon +49 631 31657-0
I found a way to reproduce the problem :)
Use an arbitrary mailbox (maybe my Dovecot config with mdbox etc. required). Then use Thunderbird (52.9.1 on Mac) to create eg. the following folder (without the quotes!):
"[Test / Test]"
This is a space, a slash and a space between the Test in square brackets.
TB now creates the following two folders:
- "INBOX/[Test " (not subscribed)
- "INBOX/[Test / Test]" (subscribed)
I can delete the 2. one, but the 1. one is not deletable, neither via TB nor doveadm command:
/ # doveadm mailbox status -u bb@bb-trunk.egroupware.de all 'INBOX/[Test ' doveadm(bb@bb-trunk.egroupware.de): Error: Mailbox INBOX/[Test : Failed to lookup mailbox status: Mailbox doesn't exist: INBOX/[Test / # doveadm mailbox delete -u bb@bb-trunk.egroupware.de 'INBOX/[Test ' doveadm(bb@bb-trunk.egroupware.de): Info: Mailbox deleted: INBOX/[Test / # doveadm mailbox list -u bb@bb-trunk.egroupware.de 'INBOX/[Test ' INBOX/[Test
I can see the folder under mdbox/mailboxes and in mdbox/subscriptions.
I hope that allows you to reproduce it.
Ralf
Am 14.08.18 um 15:13 schrieb Ralf Becker:
I have a user who has several folders in his mailbox, which we can not delete, neither via IMAP nor via doveadm:
root@ka-nfs-mail:~# doveadm mailbox list -u <username> | grep hbereiche | cat -v INBOX/[Fachbereiche ^M INBOX/Fachbereiche ^M INBOX/hbereiche^M INBOX/hbereiche/LAGen]^M INBOX/hbereiche/LAG^M INBOX/[Fachbereiche^M INBOX/[Fachbereiche/LAGen]^M INBOX/[Fachbereiche]^M INBOX/[Fachbereiche]/LAGen]^M INBOX/[Fachbereiche]/LAGe^M root@ka-nfs-mail:~# doveadm mailbox delete -u <username> 'INBOX/Fachbereiche ' doveadm(<username>): Info: Mailbox deleted: INBOX/Fachbereiche root@ka-nfs-mail:~# doveadm mailbox list -u <username>| grep hbereiche | cat -v INBOX/[Fachbereiche ^M INBOX/Fachbereiche ^M INBOX/hbereiche^M INBOX/hbereiche/LAGen]^M INBOX/hbereiche/LAG^M INBOX/[Fachbereiche^M INBOX/[Fachbereiche/LAGen]^M INBOX/[Fachbereiche]^M INBOX/[Fachbereiche]/LAGen]^M INBOX/[Fachbereiche]/LAGe^M
As far as I tried none of these folders can be deleted (I added single quotes for trailing space and tried to delete subfolders first).
Mailbox is in mdbox format on a replication pair under Dovecot 2.2.36 and I tried both nodes of the replication with same result.
Any ideas?
Ralf
-- Ralf Becker EGroupware GmbH [www.egroupware.org] Handelsregister HRB Kaiserslautern 3587 Geschäftsführer Birgit und Ralf Becker Leibnizstr. 17, 67663 Kaiserslautern, Germany Telefon +49 631 31657-0
One more update, I tried renaming that "[Test " folder to just "Test", which creates an also not deletable folder "Test".
Good news is, if I delete these folders on both replication nodes from mdbox/mailboxes and mdbox/subscriptions they seem to be really gone. I can event create the folder "Test" again and it behaves normal aka. I can delete it afterwards via IMAP.
Any objections againts that workaround (deleting the folder in mdbox/mailboxes and from mdbox/subscriptions)?
Ralf
Am 15.08.18 um 18:23 schrieb Ralf Becker:
I found a way to reproduce the problem :)
Use an arbitrary mailbox (maybe my Dovecot config with mdbox etc. required). Then use Thunderbird (52.9.1 on Mac) to create eg. the following folder (without the quotes!):
"[Test / Test]"
This is a space, a slash and a space between the Test in square brackets.
TB now creates the following two folders:
- "INBOX/[Test " (not subscribed)
- "INBOX/[Test / Test]" (subscribed)
I can delete the 2. one, but the 1. one is not deletable, neither via TB nor doveadm command:
/ # doveadm mailbox status -u bb@bb-trunk.egroupware.de all 'INBOX/[Test ' doveadm(bb@bb-trunk.egroupware.de): Error: Mailbox INBOX/[Test : Failed to lookup mailbox status: Mailbox doesn't exist: INBOX/[Test / # doveadm mailbox delete -u bb@bb-trunk.egroupware.de 'INBOX/[Test ' doveadm(bb@bb-trunk.egroupware.de): Info: Mailbox deleted: INBOX/[Test / # doveadm mailbox list -u bb@bb-trunk.egroupware.de 'INBOX/[Test ' INBOX/[Test
I can see the folder under mdbox/mailboxes and in mdbox/subscriptions.
I hope that allows you to reproduce it.
Ralf
Am 14.08.18 um 15:13 schrieb Ralf Becker:
I have a user who has several folders in his mailbox, which we can not delete, neither via IMAP nor via doveadm:
root@ka-nfs-mail:~# doveadm mailbox list -u <username> | grep hbereiche | cat -v INBOX/[Fachbereiche ^M INBOX/Fachbereiche ^M INBOX/hbereiche^M INBOX/hbereiche/LAGen]^M INBOX/hbereiche/LAG^M INBOX/[Fachbereiche^M INBOX/[Fachbereiche/LAGen]^M INBOX/[Fachbereiche]^M INBOX/[Fachbereiche]/LAGen]^M INBOX/[Fachbereiche]/LAGe^M root@ka-nfs-mail:~# doveadm mailbox delete -u <username> 'INBOX/Fachbereiche ' doveadm(<username>): Info: Mailbox deleted: INBOX/Fachbereiche root@ka-nfs-mail:~# doveadm mailbox list -u <username>| grep hbereiche | cat -v INBOX/[Fachbereiche ^M INBOX/Fachbereiche ^M INBOX/hbereiche^M INBOX/hbereiche/LAGen]^M INBOX/hbereiche/LAG^M INBOX/[Fachbereiche^M INBOX/[Fachbereiche/LAGen]^M INBOX/[Fachbereiche]^M INBOX/[Fachbereiche]/LAGen]^M INBOX/[Fachbereiche]/LAGe^M
As far as I tried none of these folders can be deleted (I added single quotes for trailing space and tried to delete subfolders first).
Mailbox is in mdbox format on a replication pair under Dovecot 2.2.36 and I tried both nodes of the replication with same result.
Any ideas?
Ralf
-- Ralf Becker EGroupware GmbH [www.egroupware.org] Handelsregister HRB Kaiserslautern 3587 Geschäftsführer Birgit und Ralf Becker Leibnizstr. 17, 67663 Kaiserslautern, Germany Telefon +49 631 31657-0
Actually you are using separator /, so making folder
INBOX/[Test / Test] =>
"INBOX" sep "[Test " sep " Test]"
but it will not create "INBOX/[ Test " (it will be noselect folder, parent for "INBOX/[Test / Test]")
and thus will be deleted once you delete INBOX/[Test / Test]
"doveadm(testuser1): Error: Can't delete mailbox INBOX/[Test : Mailbox has children, delete them first"
also mailbox list has feature that it will always list whatever folder you give it, so even if you do
doveadm mailbox list "This Does Not Exist"
you will still see it. A feature, not a bug. =)
you could try
doveadm exec imap -u victim LIST "INBOX/" "*"
to see which are the select, and which are the noselect parent ones, they should go away once you delete the children.
Aki
On 15 August 2018 at 19:37 Ralf Becker rb@egroupware.org wrote:
One more update, I tried renaming that "[Test " folder to just "Test", which creates an also not deletable folder "Test".
Good news is, if I delete these folders on both replication nodes from mdbox/mailboxes and mdbox/subscriptions they seem to be really gone. I can event create the folder "Test" again and it behaves normal aka. I can delete it afterwards via IMAP.
Any objections againts that workaround (deleting the folder in mdbox/mailboxes and from mdbox/subscriptions)?
Ralf
Am 15.08.18 um 18:23 schrieb Ralf Becker:
I found a way to reproduce the problem :)
Use an arbitrary mailbox (maybe my Dovecot config with mdbox etc. required). Then use Thunderbird (52.9.1 on Mac) to create eg. the following folder (without the quotes!):
"[Test / Test]"
This is a space, a slash and a space between the Test in square brackets.
TB now creates the following two folders:
- "INBOX/[Test " (not subscribed)
- "INBOX/[Test / Test]" (subscribed)
I can delete the 2. one, but the 1. one is not deletable, neither via TB nor doveadm command:
/ # doveadm mailbox status -u bb@bb-trunk.egroupware.de all 'INBOX/[Test ' doveadm(bb@bb-trunk.egroupware.de): Error: Mailbox INBOX/[Test : Failed to lookup mailbox status: Mailbox doesn't exist: INBOX/[Test / # doveadm mailbox delete -u bb@bb-trunk.egroupware.de 'INBOX/[Test ' doveadm(bb@bb-trunk.egroupware.de): Info: Mailbox deleted: INBOX/[Test / # doveadm mailbox list -u bb@bb-trunk.egroupware.de 'INBOX/[Test ' INBOX/[Test
I can see the folder under mdbox/mailboxes and in mdbox/subscriptions.
I hope that allows you to reproduce it.
Ralf
Am 14.08.18 um 15:13 schrieb Ralf Becker:
I have a user who has several folders in his mailbox, which we can not delete, neither via IMAP nor via doveadm:
root@ka-nfs-mail:~# doveadm mailbox list -u <username> | grep hbereiche | cat -v INBOX/[Fachbereiche ^M INBOX/Fachbereiche ^M INBOX/hbereiche^M INBOX/hbereiche/LAGen]^M INBOX/hbereiche/LAG^M INBOX/[Fachbereiche^M INBOX/[Fachbereiche/LAGen]^M INBOX/[Fachbereiche]^M INBOX/[Fachbereiche]/LAGen]^M INBOX/[Fachbereiche]/LAGe^M root@ka-nfs-mail:~# doveadm mailbox delete -u <username> 'INBOX/Fachbereiche ' doveadm(<username>): Info: Mailbox deleted: INBOX/Fachbereiche root@ka-nfs-mail:~# doveadm mailbox list -u <username>| grep hbereiche | cat -v INBOX/[Fachbereiche ^M INBOX/Fachbereiche ^M INBOX/hbereiche^M INBOX/hbereiche/LAGen]^M INBOX/hbereiche/LAG^M INBOX/[Fachbereiche^M INBOX/[Fachbereiche/LAGen]^M INBOX/[Fachbereiche]^M INBOX/[Fachbereiche]/LAGen]^M INBOX/[Fachbereiche]/LAGe^M
As far as I tried none of these folders can be deleted (I added single quotes for trailing space and tried to delete subfolders first).
Mailbox is in mdbox format on a replication pair under Dovecot 2.2.36 and I tried both nodes of the replication with same result.
Any ideas?
Ralf
-- Ralf Becker EGroupware GmbH [www.egroupware.org] Handelsregister HRB Kaiserslautern 3587 Geschäftsführer Birgit und Ralf Becker Leibnizstr. 17, 67663 Kaiserslautern, Germany Telefon +49 631 31657-0
participants (3)
-
Aki Tuomi
-
Ralf Becker
-
Steffen Kaiser