Finish storing the user quota to redis

master
kaiyou 7 years ago
parent 80893be68b
commit 7f0447514c

@ -260,7 +260,7 @@ class User(Base, Email):
@property
def quota_bytes_used(self):
return quota.get(self.email) or 0
return quota.get(self.email + "/quota/storage") or 0
scheme_dict = {'SHA512-CRYPT': "sha512_crypt",
'SHA256-CRYPT': "sha256_crypt",

@ -5,7 +5,6 @@ log_path = /dev/stderr
protocols = imap pop3 lmtp sieve
postmaster_address = {{ POSTMASTER }}@{{ DOMAIN }}
hostname = {{ HOSTNAMES.split(",")[0] }}
mail_plugins = $mail_plugins quota quota_clone
submission_host = front
service dict {
@ -31,6 +30,9 @@ mail_gid = mail
mail_privileged_group = mail
mail_access_groups = mail
maildir_stat_dirs = yes
mailbox_list_index = yes
mail_vsize_bg_after_count = 100
mail_plugins = $mail_plugins quota quota_clone
namespace inbox {
inbox = yes
@ -52,6 +54,12 @@ namespace inbox {
}
}
plugin {
quota = count:User quota
quota_vsizes = yes
quota_clone_dict = redis:host={{ REDIS_ADDRESS }}:port=6379:db=1
}
###############
# Authentication
###############
@ -117,11 +125,6 @@ service lmtp {
}
}
plugin {
quota = maildir:User quota
quota_clone_dict = redis:host={{ REDIS_ADDRESS }}:db=1
}
###############
# Filtering

Loading…
Cancel
Save