Deleting Cyrus Mailbox With Empty Name

Home » CentOS » Deleting Cyrus Mailbox With Empty Name
CentOS 1 Comment

A junior administrator of mine mistakenly created a mailbox with an empty name, by typing into cyradm the commands:

createmailbox user/$lb setquota user/$lb 10000

He will of course shortly receive an extra lesson on shell variables, but meanwhile I find myself confronted with the problem how to get rid of the mailbox he created. So far all attempts have failed:

[cyrus@posthamster ~]$ /usr/lib/cyrus-imapd/quota
Quota % Used Used Root
0 user/
0 user/ 10000
[…]
[cyrus@posthamster ~]$ ls -l /var/spool/imap/user/
total 2180
drwx——. 2 cyrus mail 4096 Oct 1 2012
drwx——. 2 cyrus mail 4096 May 7 08:53 10000
[…]
[cyrus@posthamster ~]$ cyradm -u cyrus localhost IMAP Password:
localhost> sq user/$lb localhost> dm user/$lb deletemailbox: Permission denied localhost> lam user/$lb
“” lrswipkxtecda localhost> sam user/$lb cyrus all usage: setaclmailbox mailbox id rights [id rights …]
localhost> sam user/”” cyrus all setaclmailbox: cyrus: lrswipkxtea: Mailbox does not exist localhost> sam user/ cyrus all setaclmailbox: cyrus: lrswipkxtea: Mailbox does not exist localhost> lam user/
Mailbox does not exist localhost> lam user/””
Mailbox does not exist localhost> ^D
[cyrus@posthamster ~]$ ls -l /var/spool/imap/user/
total 2180
drwx——. 2 cyrus mail 4096 Oct 1 2012
drwx——. 2 cyrus mail 4096 May 7 08:53 10000
[…]

Obviously the handling of undefined variable substitution in cyradm is somewhat inconsistent, preventing me from deleting the mailbox the same way it was created.

Any ideas?

TIA
T.

One thought on - Deleting Cyrus Mailbox With Empty Name

  • Thanks, I found the solution. The name of the bad mailbox wasn’t in fact empty, but a single blank character which the cyradm and quota commands dutifully removed as “leading blank” in their output. So

    localhost> sam “user/ ” cyrus all localhost> dm “user/ “

    was what it took to get rid of the mailbox with the “empty” name, and

    localhost> sam “user/ 10000” cyrus all localhost> dm “user/ 10000”

    took care of the second one created by the hapless colleague’s setquota command.

    Am 07.05.2013 21:04, schrieb Tilman Schmidt:
    […]

LEAVE A COMMENT