From 48d890ee825b6448e4cce17b48c99ee710ce2cc0 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Sun, 15 Oct 2023 19:14:18 +0200 Subject: [PATCH] make quota work --- .../deploy_chatmail/dovecot/dovecot.conf.j2 | 30 +++++++++++++++---- plan.txt | 7 ++--- scripts/get_imap_capabilities.py | 2 +- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/deploy-chatmail/src/deploy_chatmail/dovecot/dovecot.conf.j2 b/deploy-chatmail/src/deploy_chatmail/dovecot/dovecot.conf.j2 index 6e1b9a05..8532c18e 100644 --- a/deploy-chatmail/src/deploy_chatmail/dovecot/dovecot.conf.j2 +++ b/deploy-chatmail/src/deploy_chatmail/dovecot/dovecot.conf.j2 @@ -4,11 +4,14 @@ protocols = imap lmtp auth_mechanisms = plain -auth_verbose = yes -auth_debug = yes -auth_debug_passwords = yes -auth_verbose_passwords = plain -auth_cache_size = 100M +mail_plugins = quota +mail_debug = yes + +# uncomment this if you want to debug authentication and user creation +#auth_verbose = yes +#auth_debug = yes +#auth_debug_passwords = yes +#auth_verbose_passwords = plain # Authentication for system users. passdb { @@ -60,13 +63,28 @@ mail_privileged_group = vmail # Enable IMAP COMPRESS (RFC 4978). # protocol imap { - mail_plugins = $mail_plugins imap_zlib + mail_plugins = $mail_plugins imap_zlib imap_quota +} + +protocol lmtp { + mail_plugins = $mail_plugins sieve quota } plugin { imap_compress_deflate_level = 6 } +plugin { + # for now we define static quota-rules for all users + quota = maildir:User quota + quota_rule = *:storage=100M + quota_max_mail_size=30M + quota_grace = 0 + quota_over_flag_value = TRUE +} + + + service lmtp { user=vmail diff --git a/plan.txt b/plan.txt index 44e56375..b00b9c30 100644 --- a/plan.txt +++ b/plan.txt @@ -2,13 +2,10 @@ ## Dovecot goals/steps -2. (holger) per-user storage quota (adaptive) - a) define a static 100MB per-user quota - -3. automatic expiry of messages older than M days +- automatic expiry of messages older than M days - delete unconditionally messages older than 40 days -4. limit: max-connections per account +- limit: configure max-connections per account ## Filtermail diff --git a/scripts/get_imap_capabilities.py b/scripts/get_imap_capabilities.py index 1b59bf76..6b8e171a 100644 --- a/scripts/get_imap_capabilities.py +++ b/scripts/get_imap_capabilities.py @@ -7,7 +7,7 @@ domain = os.environ.get("CHATMAIL_DOMAIN", "c3.testrun.org") print("connecting") conn = imaplib.IMAP4_SSL(domain) print("logging in") -conn.login(f"measure{time.time()}", "pass") +conn.login(f"imapcapa", "pass") status, res = conn.capability() for capa in sorted(res[0].decode().split()): print(capa)