[Dovecot] still having difficulties with per-user quotas

Daniel Parthey daniel.parthey at informatik.tu-chemnitz.de
Sun Oct 21 23:49:19 EEST 2012


Hi Dave,

David Mehler wrote:
> Thanks for all your help so far. I have per-user quotas now working, I
> had to also alter my dict config file as well. I am having two
> outstanding issues, actually one outstanding issue and one question.
> 
> Here's the question, given that the userdb sql query returns a default
> quota entry for rows of zero in quota and quota_messages is the
> default quota section needed in 90-quota.conf?
>
> plugin {
>   quota_rule = *:storage=1G
>   quota_rule2 = Trash:storage=+100M
> }

You need quota_rule2 to give the user some additional space
in the Trash folder if he/she wants to delete messages when over quota.
The dict is also needed for quota lookup from the database.

The only thing which might be omitted is the global quota_rule
since it is returned by the userdb/passwd in any case, but I'm
not sure what happens if you only configure a "quota_rule2" without
configuring a "quota_rule".

> My outstanding issue is whenever I as the root mysql user update a
> user's quota the other user also gets an update, I noticed with one
> the messages column on the other user went from 0 to 2, another time
> the quota value went up from 0 to 3500 it seems random.

You should not be accounting the actual mailbox usage in the
same virtual_users table as the quota is read from.

Use *different* column or table name in your dict file
where dovecot may write the current storage/message count.

> dovecot-dict-sql.conf.ext
> 
> map {
>   pattern = priv/quota/storage
>   table = virtual_users
>   username_field = user
>   value_field = quota
value_field should be current_quota_storage (writable column)

> }
> map {
>   pattern = priv/quota/messages
>   table = virtual_users
>   username_field = user
>   value_field = quota_messages
value_field should be current_quota_messages (writable column)

> I'd like to know why these columns are updating.

Dovecot stores the current storage and mailcount in there.
These columns should be different from the columns defining the maximum limit.

Regards
Daniel



More information about the dovecot mailing list