Davide Marchi
2019-Mar-19 17:00 UTC
Dovecot quota and Postfix smtpd_recipient_restrictions?
Hi Friends, a doubt: I would like to enable (the same) quota (count) for all (virtual)users, on Debian Stretch, Postfix 3.1.8, Dovecot 2.2.27, and is not clear for me if I need to tell Postfix to communicate with the service in /etc/postfix/main.cf as here: smtpd_recipient_restrictions ... check_policy_service inet:mailstore.example.com:12340 My current Postfix "smtpd_recipient_restrictions": -o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject Currently I've edited: conf.d/10-mail.conf: # Space separated list of plugins to load for all services. Plugins specific to # IMAP, LDA, etc. are added to this list in their own .conf files. mail_plugins = $mail_plugins quota conf.d/20-imap.conf: protocol imap { # Space separated list of plugins to load (default is global mail_plugins). mail_plugins = $mail_plugins imap_quota } conf.d/90-quota.conf: (for use with the quota-status service) plugin { 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" } /etc/dovecot/conf.d/90-quota.conf: plugin { quota = maildir quota_rule = *:storage=3G quota_rule2 = Trash:storage=+100M # LDA/LMTP allows saving the last mail to bring user from under quota to # over quota, if the quota doesn't grow too high. Default is to allow as # long as quota will stay under 10% above the limit. Also allowed e.g. 10M. #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" } plugin { quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=80%% quota-warning 80 %u } plugin { #quota = dirsize:User quota #quota = maildir:User quota #quota = dict:User quota::proxy::quota #quota = fs:User quota quota = count:User quota # This is required - it uses "virtual sizes" rather than "physical sizes" for quota counting: quota_vsizes = yes } plugin { #quota = dict:user::proxy::quota #quota2 = dict:domain:%d:proxy::quota_domain #quota_rule = *:storage=102400 #quota2_rule = *:storage=1048576 } service quota-warning { executable = script /usr/local/bin/quota-warning.sh user = dovecot unix_listener quota-warning { user = vmail } } service quota-status { executable = quota-status -p postfix inet_listener { port = 12340 # You can choose any port you want } client_limit = 1 } Many many thanks!! Davide
Urban Loesch
2019-Mar-20 07:39 UTC
Dovecot quota and Postfix smtpd_recipient_restrictions?
Hi,> I would like to enable (the same) quota (count) for all (virtual)users, > on Debian Stretch, Postfix 3.1.8, Dovecot 2.2.27, > and is not clear for me if I need to tell Postfix to communicate with the service in /etc/postfix/main.cf as here: > > > smtpd_recipient_restrictions > ??? ... > ??? check_policy_service inet:mailstore.example.com:12340I configured it like your example above and it works for me. Best Urban
Yassine Chaouche
2019-Mar-20 08:16 UTC
Dovecot quota and Postfix smtpd_recipient_restrictions?
On 3/19/19 6:00 PM, Davide Marchi via dovecot wrote:> [...] is not clear for me if I need to tell Postfix to communicate > with the service in /etc/postfix/main.cf as here: > > > smtpd_recipient_restrictions > ??? ... > ??? check_policy_service inet:mailstore.example.com:12340 > > DavideHey Davide, You don't *have* to, but you can. Now whether you should or shouldn't is up to you. The downside of enabling this is that if John is over quota, then if you try to send a mail to three recipients John, Mary and Socrates postfix will refuse to relay mail for any of them, even if only John is over quota. This has confused my users who couldn't understand why things were like this, but apparently this is how postfix is designed to work ? (or is it a protocol limitation ?) I don't know if other people here can testify of this or have they found a way to circumvent this ? (or more likely is it simply a bad configuration on my part ^:^' ?) Yassine.