Re: Maintaining table quota2

2019-02-13 Thread Robert Moskowitz via dovecot




On 2/13/19 6:51 PM, Benny Pedersen via dovecot wrote:

Robert Moskowitz via dovecot skrev den 2019-02-14 00:22:


Am I 'getting it'?


15- is loaded before 20-

check dovecot -n always gives wanted results

Yes, that I see.  But local.conf is loaded after 15- and 20-.  If any of 
these have a mail-plugins line (All such lines are commented out in the 
default conf.d directory, though), would any 'global' setting of 
mail_plugins in local.conf be applied?


I am guessing not, as it would come too late in the conf processing.

Of course CURRENTLY, all mail_plugins lines in the conf.d directory ARE 
just comments.





Re: Maintaining table quota2

2019-02-13 Thread Benny Pedersen via dovecot

Robert Moskowitz via dovecot skrev den 2019-02-14 00:22:


Am I 'getting it'?


15- is loaded before 20-

check dovecot -n always gives wanted results


Re: Maintaining table quota2

2019-02-13 Thread Robert Moskowitz via dovecot

More on 'global' local section:

If there was
!include_try global_local.conf

before the

!include_try local.conf

It would have things like:

#    dovecot.conf
protocols = imap pop3 lmtp sieve
dict {
    sqlquota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
}



On 2/13/19 1:51 AM, Aki Tuomi wrote:



On 13.2.2019 2.02, Robert Moskowitz via dovecot wrote:



On 2/12/19 1:57 PM, Aki Tuomi wrote:


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:
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


I have been spending effort today reading up on this and searching on 
a couple questions.


For my additions to 20-imap.conf I have:

imap_client_workarounds = delay-newmail
protocol imap {
    mail_plugins = quota imap_quota trash
}

I see that the mail_plugin quota is moved to 10-mail.conf.  No biggie 
there.  But what about trash?


And I tried to find documentation on imap_client_workarounds and all 
I have found is in:


https://wiki.dovecot.org/QuickConfiguration#Client_Workarounds

"Check imap_client_workarounds and pop3_client_workarounds and see if 
you want to enable more of them than the defaults. ?


With no link about where to learn more.

Where does quota count go?  Just dovecot.conf or one of the numbered 
conf addtions?


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

Also is there a way to compute the count for all users?  I am 
migrating the maildir and rebuilding the sql database.  I see:


doveadm mailbox status -u user@domain vsize '*'

But do I do that for each user in each domain or is that '*' there to 
run it on all users?


I think this will get me started.





You probably should configure quota plugin globally, if you want 
LMTP/LDA deliveries to update quota.


The quota count can be recalculated with doveadm quota recalc

Aki





Re: Maintaining table quota2

2019-02-12 Thread Aki Tuomi via dovecot

On 13.2.2019 2.02, Robert Moskowitz via dovecot wrote:
>
>
> On 2/12/19 1:57 PM, Aki Tuomi wrote:
>>
>>> 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:
>>> 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
>
> I have been spending effort today reading up on this and searching on
> a couple questions.
>
> For my additions to 20-imap.conf I have:
>
> imap_client_workarounds = delay-newmail
> protocol imap {
>     mail_plugins = quota imap_quota trash
> }
>
> I see that the mail_plugin quota is moved to 10-mail.conf.  No biggie
> there.  But what about trash?
>
> And I tried to find documentation on imap_client_workarounds and all I
> have found is in:
>
> https://wiki.dovecot.org/QuickConfiguration#Client_Workarounds
>
> "Check imap_client_workarounds and pop3_client_workarounds and see if
> you want to enable more of them than the defaults. ?
>
> With no link about where to learn more.
>
> Where does quota count go?  Just dovecot.conf or one of the numbered
> conf addtions?
>
> https://wiki.dovecot.org/Quota/Count
>
> Also is there a way to compute the count for all users?  I am
> migrating the maildir and rebuilding the sql database.  I see:
>
> doveadm mailbox status -u user@domain vsize '*'
>
> But do I do that for each user in each domain or is that '*' there to
> run it on all users?
>
> I think this will get me started.
>
>
>

You probably should configure quota plugin globally, if you want
LMTP/LDA deliveries to update quota.

The quota count can be recalculated with doveadm quota recalc

Aki



Re: Maintaining table quota2

2019-02-12 Thread Robert Moskowitz via dovecot



On 2/12/19 1:57 PM, Aki Tuomi wrote:


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:
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


I have been spending effort today reading up on this and searching on a 
couple questions.


For my additions to 20-imap.conf I have:

imap_client_workarounds = delay-newmail
protocol imap {
    mail_plugins = quota imap_quota trash
}

I see that the mail_plugin quota is moved to 10-mail.conf.  No biggie 
there.  But what about trash?


And I tried to find documentation on imap_client_workarounds and all I 
have found is in:


https://wiki.dovecot.org/QuickConfiguration#Client_Workarounds

"Check imap_client_workarounds and pop3_client_workarounds and see if 
you want to enable more of them than the defaults. ?


With no link about where to learn more.

Where does quota count go?  Just dovecot.conf or one of the numbered 
conf addtions?


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

Also is there a way to compute the count for all users?  I am migrating 
the maildir and rebuilding the sql database.  I see:


doveadm mailbox status -u user@domain vsize '*'

But do I do that for each user in each domain or is that '*' there to 
run it on all users?


I think this will get me started.






Re: Maintaining table quota2

2019-02-12 Thread Aki Tuomi via dovecot


 
 
  
   
  
  
   
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
   
 



Re: Maintaining table quota2

2019-02-12 Thread Robert Moskowitz via dovecot




On 2/12/19 1:03 PM, Aki Tuomi via dovecot wrote:

On 12 February 2019 at 19:55 Robert Moskowitz via dovecot  
wrote:




On 2/12/19 12:38 PM, Aki Tuomi via dovecot wrote:

On 12 February 2019 at 18:23 Robert Moskowitz via dovecot  
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



Re: Maintaining table quota2

2019-02-12 Thread Aki Tuomi via dovecot


> On 12 February 2019 at 19:55 Robert Moskowitz via dovecot 
>  wrote:
> 
> 
> 
> 
> On 2/12/19 12:38 PM, Aki Tuomi via dovecot wrote:
> >> On 12 February 2019 at 18:23 Robert Moskowitz via dovecot 
> >>  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.

Aki


Re: Maintaining table quota2

2019-02-12 Thread Robert Moskowitz via dovecot




On 2/12/19 12:38 PM, Aki Tuomi via dovecot wrote:

On 12 February 2019 at 18:23 Robert Moskowitz via dovecot  
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



Re: Maintaining table quota2

2019-02-12 Thread Aki Tuomi via dovecot


> On 12 February 2019 at 18:23 Robert Moskowitz via dovecot 
>  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. 

Aki


Maintaining table quota2

2019-02-12 Thread Robert Moskowitz via dovecot
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