diff --git a/management/mailconfig.py b/management/mailconfig.py
index 3404ae87..d9b7d7c3 100755
--- a/management/mailconfig.py
+++ b/management/mailconfig.py
@@ -328,7 +328,7 @@ def get_mail_users_ex(env, with_archived=False):
#email = rec['maildrop'][0]
email = rec['mail'][0]
privileges = rec['mailaccess']
- quota = rec['mailboxQuota'][0] if len(rec['mailboxQuota']>0) else '0'
+ quota = rec['mailboxQuota'][0] if len(rec['mailboxQuota'])>0 else '0'
display_name = rec['cn'][0]
active_accounts.add(email)
@@ -384,7 +384,7 @@ def get_mail_users_ex(env, with_archived=False):
"privileges": [],
"status": "inactive",
"mailbox": mbox,
- "display_name": ""
+ "display_name": "",
"box_size": '?',
"box_quota": '?',
"percent": '?',
diff --git a/management/templates/users.html b/management/templates/users.html
index 84c65e99..0a48bf0d 100644
--- a/management/templates/users.html
+++ b/management/templates/users.html
@@ -32,11 +32,13 @@
@@ -249,7 +251,7 @@ function do_add_user() {
email: email,
password: pw,
privileges: privs,
- quota: quota
+ quota: quota,
display_name: display_name
},
function(r) {
diff --git a/setup/mail-dovecot.sh b/setup/mail-dovecot.sh
index cd8b800d..64635968 100755
--- a/setup/mail-dovecot.sh
+++ b/setup/mail-dovecot.sh
@@ -85,9 +85,9 @@ fi
if ! grep -q "quota_status_success = DUNNO" /etc/dovecot/conf.d/90-quota.conf; then
cat > /etc/dovecot/conf.d/90-quota.conf << EOF;
plugin {
- quota = maildir
+ quota = maildir:User quota
- quota_grace = 10%
+ quota_grace = 10%%
quota_status_success = DUNNO
quota_status_nouser = DUNNO
diff --git a/setup/mail-users.sh b/setup/mail-users.sh
index c6cf9b8c..b6e36acd 100755
--- a/setup/mail-users.sh
+++ b/setup/mail-users.sh
@@ -88,8 +88,9 @@ pass_attrs = maildrop=user
# Post-login information specific to the user (eg. quotas). For
# lmtp delivery, pass_filter is not used, and postfix has already
# rewritten the envelope using the maildrop address.
+# %$ is expanded to mailboxQuota's value.
user_filter = (&(objectClass=mailUser)(|(mail=%u)(maildrop=%u)))
-user_attrs = maildrop=user mailboxQuota=quota_rule=*:bytes=%\$
+user_attrs = maildrop=user,mailboxQuota=quota_rule=*:bytes=%\$
# Account iteration for various dovecot tools (doveadm)
iterate_filter = (objectClass=mailUser)