can't get quota working. I use static userdb driver.
Hi, people ! Set up global quota according to docs to 2 Mb. Send more than ten Mb on the box. Mail still getting put in the box, no bounces, no error messages in logs, nothing to prevent mail to be delivered in overflooded mailbox.
quota settings are:
mail_plugins = quota lmtp_rcpt_check_quota = yes quota_full_tempfail = yes
protocol lmtp { postmaster_address = postmaster # required mail_plugins = $mail_plugins sieve }
protocol lda { mail_plugins = $mail_plugins sieve }
protocol imap { mail_plugins = $mail_plugins imap_quota }
plugin { quota = maildir:"User quota" quota_rule = *:storage=10M quota_rule3 = INBOX.Trash:storage=+10%% quota_exceeded_message = "552 5.2.2 Mailbox is full" }
doveconf -n is attached.
# doveadm quota get Quota name Type Value Limit
%
"User quota" STORAGE 0 10240
0
"User quota" MESSAGE 0 -
# doveadm quota get -u vadim Quota name Type Value Limit
%
"User quota" STORAGE 0 10240
0
"User quota" MESSAGE 0 -
# du -sh /var/mail/vadim/ 23M /var/mail/vadim/
I tried to pass quota_rule as an argument to userdb, quota is being parsed, but still doesn't work.
I think problem is that dovecot can't (re)calculate the actual quota on disc (cant calculate how disk space mailbox is used), despite the fact that quota limit itself is configured correctly, since dovecot shows it in log and doveconf -n.
What I am dong wrong ?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, 1 Sep 2017, Вадим Бажов wrote:
plugin { quota = maildir:"User quota" quota_rule = *:storage=10M quota_rule3 = INBOX.Trash:storage=+10%% ^^ this should spell quota_rule2 but is not the issue right now
quota_exceeded_message = "552 5.2.2 Mailbox is full" }
doveconf -n is attached.
# doveadm quota get Quota name Type Value Limit % "User quota" STORAGE 0 10240 0 "User quota" MESSAGE 0 -
# doveadm quota get -u vadim Quota name Type Value Limit % "User quota" STORAGE 0 10240 0 "User quota" MESSAGE 0 -
This looks like the userdb is setting the correct data, because the number matches your config.
Try doveadm quota recalc -u vadim
if you get sensible current values or errors.
I think problem is that dovecot can't (re)calculate the actual quota on disc (cant calculate how disk space mailbox is used), despite the fact that quota limit itself is configured correctly, since dovecot shows it in log and doveconf -n.
If vadim got flooded with messages, the question is, why storage's value is "0". It might be wrong, but not 0. How do you deliver the messages?
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBWa5gH3z1H7kL/d9rAQJ7VggArquitNsVYlxw/d3Qwrz4i/g9lL26lRrL aJ6W3CLExaJ7pBJ4X7Clt5jokbiF7BLLgqHsM3i+DW5L/HSkgBPB0mFhf/g/gmYs SO8csYcxjSNjKAXrfYKZhywZ7QELzBIgPtcGkzDzS0LPRumGz6bKsmm4SNN5pbOF yjujYC3HUhSN79L+XhvpO52h7ukk1ST1+5u68dUk9KbpzRr4jWKFZqz0Ey6NiazP sb/qKt0sCiinPkk/G9gOuIgh1r/M0kirLDf0GI04Vj8v3j6HD6+NG63dRAoEpCJ/ TaNOzQCHp6AzmvRcH0I8N+E0seoVU3AF7NabBGZxFZ5AmWrk8oYKcw== =wLq2 -----END PGP SIGNATURE-----
On 05.09.2017 11:28, Steffen Kaiser wrote:
On Fri, 1 Sep 2017, Вадим Бажов wrote:
plugin { quota = maildir:"User quota" quota_rule = *:storage=10M quota_rule3 = INBOX.Trash:storage=+10%% ^^ this should spell quota_rule2 but is not the issue right now
actually dovecot probably stops looking after it fails to see quota_rule2.
Aki
Thank you for your answers. I fixed config to:
plugin { sieve_default = /mnt/rw_disc/dovecot/sieve/default.sieve sieve_global = /mnt/rw_disc/dovecot/sieve/
quota = maildir:User quota_rule = *:storage=10M # quota_rule2 = INBOX.Trash:storage=+10%% quota_max_mail_size = 3M quota_exceeded_message = "552 5.2.2 Mailbox is full" }
The mail_location is actually maildir:/var/spool/mail/%u, mdbox was a misspelling (i tried migration from maildir to mdbox before). I've deleted mailboxes from file system. Dovecot created them again on login. I sent some mails to get over 10Mb in both mailboxes.
Quota still cant'be calculated.
# doveadm quota recalc -u vadim # doveadm quota get -u vadim Quota name Type Value Limit
%
User STORAGE 0 10240
0
User MESSAGE 0 -
# du -sh /var/mail/vadim/ 14M /var/mail/vadim/
doveconf -n is in attachement.
Thunderbird has a quota plugin and shows quota on the box from my corporate mailbox and doesn't show quota on my testing installation at all. Screenshots are attached too.
2017-09-05 13:49 GMT+05:00 Aki Tuomi aki.tuomi@dovecot.fi:
On 05.09.2017 11:28, Steffen Kaiser wrote:
On Fri, 1 Sep 2017, Вадим Бажов wrote:
plugin { quota = maildir:"User quota" quota_rule = *:storage=10M quota_rule3 = INBOX.Trash:storage=+10%% ^^ this should spell quota_rule2 but is not the issue right now
actually dovecot probably stops looking after it fails to see quota_rule2.
Aki
Am 06.09.2017 um 12:17 schrieb Вадим Бажов:
Thank you for your answers. I fixed config to:
plugin { sieve_default = /mnt/rw_disc/dovecot/sieve/default.sieve sieve_global = /mnt/rw_disc/dovecot/sieve/
quota = maildir:User quota_rule = *:storage=10M # quota_rule2 = INBOX.Trash:storage=+10%% quota_max_mail_size = 3M quota_exceeded_message = "552 5.2.2 Mailbox is full" }
Have you tried using a different backend (e.g. dict & flat file)?
The mail_location is actually maildir:/var/spool/mail/%u, mdbox was a misspelling (i tried migration from maildir to mdbox before).
I'm wondering if this might be caused by using the same directory for home and mail?
-- Alex JOST
Just tried 'count', 'fs' and 'dirsize' quota ackends. All the same.
# doveadm quota recalc # doveadm quota get -u vadim Quota name Type Value Limit
%
User quota STORAGE 0 10240
0
User quota MESSAGE 0 -
0
# doveadm quota get Quota name Type Value Limit
%
User quota STORAGE 0 10240
0
User quota MESSAGE 0 -
It looks like quota_rule is interpreted but quota backend doesn't work (cant count current quota state).
I deleted all the mailboxes, then I divided CONTROL an INDEX dirs apart from mailbox dir itself: maildir:/var/spool/mail/%u:INDEX=/tmp/no-quotas/index/%u:CONTROL=/tmp/no-quotas/control/%u Boxes were created with dovecot files for them under /tmp/no-quotas as well, but no changes. quota value is always zero. May be I should try MDBOX with all these quota backends, but, anyway, I cant migrate to MDBOX yet, so it's not my choice.
Any suggestions ? Does anyone has a working maldir quota installation all around ? Dovecot version is 2.2.27 (c0f36b0).
Some other questions: put CONTROL and INDEX files in separate dir, but in the same dis
- Documentation says that quotas can work improperly if static userdb driver is used. I use static driver. Is it really a problem ? I tried to return user quotas from my bash-script, it passes from bash to dovecot during lmtp and auth processes succesfully. But no difference with calculating quotas. Can I use something different from static driver for userdb if I use external bash script for auth and lmtp ? (I will try to change the driver...)
- It said that maildir quota backend count quotas using 'maildirsize' files. I dont have such files inside box dirs. What should I tune in order to create them by dovecot ?
- Found this in docs: "Dovecot can't currently handle not being able to write the control files, so it will cause problems with filesystem quota. To avoid problems with this, you should place control files into a partition where quota isn't checked. You can specify this by adding :CONTROL=<path> to mail_location, for example:" - i tried to
partition. Should I really change the disk partition ? What 'filesystem quota' means here ? I dont use any disk quotas in my system (centos 6.9).
2017-09-06 15:55 GMT+05:00 Alex JOST jost+lists@dimejo.at:
Am 06.09.2017 um 12:17 schrieb Вадим Бажов:
Thank you for your answers. I fixed config to:
plugin { sieve_default = /mnt/rw_disc/dovecot/sieve/default.sieve sieve_global = /mnt/rw_disc/dovecot/sieve/
quota = maildir:User quota_rule = *:storage=10M # quota_rule2 = INBOX.Trash:storage=+10%% quota_max_mail_size = 3M quota_exceeded_message = "552 5.2.2 Mailbox is full" }
Have you tried using a different backend (e.g. dict & flat file)?
The mail_location is actually maildir:/var/spool/mail/%u, mdbox was a misspelling (i tried migration from maildir to mdbox before).
I'm wondering if this might be caused by using the same directory for home and mail?
-- Alex JOST
Quotas not being counted with 'passwd-file' driver too. Thunderbird still doesn't show quota bar. It is mentioned to run passdb with '-d' parameter if quotas aren't working. Can you explain how to set it up. How to run passdb with '-d' parameter ? Any configuration file snippet ?
2017-09-06 21:20 GMT+05:00 Вадим Бажов master@remort.net:
Just tried 'count', 'fs' and 'dirsize' quota ackends. All the same.
# doveadm quota recalc # doveadm quota get -u vadim Quota name Type Value Limit
%
User quota STORAGE 0 10240
0
User quota MESSAGE 0 -
0
# doveadm quota get Quota name Type Value Limit
%
User quota STORAGE 0 10240
0
User quota MESSAGE 0 -
It looks like quota_rule is interpreted but quota backend doesn't work (cant count current quota state).
I deleted all the mailboxes, then I divided CONTROL an INDEX dirs apart from mailbox dir itself: maildir:/var/spool/mail/%u:INDEX=/tmp/no-quotas/index/%u:CONTROL=/tmp/no-quotas/control/%u Boxes were created with dovecot files for them under /tmp/no-quotas as well, but no changes. quota value is always zero. May be I should try MDBOX with all these quota backends, but, anyway, I cant migrate to MDBOX yet, so it's not my choice.
Any suggestions ? Does anyone has a working maldir quota installation all around ? Dovecot version is 2.2.27 (c0f36b0).
Some other questions: put CONTROL and INDEX files in separate dir, but in the same dis
- Documentation says that quotas can work improperly if static userdb driver is used. I use static driver. Is it really a problem ? I tried to return user quotas from my bash-script, it passes from bash to dovecot during lmtp and auth processes succesfully. But no difference with calculating quotas. Can I use something different from static driver for userdb if I use external bash script for auth and lmtp ? (I will try to change the driver...)
- It said that maildir quota backend count quotas using 'maildirsize' files. I dont have such files inside box dirs. What should I tune in order to create them by dovecot ?
- Found this in docs: "Dovecot can't currently handle not being able to write the control files, so it will cause problems with filesystem quota. To avoid problems with this, you should place control files into a partition where quota isn't checked. You can specify this by adding :CONTROL=<path> to mail_location, for example:" - i tried to
partition. Should I really change the disk partition ? What 'filesystem quota' means here ? I dont use any disk quotas in my system (centos 6.9).
2017-09-06 15:55 GMT+05:00 Alex JOST jost+lists@dimejo.at:
Am 06.09.2017 um 12:17 schrieb Вадим Бажов:
Thank you for your answers. I fixed config to:
plugin { sieve_default = /mnt/rw_disc/dovecot/sieve/default.sieve sieve_global = /mnt/rw_disc/dovecot/sieve/
quota = maildir:User quota_rule = *:storage=10M # quota_rule2 = INBOX.Trash:storage=+10%% quota_max_mail_size = 3M quota_exceeded_message = "552 5.2.2 Mailbox is full" }
Have you tried using a different backend (e.g. dict & flat file)?
The mail_location is actually maildir:/var/spool/mail/%u, mdbox was a misspelling (i tried migration from maildir to mdbox before).
I'm wondering if this might be caused by using the same directory for home and mail?
-- Alex JOST
I found what causes quota not being working at all - namespace. Whenever I declare a basic namespace :
namespace { type = public prefix = INBOX. separator = . inbox = yes }
or even
namespace { type = public inbox = yes }
Quota gets broken:
# doveadm quota recalc -u administrator; doveadm quota get -u administrator Quota name Type Value Limit
%
User quota STORAGE 0 100000
0
User quota MESSAGE 0 -
0
When I get rid of any namespace declaration, quota gets work:
# doveadm quota recalc -u administrator; doveadm quota get -u administrator Quota name Type Value Limit
%
User quota STORAGE 19922 100000
19
User quota MESSAGE 2 -
0
Quota settings are simple:
plugin { quota = maildir quota_rule = *:bytes=100000k }
'count' quota engine works too as well.
But I need to declare and set up my own namespace (Spam and Sent folders, subscriptions and autoexpunge stuff). Any suggestions how to set quota within a specific namespace ?
2017-09-06 21:24 GMT+05:00 Вадим Бажов master@remort.net:
Quotas not being counted with 'passwd-file' driver too. Thunderbird still doesn't show quota bar. It is mentioned to run passdb with '-d' parameter if quotas aren't working. Can you explain how to set it up. How to run passdb with '-d' parameter ? Any configuration file snippet ?
2017-09-06 21:20 GMT+05:00 Вадим Бажов master@remort.net:
Just tried 'count', 'fs' and 'dirsize' quota ackends. All the same.
# doveadm quota recalc # doveadm quota get -u vadim Quota name Type Value Limit
%
User quota STORAGE 0 10240
0
User quota MESSAGE 0 -
0
# doveadm quota get Quota name Type Value Limit
%
User quota STORAGE 0 10240
0
User quota MESSAGE 0 -
It looks like quota_rule is interpreted but quota backend doesn't work (cant count current quota state).
I deleted all the mailboxes, then I divided CONTROL an INDEX dirs apart from mailbox dir itself: maildir:/var/spool/mail/%u:INDEX=/tmp/no-quotas/index/%u:CONTROL=/tmp/no-quotas/control/%u Boxes were created with dovecot files for them under /tmp/no-quotas as well, but no changes. quota value is always zero. May be I should try MDBOX with all these quota backends, but, anyway, I cant migrate to MDBOX yet, so it's not my choice.
Any suggestions ? Does anyone has a working maldir quota installation all around ? Dovecot version is 2.2.27 (c0f36b0).
Some other questions: put CONTROL and INDEX files in separate dir, but in the same dis
- Documentation says that quotas can work improperly if static userdb driver is used. I use static driver. Is it really a problem ? I tried to return user quotas from my bash-script, it passes from bash to dovecot during lmtp and auth processes succesfully. But no difference with calculating quotas. Can I use something different from static driver for userdb if I use external bash script for auth and lmtp ? (I will try to change the driver...)
- It said that maildir quota backend count quotas using 'maildirsize' files. I dont have such files inside box dirs. What should I tune in order to create them by dovecot ?
- Found this in docs: "Dovecot can't currently handle not being able to write the control files, so it will cause problems with filesystem quota. To avoid problems with this, you should place control files into a partition where quota isn't checked. You can specify this by adding :CONTROL=<path> to mail_location, for example:" - i tried to
partition. Should I really change the disk partition ? What 'filesystem quota' means here ? I dont use any disk quotas in my system (centos 6.9).
2017-09-06 15:55 GMT+05:00 Alex JOST jost+lists@dimejo.at:
Am 06.09.2017 um 12:17 schrieb Вадим Бажов:
Thank you for your answers. I fixed config to:
plugin { sieve_default = /mnt/rw_disc/dovecot/sieve/default.sieve sieve_global = /mnt/rw_disc/dovecot/sieve/
quota = maildir:User quota_rule = *:storage=10M # quota_rule2 = INBOX.Trash:storage=+10%% quota_max_mail_size = 3M quota_exceeded_message = "552 5.2.2 Mailbox is full" }
Have you tried using a different backend (e.g. dict & flat file)?
The mail_location is actually maildir:/var/spool/mail/%u, mdbox was a misspelling (i tried migration from maildir to mdbox before).
I'm wondering if this might be caused by using the same directory for home and mail?
-- Alex JOST
Got it ! The issue is in the 'type = public' parameter. I removed it from my namespace definition and quota got counted as expected ! Problem solved.
2017-09-01 21:34 GMT+05:00 Вадим Бажов master@remort.net:
Hi, people ! Set up global quota according to docs to 2 Mb. Send more than ten Mb on the box. Mail still getting put in the box, no bounces, no error messages in logs, nothing to prevent mail to be delivered in overflooded mailbox.
quota settings are:
mail_plugins = quota lmtp_rcpt_check_quota = yes quota_full_tempfail = yes
protocol lmtp { postmaster_address = postmaster # required mail_plugins = $mail_plugins sieve }
protocol lda { mail_plugins = $mail_plugins sieve }
protocol imap { mail_plugins = $mail_plugins imap_quota }
plugin { quota = maildir:"User quota" quota_rule = *:storage=10M quota_rule3 = INBOX.Trash:storage=+10%% quota_exceeded_message = "552 5.2.2 Mailbox is full" }
doveconf -n is attached.
# doveadm quota get Quota name Type Value Limit
%
"User quota" STORAGE 0 10240
0
"User quota" MESSAGE 0 -
# doveadm quota get -u vadim Quota name Type Value Limit
%
"User quota" STORAGE 0 10240
0
"User quota" MESSAGE 0 -
# du -sh /var/mail/vadim/ 23M /var/mail/vadim/
I tried to pass quota_rule as an argument to userdb, quota is being parsed, but still doesn't work.
I think problem is that dovecot can't (re)calculate the actual quota on disc (cant calculate how disk space mailbox is used), despite the fact that quota limit itself is configured correctly, since dovecot shows it in log and doveconf -n.
What I am dong wrong ?
participants (4)
-
Aki Tuomi
-
Alex JOST
-
Steffen Kaiser
-
Вадим Бажов