[Dovecot] Re: Bug#224092: Dovecot IMAP: detection of folders
On Tue, 16 Dec 2003, Jeroen van Disseldorp wrote:
Package: dovecot-imapd Version: 0.99.10.4-2 Severity: normal
When accessing a maildir with "all folders" instead of "only subscribed folders", dovecot wrongfully reports its index-files (.imap.*) as mail folders. When the client (KMail 1.5.2 in my case) checks for email, it aborts halfway with the message:
Unable to get information about folder imap.index. The server replied: Internal error [2003-12-15 23:53:05]
I noticed the same thing with the .subscription-file, but that seems to have disappeared after a reinstall of dovecot*. Squirrelmail, which only checks subscribed folders, has no problems.
The problem started with the last upgrade from 0.99.10.4-1 to -2. -1 was working fine. I am using Debian GNU/Linux unstable (fully updated) with kernel 2.4.18-686.
I don't think the problem was caused by the upgrade as I only changed one Debian dependency.
I am Cc'ing the Dovecot mailing list to see if the developer or anyone else has some insight into this.
-- Jaldhar H. Vyas jaldhar@debian.org La Salle Debain - http://www.braincells.com/debian/
On Dienstag, 16. Dezember 2003 06:26, Jaldhar H. Vyas wrote:
When accessing a maildir with "all folders" instead of "only subscribed folders", dovecot wrongfully reports its index-files (.imap.*) as mail folders. When the client (KMail 1.5.2 in my case) checks for email, it aborts halfway with the message: I don't think the problem was caused by the upgrade as I only changed one Debian dependency.
I'm using the mentioned dovecot package and kMail 1.5.4 from Debian SID and saw no problems so far. I currently only have a pretty small mailbox running with dovecot 0.99.10.4-2 however, as my main personal mailserver is still at 0.99.10.2.
Greetings,
Gunter
On Tue, 2003-12-16 at 07:26, Jaldhar H. Vyas wrote:
When accessing a maildir with "all folders" instead of "only subscribed folders", dovecot wrongfully reports its index-files (.imap.*) as mail folders. When the client (KMail 1.5.2 in my case) checks for email, it aborts halfway with the message:
This shouldn't happen normally. By default INBOX's indexes are stored inside .INBOX/ directory. If you have .imap/ directory in root Maildir, you had changed some settings in a way that's not really supported. Such as setting INBOX=~/Maildir in default_mail_env?
On Tue, 2003-12-16 at 07:26, Jaldhar H. Vyas wrote: This shouldn't happen normally. By default INBOX's indexes are stored inside .INBOX/ directory. If you have .imap/ directory in root Maildir, you had changed some settings in a way that's not really supported. Such as setting INBOX=~/Maildir in default_mail_env?
Ah, maybe that's it then: I use a logical link "INBOX -> ." as KMail and SquirrelMail differ on what the actual INBOX is. One thinks that it's the Maildir itself, the other expects an INBOX-folder. I can't seem to make them agree...
Would it be hard to ignore .imap.index-files in the root of the Maildir? After all, they are files, not folders. Or does this go against the definition of the Maildir-format?
Regards, Jeroen
On Wed, 17 Dec 2003, Jeroen van Disseldorp wrote:
On Tue, 2003-12-16 at 07:26, Jaldhar H. Vyas wrote: This shouldn't happen normally. By default INBOX's indexes are stored inside .INBOX/ directory. If you have .imap/ directory in root Maildir, you had changed some settings in a way that's not really supported. Such as setting INBOX=~/Maildir in default_mail_env?
Ah, maybe that's it then: I use a logical link "INBOX -> ." as KMail and SquirrelMail differ on what the actual INBOX is. One thinks that it's the Maildir itself, the other expects an INBOX-folder. I can't seem to make them agree...
Would it be hard to ignore .imap.index-files in the root of the Maildir? After all, they are files, not folders. Or does this go against the definition of the Maildir-format?
IMO, the .INBOX directory and symlink "INBOX -> ." are artefacts of a misunderstanding of the mapping of IMAP folder objects to maildirs. Perhaps that's a carry over from Courier. I'd certainly be interested to hear the history and/or justification from Timo.
Where you have "INBOX=~/Maildir", then the inbox *should* be ~/Maildir, not ~/Maildir/.INBOX as it is at present. RFC2060 says "the case-insensitive mailbox name INBOX is a special name reserved to mean "the primary mailbox for this user on this server". But I see no reason why there should be a maildir actually called "INBOX" (or ".INBOX", following the hidden "." prefix convention). That just seems extra code, and more chance of confusion.
Ah, I've just noticed this in TODO:
...
- remove Maildir/.INBOX/ ...
-- Charlie
On Thu, 2003-12-18 at 21:55, Charlie Brady wrote:
Ah, I've just noticed this in TODO:
...
- remove Maildir/.INBOX/ ...
.INBOX/ contains only Dovecot's indexes. The original reason why I created it didn't actually work (atomic "RENAME INBOX xyz" command) but I left it.. Current reason is mostly so that I can hide the index files in there from polluting the ".imap" namespace.
On Sat, 20 Dec 2003, Timo Sirainen wrote:
On Thu, 2003-12-18 at 21:55, Charlie Brady wrote:
Ah, I've just noticed this in TODO:
...
- remove Maildir/.INBOX/ ...
.INBOX/ contains only Dovecot's indexes. The original reason why I created it didn't actually work (atomic "RENAME INBOX xyz" command) but
I see why you might want that. I'd guess this wouldn't work if .INBOX were a symlink to '.'.
I left it.. Current reason is mostly so that I can hide the index files in there from polluting the ".imap" namespace.
And that wouldn't work with the symlink either :-)
-- Charlie
Jeroen van Disseldorp wrote:
Would it be hard to ignore .imap.index-files in the root of the Maildir? After all, they are files, not folders. Or does this go against the definition of the Maildir-format?
You could use something like: default_mail_env = maildir:/var/spool/imap/%u:INDEX=/var/spool/imapidx/%u which would put the index files in their own directory.
Sven
On Wed, 2003-12-17 at 13:27, Jeroen van Disseldorp wrote:
On Tue, 2003-12-16 at 07:26, Jaldhar H. Vyas wrote: This shouldn't happen normally. By default INBOX's indexes are stored inside .INBOX/ directory. If you have .imap/ directory in root Maildir, you had changed some settings in a way that's not really supported. Such as setting INBOX=~/Maildir in default_mail_env?
Ah, maybe that's it then: I use a logical link "INBOX -> ." as KMail and SquirrelMail differ on what the actual INBOX is. One thinks that it's the Maildir itself, the other expects an INBOX-folder. I can't seem to make them agree...
Well, you shouldn't need to do that. It's most likely because either one of them thinks everything is under "INBOX.". Squirrelmail at least can be configured not to do that (/etc/squirrelmail/conf.pl).
Would it be hard to ignore .imap.index-files in the root of the Maildir? After all, they are files, not folders. Or does this go against the definition of the Maildir-format?
Well.. I could check it but.. It's kind of annoying to add special cases for them. Currently I just list everything that begins with '.' with two hardcoded exceptions: .subscriptions and .customflags. I do plan to change the file and directory names to "dovecot-subscriptions", "dovecot-customflags" and "dovecot-indexes" (or similiar). Then there would be no namespace conflicts.
If I did add special check for ".imap", it would mean that you couldn't create a root folder called "imap" which I think some people might actually do.
On Saturday 20 December 2003 04:40, Timo Sirainen wrote:
If I did add special check for ".imap", it would mean that you couldn't create a root folder called "imap" which I think some people might actually do.
I understand. However, making a simple check for being a file or directory wouldn't harm anyone. As .subscriptions, .customflags and .imap* are all files, interpreting them as folders would generate errors anyhow. If .imap* is somehow renamed to .whatever or dovecot-whatever, the check would still hold as files would never be interpreted as mail folders.
Regards, Jeroen mailto:jdizzl@xs4all.nl
There is nothing wrong with Windows 2000... ...that Linux can't fix.
On Sat, 20 Dec 2003, Jeroen van Disseldorp wrote:
On Saturday 20 December 2003 04:40, Timo Sirainen wrote:
If I did add special check for ".imap", it would mean that you couldn't create a root folder called "imap" which I think some people might actually do.
I understand. However, making a simple check for being a file or directory wouldn't harm anyone.
It would cost a stat per file/directory, which Timo has tried to avoid (for performance reasons, AIUI). Are folders enumerated often enough and the cost high enough that it is an important optimisation?
-- Charlie
On Dec 20, 2003, at 6:11 PM, Charlie Brady wrote:
I understand. However, making a simple check for being a file or directory wouldn't harm anyone.
It would cost a stat per file/directory, which Timo has tried to avoid (for performance reasons, AIUI). Are folders enumerated often enough and the cost high enough that it is an important optimisation?
Maybe not that important, but it's rather useless to stat() them.
I have plans actually for creating a single mailbox index file per user which could be used to get all information for LIST and STATUS commands. That will be a nice optimization :)
On Dec 20, 2003, at 2:20 PM, Jeroen van Disseldorp wrote:
On Saturday 20 December 2003 04:40, Timo Sirainen wrote:
If I did add special check for ".imap", it would mean that you couldn't create a root folder called "imap" which I think some people might actually do.
I understand. However, making a simple check for being a file or directory wouldn't harm anyone. As .subscriptions, .customflags and .imap* are all files, interpreting them as folders would generate errors anyhow. If .imap* is somehow renamed to .whatever or dovecot-whatever, the check would still hold as files would never be interpreted as mail folders.
It would hurt performance with very little gain. Now I can just do it all with opendir() and readdir() which is usually 2-3 syscalls. If I wanted to know if each entry is file or directory, I'd have to call stat() for each entry. This could be done for those few special cases I guess, but I wouldn't add it for everything..
On Sat, 20 Dec 2003 17:47:20, Timo Sirainen wrote:
On Dec 20, 2003, at 2:20 PM, Jeroen van Disseldorp wrote:
On Saturday 20 December 2003 04:40, Timo Sirainen wrote:
If I did add special check for ".imap", it would mean that you couldn't create a root folder called "imap" which I think some people might actually do.
I understand. However, making a simple check for being a file or directory wouldn't harm anyone. As .subscriptions, .customflags and .imap* are all files, interpreting them as folders would generate errors anyhow. If .imap* is somehow renamed to .whatever or dovecot-whatever, the check would still hold as files would never be interpreted as mail folders.
It would hurt performance with very little gain. Now I can just do it all with opendir() and readdir() which is usually 2-3 syscalls. If I wanted to know if each entry is file or directory, I'd have to call stat() for each entry. This could be done for those few special cases I guess, but I wouldn't add it for everything..
Modern filesystems return more info from readdir() than just the filename. Check out the d_type field of the direct struct. If it's DT_REG it's a file; it it's DT_DIR it's a directory; if it's DT_UNKNOWN the file system doesn't support it and you have to do a stat().
Mike.
participants (7)
-
Charlie Brady
-
Gunter Ohrner
-
Jaldhar H. Vyas
-
Jeroen van Disseldorp
-
Miquel van Smoorenburg
-
Sven Kirmess
-
Timo Sirainen