Hello,
New setup and trying to get quotas going. It's a
Dovecot/Postfix/Mariadb virtual user setup. In my db I have a varchar
field called quota with a default value of 128. Here's what I have in
dovecot configs for quota:

# Plugins
mail_plugins = acl mail_crypt quota

service stats {
    fifo_listener stats-mail {
        user = vmail
        mode = 0644
    }

    inet_listener {
        address = 127.0.0.1
        port = 24242
    }
}

# quota status
service quota-status {
    executable = quota-status -p postfix
        unix_listener /var/spool/postfix/private/dovecot-quota {
                user = postfix
                group = postfix
                mode = 0660
        }
        client_limit = 1
}

# Quota warnings
service quota-warning {
executable = script /usr/local/bin/quota-warning.sh
user = vmail
unix_listener quota-warning {
group = vmail
mode = 0660
user = vmail
}
}

plugin {
  quota = count:User quota
  quota2 = maildir:Shared quota:ns=public/
  quota_max_mail_size = 100M
  # Required for 'count' quota driver
  quota_vsizes = yes
       quota_rule2 = Trash:storage=+10%%
quota_rule = *:storage=1G
quota_rule2 = Trash:storage=100M
quota_rule3 = SPAM:ignore
       quota_warning = storage=100%% quota-warning +100 %u
       quota_warning2 = storage=95%% quota-warning +95 %u
       quota_warning3 = storage=80%% quota-warning +80 %u
       quota_warning4 = -storage=100%% quota-warning -100 %u # user is
no longer over quota
    quota_exceeded_message = User %u has exhausted allowed storage space.
  quota_grace = 10%%
  # 10% is the default
  quota_status_success = DUNNO
  quota_status_nouser = DUNNO
  quota_status_overquota = "552 5.2.2 Mailbox is full"

    ## Stats

    ### how often to session statistics (must be set)
    stats_refresh = 30 secs
    ### track per-IMAP command statistics (optional)
    stats_track_cmds = yes
}

The protocol imap has the imap_quota plugin and protocol lmtp has the
quota plugin. I've also got

lmtp_rcpt_check_quota = yes
mailbox_list_index = yes

In my dovecot-sql.conf file my user query looks like this:

user_query = SELECT concat('*:storage=', quota, 'M') AS quota_rule
FROM accounts WHERE username = '%Ln' AND domain = '%Ld' AND sendonly =
false;

Postfix checks:

 check_policy_service unix:private/dovecot-quota

Am I overcomplicating?

Thanks.
Dave.
_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to