Cyrus: mailbox undeleteable - how to edit mailboxes.db
Jan Kowalsky
jankow at datenkollektiv.net
Fri May 23 16:23:22 CEST 2014
Hi all,
I've a problem with a mailbox which is undeletable. The reason is a
white space in the mailbox name like:
/user/givenname middlename.surname at example.org
It was created during migration because of a wrong transliteration of
recipient policy - as far as I understood (some missing locales).
I changed/deleted the user - but the folder still resides in cyrus and
isn't deletable neither with "kolab dm MAILBOX" nor with cyradm directly.
Since it causes some cyrus problems: recursive reconstruction fails with
segfault and error about a nonexistent mailbox, I'd like to get rid of it.
The only idea I got is to manipulate the mailboxes.db directly to delete
the entries and delete the related folders in filesystem.
I did it already on a copy of the productive system with success (as far
as I could see).
But I would like to be sure that it has no side effects. Can anybody
tell me if this is a reasonable approach?
What I did:
# stop cyrus
service cyrus-imapd stop
# convert sikplist db to flat file
/usr/lib/cyrus-imapd/cvt_cyrusdb /srv/imap/config/mailboxes.db \
skiplist /root/tmp/mailboxes.db.txt flat
# deleted the lines of the related mailboxes
vi /root/tmp/mailboxes.db.txt flat
# converting back and copy to cyrus config dir
/usr/lib/cyrus-imapd/cvt_cyrusdb /root/tmp/mailboxes.db.txt \
flat /root/tmp/mailboxes.db.new skiplist
cp /root/tmp/mailboxes.db.new /srv/imap/config/mailboxes.db
chown cyrus:mail /srv/imap/config/mailboxes.db
chmod 600 /srv/imap/config/mailboxes.db
# delete the related folders
rm -r PATHOFFOLDER
# reconstruct mailbox
/usr/lib/cyus-imapd/reconstruct
# start cyrus
service cyrus-imapd start
What do you think? Anything else to be done? Is it possible at all?
Thanks and Regards
Jan
More information about the users
mailing list