[Dovecot] Can't create subfolders of my INBOX or delete folders with IMAP
Hi,
I've been using the dovecot IMAP server for about a year now, and basically it works. But there's an annoying problem, that I can't make any subfolders. I can only make folders that are at the same level as my INBOX folder. Worse, I can't delete folders once I've created them.
I'm using Debian unstable on both the server machine and my client machine. The dovecot version is 0.99.13. For my mail client, I'm using Mozilla Thunderbird version 1.0.
I've done a bit of investigation on my filesystem, and by googling for all kinds of stuff, but I'm really drawing a blank on this particular problem. Most of the general linux email documentation I've found either doesn't mention IMAP, or doesn't mention dovecot, or both. I can barely find any references to the concept of "subfolder" at all. I really don't want to know anything about email servers, I just want the bloody thing to work. Trying to figure out what the hell's going on is really frustrating!
On the server, I seem to have various mailboxes distributed around the place. I've got a mail box in /var/spool/mail. I've got a file ~/mbox, which seems to be very old and is therefore probably a red herring. I've also got a directory ~/Mail with a bunch of files in, one for each of my folders. Having some of my mail in /var/spool, and some in my home directory, seems a really horrible way of arranging things, but anyway...
Various online sources seem to suggest that maildir is better than mbox. I don't have any particular preference for one or the other, but I don't want to change if I don't have to because:
From experience, I don't screw with settings if I don't have to. Debian made it that way, and changing it behind Debian's back is a surefire way to cause trouble later.
Any other accounts on that machine (especially ones I might create in future) will probably still be mbox, causing even worse confusion later.
Porting mailboxes is always risky, and I don't want to lose my mail, or have incoming email dropped, or accidentally corrupt it, or anything like that.
So I'm not going to do any of that unless I'm sure that it's actually going to fix the subfolder problem, and until now I haven't found any information anywhere to guarantee that that's the case. Intuitively I can guess that if a folder is just a big file full of concatenated email, then making a subfolder is going to be pretty much impossible, but I don't want to guess here.
The actual symptoms in thunderbird are:
When I select "New folder...", I get the "Create as a subfolder of:" dropdown hierarchy box thingy, but the "Inbox" option is greyed out (side complaint: no user interface should ever have a greyed out option without providing an explanation as to why it's not available, and what you should do if you want it to be available. Displaying it like that is just cruelly teasing the user).
When I try to delete a folder, I get a dialog box saying "The current command did not succeed. The mail server responded: Mailbox doesn't exist: <name of folder>". This is pretty frustrating, because I can *see* the damn thing in thunderbird. (another side complaint: "The current command"? You're *running* the bloody command, you should have a better description than that!)
For some reason though, I can rename a folder with no problems.
I went into /var/log/ on the server, to see what was in the Dovecot log file about the server errors above, but there *is* no log file, nor anything in the syslog. That can't be good. How do you tell the sysadmin when there's a problem?
Does anyone have any suggestions for how I can fix this? And if possible, I want to fix this the Debian way, that is by modifying a debconf setting or a /etc/default file or something like that, so that when I upgrade Debian, or uninstall dovecot and then reinstall it, it'll be handled gracefully.
Thanks, Matthew Exon
I had the same problem. When creating a new folder that should contain subfolders, I appended a trailing /. This would enable the folder to contain subfolders. And only leaf nodes could contain messages.
Along that same line, Thunderbird was trying to put folders into the Trash folder upon deletion. Which wasn't allowed (as far as I can tell) because the Trash folder was a leaf node, and could only contain messages.
If I tried to delete a folder in Outlook, or a webmail client, it deleted it correctly.
.josh
Matthew Exon wrote:
Hi,
I've been using the dovecot IMAP server for about a year now, and basically it works. But there's an annoying problem, that I can't make any subfolders. I can only make folders that are at the same level as my INBOX folder. Worse, I can't delete folders once I've created them.
I'm using Debian unstable on both the server machine and my client machine. The dovecot version is 0.99.13. For my mail client, I'm using Mozilla Thunderbird version 1.0.
I've done a bit of investigation on my filesystem, and by googling for all kinds of stuff, but I'm really drawing a blank on this particular problem. Most of the general linux email documentation I've found either doesn't mention IMAP, or doesn't mention dovecot, or both. I can barely find any references to the concept of "subfolder" at all. I really don't want to know anything about email servers, I just want the bloody thing to work. Trying to figure out what the hell's going on is really frustrating!
On the server, I seem to have various mailboxes distributed around the place. I've got a mail box in /var/spool/mail. I've got a file ~/mbox, which seems to be very old and is therefore probably a red herring. I've also got a directory ~/Mail with a bunch of files in, one for each of my folders. Having some of my mail in /var/spool, and some in my home directory, seems a really horrible way of arranging things, but anyway...
Various online sources seem to suggest that maildir is better than mbox. I don't have any particular preference for one or the other, but I don't want to change if I don't have to because:
From experience, I don't screw with settings if I don't have to. Debian made it that way, and changing it behind Debian's back is a surefire way to cause trouble later.
Any other accounts on that machine (especially ones I might create in future) will probably still be mbox, causing even worse confusion later.
Porting mailboxes is always risky, and I don't want to lose my mail, or have incoming email dropped, or accidentally corrupt it, or anything like that.
So I'm not going to do any of that unless I'm sure that it's actually going to fix the subfolder problem, and until now I haven't found any information anywhere to guarantee that that's the case. Intuitively I can guess that if a folder is just a big file full of concatenated email, then making a subfolder is going to be pretty much impossible, but I don't want to guess here.
The actual symptoms in thunderbird are:
When I select "New folder...", I get the "Create as a subfolder of:" dropdown hierarchy box thingy, but the "Inbox" option is greyed out (side complaint: no user interface should ever have a greyed out option without providing an explanation as to why it's not available, and what you should do if you want it to be available. Displaying it like that is just cruelly teasing the user).
When I try to delete a folder, I get a dialog box saying "The current command did not succeed. The mail server responded: Mailbox doesn't exist: <name of folder>". This is pretty frustrating, because I can *see* the damn thing in thunderbird. (another side complaint: "The current command"? You're *running* the bloody command, you should have a better description than that!)
For some reason though, I can rename a folder with no problems.
I went into /var/log/ on the server, to see what was in the Dovecot log file about the server errors above, but there *is* no log file, nor anything in the syslog. That can't be good. How do you tell the sysadmin when there's a problem?
Does anyone have any suggestions for how I can fix this? And if possible, I want to fix this the Debian way, that is by modifying a debconf setting or a /etc/default file or something like that, so that when I upgrade Debian, or uninstall dovecot and then reinstall it, it'll be handled gracefully.
Thanks, Matthew Exon
Yes: interesting effect. When you create a folder with a trailing slash, the created folder is greyed out. You can then create subfolders in the greyed out folders by right clicking on them. I'd be interested to see where this functionality is documented :-/
So your explanation seems right, that I can't delete folders because the Trash folder can't have subfolders. It looks like Thunderbird does have some explicit support for the node/leaf model (the greyed out folder names), but this support is incomplete, because it doesn't recognise that this will make it impossible to delete a folder.
I guess using some other client to delete folders is a solution for that
- but what I really want to do is to enable INBOX and Trash to have subfolders, which must be a server-side thing. Anyone have a suggestion for that?
Josh Burley wrote:
I had the same problem. When creating a new folder that should contain subfolders, I appended a trailing /. This would enable the folder to contain subfolders. And only leaf nodes could contain messages.
Along that same line, Thunderbird was trying to put folders into the Trash folder upon deletion. Which wasn't allowed (as far as I can tell) because the Trash folder was a leaf node, and could only contain messages.
If I tried to delete a folder in Outlook, or a webmail client, it deleted it correctly.
.josh
Matthew Exon wrote:
Hi,
I've been using the dovecot IMAP server for about a year now, and basically it works. But there's an annoying problem, that I can't make any subfolders. I can only make folders that are at the same level as my INBOX folder. Worse, I can't delete folders once I've created them.
I'm using Debian unstable on both the server machine and my client machine. The dovecot version is 0.99.13. For my mail client, I'm using Mozilla Thunderbird version 1.0.
I've done a bit of investigation on my filesystem, and by googling for all kinds of stuff, but I'm really drawing a blank on this particular problem. Most of the general linux email documentation I've found either doesn't mention IMAP, or doesn't mention dovecot, or both. I can barely find any references to the concept of "subfolder" at all.
I really don't want to know anything about email servers, I just want the bloody thing to work. Trying to figure out what the hell's going on is really frustrating!On the server, I seem to have various mailboxes distributed around the place. I've got a mail box in /var/spool/mail. I've got a file ~/mbox, which seems to be very old and is therefore probably a red herring. I've also got a directory ~/Mail with a bunch of files in, one for each of my folders. Having some of my mail in /var/spool, and some in my home directory, seems a really horrible way of arranging things, but anyway...
Various online sources seem to suggest that maildir is better than mbox. I don't have any particular preference for one or the other, but I don't want to change if I don't have to because:
From experience, I don't screw with settings if I don't have to. Debian made it that way, and changing it behind Debian's back is a surefire way to cause trouble later.
Any other accounts on that machine (especially ones I might create in future) will probably still be mbox, causing even worse confusion later.
Porting mailboxes is always risky, and I don't want to lose my mail, or have incoming email dropped, or accidentally corrupt it, or anything like that.
So I'm not going to do any of that unless I'm sure that it's actually going to fix the subfolder problem, and until now I haven't found any information anywhere to guarantee that that's the case. Intuitively I can guess that if a folder is just a big file full of concatenated email, then making a subfolder is going to be pretty much impossible, but I don't want to guess here.
The actual symptoms in thunderbird are:
When I select "New folder...", I get the "Create as a subfolder of:" dropdown hierarchy box thingy, but the "Inbox" option is greyed out (side complaint: no user interface should ever have a greyed out option without providing an explanation as to why it's not available, and what you should do if you want it to be available. Displaying it like that is just cruelly teasing the user).
When I try to delete a folder, I get a dialog box saying "The current command did not succeed. The mail server responded: Mailbox doesn't exist: <name of folder>". This is pretty frustrating, because I can *see* the damn thing in thunderbird. (another side complaint: "The current command"? You're *running* the bloody command, you should have a better description than that!)
For some reason though, I can rename a folder with no problems.
I went into /var/log/ on the server, to see what was in the Dovecot log file about the server errors above, but there *is* no log file, nor anything in the syslog. That can't be good. How do you tell the sysadmin when there's a problem?
Does anyone have any suggestions for how I can fix this? And if possible, I want to fix this the Debian way, that is by modifying a debconf setting or a /etc/default file or something like that, so that when I upgrade Debian, or uninstall dovecot and then reinstall it, it'll be handled gracefully.
Thanks, Matthew Exon
Matthew Exon wrote:
Yes: interesting effect. When you create a folder with a trailing slash, the created folder is greyed out. You can then create subfolders in the greyed out folders by right clicking on them. I'd be interested to see where this functionality is documented :-/
So your explanation seems right, that I can't delete folders because the Trash folder can't have subfolders. It looks like Thunderbird does have some explicit support for the node/leaf model (the greyed out folder names), but this support is incomplete, because it doesn't recognise that this will make it impossible to delete a folder.
I guess using some other client to delete folders is a solution for that
- but what I really want to do is to enable INBOX and Trash to have subfolders, which must be a server-side thing. Anyone have a suggestion for that?
Well, the solution could be using Maildir instead of mbox as mail storage format. Since the traditional mbox format uses one file per mail folder, and one directory per subfolder, you can't keep both mail and folders in the same folder. (A folder is either a file containing mail or a directory containing other files and directories, but not both).
-- Magnus Holmgren holmgren@lysator.liu.se
Magnus Holmgren wrote:
Well, the solution could be using Maildir instead of mbox as mail storage format. Since the traditional mbox format uses one file per mail folder, and one directory per subfolder, you can't keep both mail and folders in the same folder. (A folder is either a file containing mail or a directory containing other files and directories, but not both).
OK, that was something I was considering - I just didn't know if it really would solve the problem. It raises a bunch of questions though:
Is there some system wide setting for this? I don't want to port my own mailboxes, and then have it be the same old mbox stuff for the next person I create an account for. A lot of the documentation sorta answers this, but it assumes you're setting up a brand new system, not trying to modify an existing one.
What's the best way to do this on a Debian system? Was there some setting I missed when I was setting up the box? I would much rather set a debconf setting than fool around inside a config file.
What's going to happen to /var/spool/mail? That looks like a mbox thing. I'd much rather have all my mail in one place, rather than in two places like now.
I installed mb2md, but then I got cold feet about whether it was likely to work or not, so I haven't run it yet...
Thanks for your help, Mat
Matthew Exon wrote:
Magnus Holmgren wrote:
Well, the solution could be using Maildir instead of mbox as mail storage format. Since the traditional mbox format uses one file per mail folder, and one directory per subfolder, you can't keep both mail and folders in the same folder. (A folder is either a file containing mail or a directory containing other files and directories, but not both).
OK, that was something I was considering - I just didn't know if it really would solve the problem. It raises a bunch of questions though:
- Is there some system wide setting for this? I don't want to port my own mailboxes, and then have it be the same old mbox stuff for the next person I create an account for. A lot of the documentation sorta answers this, but it assumes you're setting up a brand new system, not trying to modify an existing one.
Yes, it's a system wide setting, although you could override it by setting $MAIL somehow. See the example dovecot.conf. I have
default_mail_env = maildir:/var/mail/%u
which means that each user has his mail under /var/mail/ (and only there), but in Maildir format (which answers your second #2 question :-).
- What's the best way to do this on a Debian system? Was there some setting I missed when I was setting up the box? I would much rather set a debconf setting than fool around inside a config file.
I have told Exim to put incoming mail in Maildir format as above. It will then create the necessary directories, if you don't do it when you create new users. If you use some other (Maildir-capable) MTA/MDA, you should be able to configure it accordingly.
- What's going to happen to /var/spool/mail? That looks like a mbox thing. I'd much rather have all my mail in one place, rather than in two places like now.
I installed mb2md, but then I got cold feet about whether it was likely to work or not, so I haven't run it yet...
So in short, the most important part is to tell your MDA that you want mail delivered into maildirs (and of course where you want it). You also need to convert all mailboxes. I think Dovecot should be the least of your worries.
-- Magnus Holmgren holmgren@lysator.liu.se
Magnus Holmgren wrote:
So in short, the most important part is to tell your MDA that you want mail delivered into maildirs (and of course where you want it). You also need to convert all mailboxes. I think Dovecot should be the least of your worries.
I see what you mean. This is the downside of using properly modular software systems: I'm using Thunderbird to discover information about Dovecot which is misbehaving because of a subtle issue with Exim, and it's a real pain to figure out which piece is the real problem :-(
I think I'll cheerfully put off sorting all of this out until tomorrow. Thanks for your help!
Matthew Exon wrote:
- Is there some system wide setting for this? I don't want to port my own mailboxes, and then have it be the same old mbox stuff for the next person I create an account for. A lot of the documentation sorta answers this, but it assumes you're setting up a brand new system, not trying to modify an existing one.
There is for Dovecot... you may have to do other work to convince your LDA to do the same.
- What's the best way to do this on a Debian system? Was there some setting I missed when I was setting up the box? I would much rather set a debconf setting than fool around inside a config file.
To be honest, I've never looked at that. In fact, the only machines I've run IMAP servers on, to date, have been Solaris.
- What's going to happen to /var/spool/mail? That looks like a mbox thing. I'd much rather have all my mail in one place, rather than in two places like now.
In my case, I've told Postfix to deliver mail in Maildir format into '.imap' in the user's home dir. So, /var/spool/mail goes unused for me.
I installed mb2md, but then I got cold feet about whether it was likely to work or not, so I haven't run it yet...
Well, I'm all for migrating to Maildir. It made sense to me the first time I heard about it, and after seeing all the pain Timo and others have suffered trying to make mbox work, I'm sure I made the right choice.
-- Curtis Maloney
Curtis Maloney wrote:
Matthew Exon wrote:
- What's going to happen to /var/spool/mail? That looks like a mbox thing. I'd much rather have all my mail in one place, rather than in two places like now.
In my case, I've told Postfix to deliver mail in Maildir format into '.imap' in the user's home dir. So, /var/spool/mail goes unused for me.
By the way, the standard (FHS) location for mailboxes is /var/mail nowadays. So /var/spool/mail should go unused for everybody (unless, as is common, it's a symlink to /var/mail).
(http://www.pathname.com/fhs/pub/fhs-2.3.html#VARMAILUSERMAILBOXFILES)
-- Magnus Holmgren
Magnus Holmgren wrote:
By the way, the standard (FHS) location for mailboxes is /var/mail nowadays. So /var/spool/mail should go unused for everybody (unless, as is common, it's a symlink to /var/mail).
# ls -lhd /var/spool/mail lrwxrwxrwx 1 root root 7 2004-01-06 15:19 /var/spool/mail -> ../mail
Huh. Well there you go. You learn something every day I guess. Should only take me five or ten years to get used to that one :-)
On Thu, 2005-03-03 at 13:26 -0800, Josh Burley wrote:
Along that same line, Thunderbird was trying to put folders into the Trash folder upon deletion. Which wasn't allowed (as far as I can tell) because the Trash folder was a leaf node, and could only contain messages.
Server settings -> Advanced -> Uncheck "Server supports folders that contain sub-folders and messages" and then it works.
It'd be simple for Thunderbird to figure that out itself. Added to bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=284933
Hey yeah! Wow, that makes things go a little smoother. It's definitely a bug in Thunderbird, and thanks for submitting the bug report, but at least there's a switch. Now I remember why I use open source software :-)
Timo Sirainen wrote:
On Thu, 2005-03-03 at 13:26 -0800, Josh Burley wrote:
Along that same line, Thunderbird was trying to put folders into the Trash folder upon deletion. Which wasn't allowed (as far as I can tell) because the Trash folder was a leaf node, and could only contain messages.
Server settings -> Advanced -> Uncheck "Server supports folders that contain sub-folders and messages" and then it works.
It'd be simple for Thunderbird to figure that out itself. Added to bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=284933
Am 05.03.2005 um 23:02 Uhr +0200 schrieb Timo Sirainen:
Server settings -> Advanced -> Uncheck "Server supports folders that contain sub-folders and messages" and then it works.
It'd be simple for Thunderbird to figure that out itself. Added to bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=284933
Thanks for that one. I just voted for your bug. :)
hauke
-- /~\ The ASCII Ribbon Campaign Hauke Fath \ / No HTML/RTF in email Institut für Nachrichtentechnik X No Word docs in email TU Darmstadt / \ Respect for open standards Ruf +49-6151-16-3281
participants (6)
-
Curtis Maloney
-
Hauke Fath
-
Josh Burley
-
Magnus Holmgren
-
Matthew Exon
-
Timo Sirainen