Quota plugin: "quota_storage_size" not recognized from userdb extra fields in dovecot 2.4.1
Dear Dovecot experts,
I am in the process of planning migration from dovecot 2.3 to 2.4.1+dfsg1-6 on Debian Trixie, but userdb extra fields for quota_storage_size are ignored. All settings proved to work in 2.3; following per-user quota manual as outlined in [1].
Issue Cannot override setting quota_storage_size using userdb_quota_storage_size, but userdb_quota_storage_extra and userdb_quota_storage_percentage apparently work.
Setup Configures multiple userdb using driver passwd combined for a) user information and b) user-specific extra fields; auth. via passdb using driver pam defined in auth-system.conf.ext included by 10-auth.conf Excerpt from doveconf -n: … passdb system_pam { driver = pam } userdb userdb_01_passwd { driver = passwd result_internalfail = return-fail result_success = continue-ok } userdb userdb_02_quota { passwd_file_path = /etc/dovecot/quota-user-settings driver = passwd-file result_internalfail = return-fail result_success = continue } …
Excerpt from passwd file /etc/dovecot/quota-user-settings holding userdb extra fields: web1p1:::::::userdb_quota_storage_size=1200M
Default quota config excerpt from doveconf -n: … quota user { storage_grace = 100M storage_size = 750M quota_warning warn-95 { quota_storage_percentage = 95 execute quota-warning { args = 95 %{user} } } quota_warning warn-85 { quota_storage_percentage = 85 execute quota-warning { args = 85 %{user} } } } …
Result Userdb setting appear to work correctly as it combines both userdb files, see following output:
doveadm user web1p1
field value uid 644 gid 105 home /home/pop/web1p1 mail_path /home/pop/web1p1/mail system_groups_user web1p1 quota_storage_size 1200M
However, querying the quota only shows the default value, but not the user-specific setting.
doveadm quota get -u web1p1
Quota name Type Value Limit % user STORAGE 798830 768000 104 user MESSAGE 5617 - 0
Expected behaviour Any user should report default user quota (here 750M), but user web1p1 having user-specific setting for userdb_quota_storage_size=1200M should report a higher quota limit overriding the default quota setting.
I tried to specify user-specific values for userdb_quota_storage_extra and userdb_quota_storage_percentage, which worked; probably, because there were no default value specified in the config, yet? Setting userdb_quota_storage_extra to 200M works:
web1p1:::::::userdb_quota_storage_extra=200M
…
doveadm user web1p1
field value uid 644 gid 105 home /home/pop/web1p1 mail_path /home/pop/web1p1/mail system_groups_user web1p1 quota_storage_extra 200M
…
doveadm quota get -u web1p1
Quota name Type Value Limit % user STORAGE 798830 972800 82 user MESSAGE 5617 - 0
Quota is reported as correctly as 750M+200M=950M.
Same approach works when setting userdb_quota_storage_percentage, e.g. to a value above 100.
[1] https://doc.dovecot.org/main/core/plugins/quota.html#per-user-quota
Many thanks for your support!
Matthieu
Dear Dovecot experts, I am in the process of planning migration from dovecot 2.3 to 2.4.1+dfsg1-6 on Debian Trixie, but userdb extra fields for quota_storage_size are ignored. All settings proved to work in 2.3; following per-user quota manual as outlined in [1]. Issue Cannot override setting quota_storage_size using userdb_quota_storage_size, but userdb_quota_storage_extra and userdb_quota_storage_percentage apparently work. Setup Configures multiple userdb using driver passwd combined for a) user information and b) user-specific extra fields; auth. via passdb using driver pam defined in auth-system.conf.ext included by 10-auth.conf Excerpt from doveconf -n: ... passdb system_pam { driver = pam } userdb userdb_01_passwd { driver = passwd result_internalfail = return-fail result_success = continue-ok } userdb userdb_02_quota { passwd_file_path = /etc/dovecot/quota-user-settings driver = passwd-file result_internalfail = return-fail result_success = continue } ... Excerpt from passwd file /etc/dovecot/quota-user-settings holding userdb extra fields: web1p1:::::::userdb_quota_storage_size=1200M Default quota config excerpt from doveconf -n: ... quota user { storage_grace = 100M storage_size = 750M quota_warning warn-95 { quota_storage_percentage = 95 execute quota-warning { args = 95 %{user} } } quota_warning warn-85 { quota_storage_percentage = 85 execute quota-warning { args = 85 %{user} } } } ... Result Userdb setting appear to work correctly as it combines both userdb files, see following output:
doveadm user web1p1
field value uid 644 gid 105 home /home/pop/web1p1 mail_path /home/pop/web1p1/mail system_groups_user web1p1 quota_storage_size 1200M However, querying the quota only shows the default value, but not the user-specific setting.
doveadm quota get -u web1p1
Quota name Type Value Limit
%
user STORAGE 798830 768000
104
user MESSAGE 5617 -
0
Expected behaviour Any user should report default user quota (here 750M), but user web1p1 having user-specific setting for userdb_quota_storage_size=1200M should report a higher quota limit overriding the default quota setting. I tried to specify user-specific values for userdb_quota_storage_extra and userdb_quota_storage_percentage, which worked; probably, because there were no default value specified in the config, yet? Setting userdb_quota_storage_extra to 200M works: web1p1:::::::userdb_quota_storage_extra=200M ...
doveadm user web1p1
field value uid 644 gid 105 home /home/pop/web1p1 mail_path /home/pop/web1p1/mail system_groups_user web1p1 quota_storage_extra 200M ...
doveadm quota get -u web1p1
Quota name Type Value Limit
%
user STORAGE 798830 972800
82
user MESSAGE 5617 -
0
Quota is reported as correctly as 750M+200M=950M. Same approach works when setting userdb_quota_storage_percentage, e.g. to a value above 100. [1] [1]https://doc.dovecot.org/main/core/plugins/quota.html#per-user-quota Many thanks for your support! Matthieu
References
Visible links
<ul data-editing-info="{"applyListStyleFromLevel":false,"unorderedStyleType":4}" style="margin-top: 0px; margin-bottom: 0px;"><li style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0); list-style-type: "➢ ";"><div class="elementToProof" role="presentation">web1p1:::::::userdb_quota_storage_size=1200M</div></li></ul><div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);"><br></div><div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);">You need to specify the scope it applies to via the full path including slashes. In this case the setting is within "quota user" named filter, so it would look like quota/user/storage_size if you wanted to override it via userdb return:</div><div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);"><br></div><ul data-editing-info="{"applyListStyleFromLevel":false,"unorderedStyleType":4}" style="margin-top: 0px; margin-bottom: 0px;"><li style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0); list-style-type: "➢ ";"><div class="elementToProof" role="presentation" style="color: rgb(0, 0, 0);">web1p1:::::::quota/user/storage_size=1200M</div></li></ul><div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);"><br></div><div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);">Strange I know, but that seems to be how it works now. Took me an unreasonable amount of time to figure that one out. The documentation is here:</div><div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);"><a href="https://doc.dovecot.org/2.4.1/core/settings/syntax.html#named-filter-overrides">https://doc.dovecot.org/2.4.1/core/settings/syntax.html#named-filter-overrides</a></div><div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);"><br></div><div class="elementToProof" style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);">That said it isn't immediately obvious that user/passdb override is implemented in the same way CLI overrides are just by a read of that, but eventually I figured it out via trial and error.</div>
Dear Andy,
Thank you very much for the immediate reply. Indeed, I can confirm that the following works like expected:
web1p1:::::::userdb_quota/user/storage_size=1200M
Cheers!
Matthieu
Dear Andy, Thank you very much for the immediate reply. Indeed, I can confirm that the following works like expected:
web1p1:::::::userdb_quota/user/storage_size=1200M Cheers! Matthieu
participants (2)
-
Andy Baugh
-
Matthieu Schapranow