SQL user_query quota_rule for *:messages=

James list at xdrv.uk
Mon May 23 08:41:50 UTC 2022


On 23/05/2022 08:18, Aki Tuomi wrote:

>> Is it possible to override the message count limit with an SQL
>> user_query (and password_query)?
>>
>>
>>
>>
>> I tried returning userdb_quota_rule2 in the SQL but it did not work.
>> "SELECT ... '*:messages=' || maxcount AS userdb_quota_rule2 ...;"
>>
>>
>> Ref:
>> https://doc.dovecot.org/configuration_manual/authentication/user_database_extra_fields/#authentication-user-database-extra-fields
>
> If you are returning that from userdb, you should not return it with `userdb_` prefix.

Thank you, correct advice, my mistake.  I have a combined password_query 
and made the mistake of adding userdb_ prefix in both.

This has enabled the user limit for messages (as well as storage) and I 
can see over messages count causes defer like for over storage. 
Progress!  Thank you for the help.


For reference the quota warning for messages is also working (from 
dovecot.conf):
   quota_warning6 = messages=90%% quota-warning 90 %u
Testing this was my objective which required setting a very low per user 
value for a test account.  Thank you.




More information about the dovecot mailing list