[Dovecot] maildir++ specification compliance.
Hi folks.
I was doing some testing this morning and realized Dovecot RC2 isn't fully compliant with the maildir++ specification.
Most notably, it appears that Dovecot isn't creating a "maildirfolder" file (0 byte length) in folders it creates.
From http://www.inter7.com/courierimap/README.maildirquota.html
"Within each subdirectory there's an empty file, maildirfolder. Its existence tells the mail delivery agent that this Maildir is a really a folder underneath a parent Maildir++."
and
"Make sure to create the maildirfolder file in any new folders created within the Maildir++."
Also, GETQUOTAROOT on a folder (with messages in it) will always return the entire usage, not the usage in the folder itself. For example:
INBOX - really has 100 mb of messages. Sent - has a few messages totalling 1mb. Drafts - no messages
A GETQUOTAROOT on INBOX will return 101 mb, 100mb for INBOX and 1mb for Sent. Drafts will show zero, because there's nothing. Unfortunately, Sent will also show 101 mb, not 1mb.
While Dovecot shouldn't be creating maildirsize files in each folder (the maildirfolder file is there to tell clients to look in .. for a maildirsize) ... it should still be able to answer queries about the number of messages (count of files in the folder) as well as the total size of all messages in that folder (sum of S=xxxx or by stat() on individual message files).
Steve
Apps Lists schreef:
I was doing some testing this morning and realized Dovecot RC2 isn't fully compliant with the maildir++ specification.
Most notably, it appears that Dovecot isn't creating a "maildirfolder" file (0 byte length) in folders it creates.
From http://www.inter7.com/courierimap/README.maildirquota.html
"Within each subdirectory there's an empty file, maildirfolder. Its existence tells the mail delivery agent that this Maildir is a really a folder underneath a parent Maildir++." Yeah, noticed this too. The .dovecot.sieve file in my maildir is recognized as a folder when I open my subscription dialog :).
While Dovecot shouldn't be creating maildirsize files in each folder (the maildirfolder file is there to tell clients to look in .. for a maildirsize) ... it should still be able to answer queries about the number of messages (count of files in the folder) as well as the total size of all messages in that folder (sum of S=xxxx or by stat() on individual message files). Actually this behaviour of dovecot is correct. All (maildir) folders currently belong to the same quotaroot and therefore dovecot will report the same quota for each folder you query within the same storage. By the looks of it, the current quota plugin does support various quota roots in general, but the maildir-storage-quota implementation does not.
I gave this some thought in the past. You could add support for multiple quota roots to the Maildir specification. The problem is that other mail programs won't support it. If this is implemented, one is (at least initially) forced to use the dovecot-lda. One way to implement this is by managing a separate maildirsize (e.g. maildirsize.SOMEROOT) file for each quotaroot and putting some other file(s) in the maildir specifying the structure of the maildir regarding the quotaroot membership of the different folders. If this is specified properly we could possibly persuade other mail software to support this new feature.
(BTW, stat()'ing or summing the S=xxx names of the files is a relatively slow process and that is why the maildirsize file was concieved in the first place. So, this would not be a very good idea.)
One could even combine this new feature with the trash expire functionality; give folders like 'Trash', 'Junk' or 'Spam' their own distinct quotaroot and perform the deletion if the root goes over quota. Using the IMAP protocol one could configure this such that the users can set their own Trash quota voluntarily (giving them no power over their overall quota).
Regards,
Stephan
Stephan Bosch wrote:
Yeah, noticed this too. The .dovecot.sieve file in my maildir is recognized as a folder when I open my subscription dialog :).
The .dovecot.sieve file shouldn't be inside your Maildir in the first place; it should be a peer of it instead:
drwx------ 4 vpopmail vchkpw 184 2006-07-13 14:01 . drwx------ 48 vpopmail vchkpw 1328 2006-07-07 16:11 .. lrwxrwxrwx 1 vpopmail vchkpw 24 2006-07-13 13:59 .dovecot.sieve -> sieve/mailinglists.sieve -rw------- 1 vpopmail vchkpw 264 2006-07-13 14:01 .dovecot.sievec drwx------ 14 vpopmail vchkpw 640 2006-07-14 16:06 Maildir -rw-r--r-- 1 vpopmail vchkpw 60 2006-07-07 16:12 .qmail drwx------ 3 vpopmail vchkpw 144 2006-07-13 13:58 sieve
Did you manually introduce a .dovecot.sieve inside your Maildir? Does that do anything? I've confirmed that a script like the above does work correctly...
John
-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
John Peacock schreef:
Stephan Bosch wrote:
Yeah, noticed this too. The .dovecot.sieve file in my maildir is recognized as a folder when I open my subscription dialog :).
The .dovecot.sieve file shouldn't be inside your Maildir in the first place; it should be a peer of it instead:
drwx------ 4 vpopmail vchkpw 184 2006-07-13 14:01 . drwx------ 48 vpopmail vchkpw 1328 2006-07-07 16:11 .. lrwxrwxrwx 1 vpopmail vchkpw 24 2006-07-13 13:59 .dovecot.sieve -> sieve/mailinglists.sieve -rw------- 1 vpopmail vchkpw 264 2006-07-13 14:01 .dovecot.sievec drwx------ 14 vpopmail vchkpw 640 2006-07-14 16:06 Maildir -rw-r--r-- 1 vpopmail vchkpw 60 2006-07-07 16:12 .qmail drwx------ 3 vpopmail vchkpw 144 2006-07-13 13:58 sieve
Did you manually introduce a .dovecot.sieve inside your Maildir? Does that do anything? I've confirmed that a script like the above does work correctly... Haven't tested the script with dovecot-lda yet, so it might just reside in the wrong place. :)
The managesieve patch places the .dovecot.sieve file inside the specified CONTROL directory and if that is unspecified it is placed in the root of the maildir itself. Normally this would not be a problem, but since dovecot does not use a maildirfolder file and does not check whether the 'folder' is a directory at all it is simply listed in the subscription dialog of my mail software:
xi:/home/test/Maildir# ls -la total 32 drwx--S--- 7 mail mail 4096 2006-07-14 23:23 . drwxr-sr-x 3 mail mail 82 2006-07-12 16:35 .. drwx--S--- 2 mail mail 6 2006-07-08 12:21 cur -rw------- 1 mail mail 144 2006-07-08 12:22 dovecot.index -rw------- 1 mail mail 10272 2006-07-08 12:22 dovecot.index.cache -rw------- 1 mail mail 104 2006-07-08 12:22 dovecot.index.log -rw------- 1 mail mail 1436 2006-07-13 04:15 dovecot.index.thread lrwxrwxrwx 1 mail mail 16 2006-07-13 23:21 .dovecot.sieve -> sieve/ingo.sieve drwx--S--- 2 mail mail 6 2006-07-08 12:21 new drwx--S--- 3 mail mail 56 2006-07-14 01:14 sieve -rw------- 1 mail mail 6 2006-07-14 02:22 subscriptions drwx--S--- 2 mail mail 6 2006-07-08 12:21 tmp drwx--S--- 5 mail mail 36 2006-07-14 02:22 .Trash
Manual IMAP:
3243 OK Logged in. 2323 LIST "" "*"
- LIST (\HasNoChildren) "." "dovecot.sieve"
- LIST (\HasNoChildren) "." "Trash"
- LIST (\HasNoChildren) "." "INBOX" 2323 OK List completed.
Regards,
Stephan.
On Fri, 2006-07-14 at 15:33 -0400, Apps Lists wrote:
Hi folks.
I was doing some testing this morning and realized Dovecot RC2 isn't fully compliant with the maildir++ specification.
Most notably, it appears that Dovecot isn't creating a "maildirfolder" file (0 byte length) in folders it creates.
Yes, I kind of hated that file from the beginning and hoped never to see it. But I guess I could create it when new mailboxes are created, but that's all I'm going to do with it.
Also, GETQUOTAROOT on a folder (with messages in it) will always return the entire usage, not the usage in the folder itself.
Like someone else already replied, quota roots are a different thing. Dovecot v1.0 supports only one quota root, the CVS HEAD supports multiple (although the quota backends don't really). Typically they could be eg. "user quota" and "domain quota".
participants (4)
-
Apps Lists
-
John Peacock
-
Stephan Bosch
-
Timo Sirainen