[Dovecot] deleting folders containing subfolders with thunderbird
(mbox format) bug
John Bramley
simplyjb at npg.york.ac.uk
Thu Jul 21 20:35:16 EEST 2005
When using Thunderbird (dovecot-0.99.13-3.FC3) on Fedora connecting to
dovecot-0.99.13-3.FC3 I am having problems deleting folders which have
been created with the 'Allow your new folder to contain: Folders only'
option picked.
The folder appears to get deleted but upon restarting Thunderbird the
folder still appears to be there but clicking on it I get the error:
'The current command did not succeed. The mailserver responded: Mailbox
doesn't exist: <mailbox name>'.
Upon investigation when creating and deleting a folder called 'bilbo' to
contain subfolders only:
Thunderbird sends 'create bilbo/' imap command and then
'subscribe bilbo/'
Dovecot creates a directory 'bilbo' and adds 'bilbo/' to the
.subscriptions file
which all works ok.
Upon trying to delete the folder and confirming that it should be
deleted Thunderbird sends:
'delete bilbo/'
dovecot replies
'OK Delete completed'
Then thunderbird sends
'unsubscribe bilbo/'
dovecot replies
'NO Invalid mailbox name'
which Thunderbird ignores and all seems to have gone ok until
thunderbird is restarted and the folder reappears in the folder list but
nothing can be done with it.
I believe that if a client sends an 'unsubscribe' command to a mailbox
that is currently subscribed the imap server should unsubscribe it -
even if the actual mailbox doesn't exist (unsubscribe and then delete
seems to work when testing using telnet to port 143 to send imap commands).
Dovecot does allow mailboxes to be unsubscribed if they don't exist if
they don't have a tailing '/' character (so deleting folders set to
contain only messages in Thunderbird works ok).
I expect that everything works ok using Maildir mailboxes because then
there is no need to mark folders containing folders with a '/' because
all folders can contain messages and folders.
For my own purposes I have hacked the mbox_get_mailbox_name_status
function in src/lib-storage/index/mbox/mbox-storage.c to add a check to
see if the mailbox name is already subscribed to and if it is then
return status = MAILBOX_NAME_EXISTS, before the 'if
(!mbox_is_valid_create_name(storage, name))' check which is returning
status = MAILBOX_NAME_INVALID, which seems to work ok for me.
UW-imap works ok
I'm surprised at this bug (or am I doing something completely wrong),
surely lots of people use Thunderbird with dovecot, do they not create
sub-folders in folders, or are they all using Maildir format, or do they
never find the 'Server supports folders that contain sub-folders and
messages' advanced option so they are never able to create folders
within folders in the first place?
John.
More information about the dovecot
mailing list