On 12 February 2019 at 20:52 Robert Moskowitz via dovecot < dovecot@dovecot.org> wrote:




On 2/12/19 1:03 PM, Aki Tuomi via dovecot wrote:
>> On 12 February 2019 at 19:55 Robert Moskowitz via dovecot < dovecot@dovecot.org> wrote:
>>
>>
>>
>>
>> On 2/12/19 12:38 PM, Aki Tuomi via dovecot wrote:
>>>> On 12 February 2019 at 18:23 Robert Moskowitz via dovecot < dovecot@dovecot.org> wrote:
>>>>
>>>>
>>>> Does dovecot compute that values for quota2 with each email it updates
>>>> for the user?  Or only an incremental change?
>>>>
>>>> I ask because I am looking at migrating all the user mail from the old
>>>> server to the new and building a new sql database.  All I see is:
>>>>
>>>> dovecot-dict-sql.conf.ext: connect = host=/var/lib/mysql/mysql.sock
>>>> dbname=postfix user=postfix password=$Postfix_Database_Password map {
>>>> pattern = priv/quota/storage table = quota2 username_field = username
>>>> value_field = bytes } map { pattern = priv/quota/messages table = quota2
>>>> username_field = username value_field = messages }
>>>>
>>>>
>>>> what is actually done with this table?
>>>>
>>>> thanks
>>>>
>>>>
>>>>
>>>>
>>>>
>>> dict-sql converts the mappings into SQL statements.
>> But does dovecot check out the current bytes used and # of messages and
>> resets quota2, or only uses this latest operation (add message, delete
>> message...) to adjust quota2?
>>
>> If the later how to reset quota2 to the current reality?
>>
>> thanks
>>
Dovecot keeps the quota current, although dict quota has been known to be bit bad at this.
We nowadays recommend using count quota instead and use quota_clone to copy the quota state to database. It is more accurate.
And how is this recommendation implemented?

All I have are my old notes and what google is finding for me...

Please give me some pointers.

thanks

https://wiki.dovecot.org/Quota/Count
https://wiki.dovecot.org/Plugins/QuotaClone

and the recommendation is under

https://wiki.dovecot.org/Quota
---
Aki Tuomi