Re: Deleting "ghost" mailboxes that don't correspond to filesystem directories

Jay Sekora <[email protected]>
Newsgroups gmane.mail.imap.cyrus
Message-ID <[email protected]>
On Tue, Mar 04, 2025 at 08:51:42PM +0100, Michael Menge wrote:
> Check for "space" at the end of the folder name. The columns are "tab"
> seperated.

Yes, a couple of them had trailing spaces (which I noticed and quoted
appropriately) but most of them didn't.

> Also you can try to use "reconstruct -r user.[redacted]" or
> "reconstruct -u [redacted]"

That produces "I/O error".

> === !!! WARNING USE WITH CAUTION !!! ====
> 
> If you are sure that the folder does not exist anymore on the file system
> and EVERTHING else failed you can try to remove the entries from the
> mailboxes.db.

Thanks for the instructions!  I think this is what I'll have to do, and
of course that will require a time when I can schedule downtime.

(I probably won't bother doing it on the old server but will just write
my tools to prune out known-bad folder names.  But this will be useful 
on the new server, and I can do it as part of the downtime when we cut
over.)

It would be nice if there were a command-line tool to fix the database when
it gets out of synch with reality like this (either a tool to remove a 
specific mailbox database entry, or a tool to find mailboxes know to the
database that don't correspond to a folder in the the filesystem and ask
what to do about them).

Better yet would be if cyradm's deletemailbox command just worked in this
case (perhaps if given an "-f" flag or after a warning and confirmation).


> #stop cyrus
> #create backup of your mailboxes.db
> ctl_mboxlist -d > /tmp/mboxlist
> vi /tmp/mboxlist
> ctl_mboxlist -u < /tmp/mboxlist
> # Limit access to cyrus e.g. via firewall so that you can test
> # if cyrus is running without any problem and nobody is creating/deleting
> folder
> # or changing acls, so that you can use your backup of your mailboxes.db in
> case
> # somthing went wrong
> start cyrus

------------------------------------------
Cyrus: Info
Permalink: https://cyrus.topicbox.com/groups/info/Te4b694eca4c5d369-M2224f53023609e7475c4b112
Delivery options: https://cyrus.topicbox.com/groups/info/subscription
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.