I found this on the dovecot wiki:
The following limit names are supported:
*storage*: Quota limit in kilobytes, 0 means unlimited.
*
*bytes*: Quota limit in bytes, 0 means unlimited.
*
*messages*: Quota limit in number of messages, 0 means unlimited.
This probably isn't very useful.
*
*backend*: Quota backend-specific limit configuration.
*
*ignore*: Don't include the specified mailbox in quota at all.
As I understood it, all 5 limit categories are valid to use with maildir format while only "storage" and "messages" are valid to use with dmbox format, right? Also the "ignore" limit may appear more than one time for a user - like Trash:ignore and Spam:ignore, right?
So I assumed following should work - and it does - except for "ignore" - even though LDAP does not hold multiple values for it - only a single one for each limit:
user_attrs = [...] mailQuotaStorage=quota_rule=*:storage=%$, mailQuotaMessages=quota_rule2=*:messages=%$, mailQuotaIgnore=quota_rule3=*:ignore=%$
pass_attrs = [...] mailQuotaStorage=userdb_quota_rule=*:storage=%$, mailQuotaMessages=userdb_quota_rule2=*:messages=%$, mailQuotaIgnore=userdb_quota_rule3=*:ignore=%$
And unfortunately /var/log/maillog tells me:
dovecot: imap(abuse@netocean.local): Error: user abuse@netocean.local: Initialization failed: Failed to initialize quota: Invalid quota root quota: Invalid rule *:ignore=Trash: Unknown rule limit name: ignore
Yet /var/log/debug.log sounds a bit more promising ... but then again not really ...
dovecot: imap: Debug: Added userdb setting: mail=maildir:/usr/local/www/default/mail/user@mydomain.tld dovecot: imap: Debug: Added userdb setting: plugin/quota_rule=*:storage=1048576 dovecot: imap: Debug: Added userdb setting: plugin/quota_rule2=*:messages=10 dovecot: imap: Debug: Added userdb setting: plugin/quota_rule3=*:ignore=Trash dovecot: imap(abuse@netocean.local): Debug: Effective uid=2110, gid=2110, home=/var/vmail/user@mydomain.tld/mail dovecot: imap(abuse@netocean.local): Debug: Quota root: name=User quota backend=maildir args= dovecot: imap(abuse@netocean.local): Debug: Quota rule: root=User quota mailbox=* bytes=1073741824 messages=0 dovecot: imap(abuse@netocean.local): Debug: Quota rule: root=User quota mailbox=* bytes=1073741824 messages=10 dovecot: imap(abuse@netocean.local): Debug: Quota rule: root=User quota mailbox=* bytes=1073741824 messages=10
Additionally, if one of the two working quotas (storage & messages) is exceeded than Dovecot sends out a warning from this setting:
plugin { quota_warning = storage=90%% quota-warning 90 %u quota_warning2 = storage=75%% quota-warning 75 %u # What message to send to IMAP clients (and SMTP senders) when quota is exceeded? quota_exceeded_message = Quota exceeded, please go to http://MyDomain.TLD for instructions on how to fix this. }
No my question is how to provide two different warnings.
One for storage like: Sorry, you're mail storage is full. Please delete some.
And a second for messages like: Sorry, you've too many messages. Please delete some.
Thanks & Best Regards Leander