[Dovecot] Dovecot + Vpopmail quota issues
I can't get dovecot to ignore a certain directory/namespace when
calculating quotas.
I am running dovecot 1.2.16 with vpopmail configured for quotas.
I use the dot (.) as my separator and my user structure is as follows:
../domain.com/user/Maildir for all the user directories
I also have for each user:
../domain.com/user/Maildir/Archive which is a symlink to a NFS
mounted partition that holds read-only archives
In dovecot.conf I have defined them as follows:
mail_location = maildir:~/Maildir
namespace private { separator = . prefix = ARCHIVE. inbox = no hidden = yes list = yes location = maildir:~/Maildir/Archive }
namespace private { separator = . prefix = inbox = yes }
This works very well, in as much as I see the Archive namespace and
its folders.
The problem arises in the fact that Dovecot insists on calculating the
'Archive' namespace/directory storage towards the total storage used.
My Quota configuration is as follows:
auth default { mechanisms = plain login digest-md5 cram-md5
passdb vpopmail { args = webmail=192.168.1.12 }
userdb vpopmail { args = quota_template=quota_rule3=*:backend=%q } ... }
plugin { quota = maildir quota_rule = ?:storage=0 quota_rule2 = Archive:ignore quota_rule3 = ARCHIVE:ignore }
From what I've read, this is supposed to use the maildirsize file
when available or otherwise return no quota. It worked just fine
before this new Archive namespace.
For a certain user, vpopmail writes the 'maildirsize' file in
../domain.com/user/Maildir/maildirsize and it contains the correct
value ( without the /Archive directory ).
The problem is that for some reason, something ( I suspect dovecot )
writes a new maildirsize file in
../domain.com/user/Maildir/Archive/maildirsize which also contains the
size of Archive. Subsequently, Dovecot adds the two of them up and
usually throws me over quota.
To test, I have emptied the maildirsize file under Archive and changed
its owner to root (perms are 755 ) so that nobody but root can write
to it. Dovecot complained right away about it:
Jul 19 12:55:21 pop1 dovecot: IMAP(user@domain.com):
open(/home/vpopmail/domains/B/domain.com/user/Maildir/Archive/maildirsize)
failed: Permission denied
Despite passing the quota responsibility to vpopmail it seems that
Dovecot still tries to update that file.
And finally the question... How do I get dovecot to not calculate a
quota for that directory/namespace ?
I made a bit of headway but not too much.
I discovered that the order of the namespaces is very important.
The reason why dovecot was updating the maildirsize file under Archive
was because the Archive namespace was defined first.
I now define the root inbox first and Archive second and dovecot
properly updates the same maildirsize file as vpopmail in
domain.com/user/Maildir/maildirsize
However, there are two key differences still:
Vpopmail does not calculate the storage under
domain.com/user/Maildir/Archive when it updates the maildirsize file.
This is exactly what I want. Vpopmail reports the proper size.Dovecot DOES calculate the storage taken up by:
domain.com/user/Maildir/Archive despite the fact that '/' is not my
default separator.
I think vpopmail acts properly and calculates the file sizes in
properly formatted maildirs.
For some reason dovecot does not .. or am I wrong ?
I've tried many configs to get dovecot to ignore the Archive folder
but none of them works. The only thing that works is if I specifically
write the name of each folder in the quota ignore definitions.
If my structure is as follows:
domain.com/user/Maildir/Archive/.Folder1/cur domain.com/user/Maildir/Archive/.Folder1/new domain.com/user/Maildir/Archive/.Folder1/tmp
Folder1 is a proper maildir and Archive is a \NoSelect folder.
I want dovecot quota to ignore ALL the possible folders under Archive
without mentioning them one by one.
This works for example:
quota = maildir quota_rule = ?:storage=0 quota_rule2 = Folder1:ignore
This does not:
quota = maildir quota_rule = ?:storage=0 quota_rule2 = Archive:ignore
How can I get dovecot to ignore the quota for all the possible folders
under Archive ?
is different fr Quoting qmail@top-consulting.net:
I can't get dovecot to ignore a certain directory/namespace when
calculating quotas.I am running dovecot 1.2.16 with vpopmail configured for quotas.
I use the dot (.) as my separator and my user structure is as follows:
../domain.com/user/Maildir for all the user directories
I also have for each user:
../domain.com/user/Maildir/Archive which is a symlink to a NFS
mounted partition that holds read-only archivesIn dovecot.conf I have defined them as follows:
mail_location = maildir:~/Maildir
namespace private { separator = . prefix = ARCHIVE. inbox = no hidden = yes list = yes location = maildir:~/Maildir/Archive }
namespace private { separator = . prefix = inbox = yes }
This works very well, in as much as I see the Archive namespace and
its folders.The problem arises in the fact that Dovecot insists on calculating
the 'Archive' namespace/directory storage towards the total storage
used.My Quota configuration is as follows:
auth default { mechanisms = plain login digest-md5 cram-md5
passdb vpopmail { args = webmail=192.168.1.12 }
userdb vpopmail { args = quota_template=quota_rule3=*:backend=%q } ... }
plugin { quota = maildir quota_rule = ?:storage=0 quota_rule2 = Archive:ignore quota_rule3 = ARCHIVE:ignore }
From what I've read, this is supposed to use the maildirsize file
when available or otherwise return no quota. It worked just fine
before this new Archive namespace.For a certain user, vpopmail writes the 'maildirsize' file in
../domain.com/user/Maildir/maildirsize and it contains the correct
value ( without the /Archive directory ).The problem is that for some reason, something ( I suspect dovecot )
writes a new maildirsize file in
../domain.com/user/Maildir/Archive/maildirsize which also contains
the size of Archive. Subsequently, Dovecot adds the two of them up
and usually throws me over quota.To test, I have emptied the maildirsize file under Archive and
changed its owner to root (perms are 755 ) so that nobody but root
can write to it. Dovecot complained right away about it:Jul 19 12:55:21 pop1 dovecot: IMAP(user@domain.com):
open(/home/vpopmail/domains/B/domain.com/user/Maildir/Archive/maildirsize)
failed: Permission deniedDespite passing the quota responsibility to vpopmail it seems that
Dovecot still tries to update that file.And finally the question... How do I get dovecot to not calculate a
quota for that directory/namespace ?
I've done it. Thank you list for letting me bounce my ideas off you :)
This stuff should be documented somewhere and save someone else a lot of work.
Here are the crucial steps you need to remember.
Namespace order is very important in the config file. Always keep
your default namespace first since that's where the maildirsize file
will be createdYou have to define the quota rules for your main namespace which is
usually defined like so:
namespace private { separator = . prefix = inbox = yes }
To assign quota only to this namespace, you have to use this line: quota = maildir:User Space:ns=
The important part is the "ns="
Usually something follows after the = sign but since our default
namespace has no name we have to leave it empty. Took me a lot of
trial & error to figure this out.
Quoting qmail@top-consulting.net:
I made a bit of headway but not too much.
I discovered that the order of the namespaces is very important.
The reason why dovecot was updating the maildirsize file under
Archive was because the Archive namespace was defined first.I now define the root inbox first and Archive second and dovecot
properly updates the same maildirsize file as vpopmail in
domain.com/user/Maildir/maildirsizeHowever, there are two key differences still:
Vpopmail does not calculate the storage under
domain.com/user/Maildir/Archive when it updates the maildirsize
file. This is exactly what I want. Vpopmail reports the proper size.Dovecot DOES calculate the storage taken up by:
domain.com/user/Maildir/Archive despite the fact that '/' is not my
default separator.I think vpopmail acts properly and calculates the file sizes in
properly formatted maildirs.For some reason dovecot does not .. or am I wrong ?
I've tried many configs to get dovecot to ignore the Archive folder
but none of them works. The only thing that works is if I
specifically write the name of each folder in the quota ignore
definitions.If my structure is as follows:
domain.com/user/Maildir/Archive/.Folder1/cur domain.com/user/Maildir/Archive/.Folder1/new domain.com/user/Maildir/Archive/.Folder1/tmp
Folder1 is a proper maildir and Archive is a \NoSelect folder.
I want dovecot quota to ignore ALL the possible folders under
Archive without mentioning them one by one.This works for example:
quota = maildir quota_rule = ?:storage=0 quota_rule2 = Folder1:ignore
This does not:
quota = maildir quota_rule = ?:storage=0 quota_rule2 = Archive:ignore
How can I get dovecot to ignore the quota for all the possible
folders under Archive ?is different fr Quoting qmail@top-consulting.net:
I can't get dovecot to ignore a certain directory/namespace when
calculating quotas.I am running dovecot 1.2.16 with vpopmail configured for quotas.
I use the dot (.) as my separator and my user structure is as follows:
../domain.com/user/Maildir for all the user directories
I also have for each user:
../domain.com/user/Maildir/Archive which is a symlink to a NFS
mounted partition that holds read-only archivesIn dovecot.conf I have defined them as follows:
mail_location = maildir:~/Maildir
namespace private { separator = . prefix = ARCHIVE. inbox = no hidden = yes list = yes location = maildir:~/Maildir/Archive }
namespace private { separator = . prefix = inbox = yes }
This works very well, in as much as I see the Archive namespace and
its folders.The problem arises in the fact that Dovecot insists on calculating
the 'Archive' namespace/directory storage towards the total storage
used.My Quota configuration is as follows:
auth default { mechanisms = plain login digest-md5 cram-md5
passdb vpopmail { args = webmail=192.168.1.12 }
userdb vpopmail { args = quota_template=quota_rule3=*:backend=%q } ... }
plugin { quota = maildir quota_rule = ?:storage=0 quota_rule2 = Archive:ignore quota_rule3 = ARCHIVE:ignore }
From what I've read, this is supposed to use the maildirsize file
when available or otherwise return no quota. It worked just fine
before this new Archive namespace.For a certain user, vpopmail writes the 'maildirsize' file in
../domain.com/user/Maildir/maildirsize and it contains the correct
value ( without the /Archive directory ).The problem is that for some reason, something ( I suspect dovecot
) writes a new maildirsize file in
../domain.com/user/Maildir/Archive/maildirsize which also contains
the size of Archive. Subsequently, Dovecot adds the two of them up
and usually throws me over quota.To test, I have emptied the maildirsize file under Archive and
changed its owner to root (perms are 755 ) so that nobody but root
can write to it. Dovecot complained right away about it:Jul 19 12:55:21 pop1 dovecot: IMAP(user@domain.com):
open(/home/vpopmail/domains/B/domain.com/user/Maildir/Archive/maildirsize)
failed: Permission deniedDespite passing the quota responsibility to vpopmail it seems that
Dovecot still tries to update that file.And finally the question... How do I get dovecot to not calculate a
quota for that directory/namespace ?
participants (1)
-
qmail@top-consulting.net