Davide Marchi
2019-Mar-20 09:45 UTC
Dovecot quota and Postfix smtpd_recipient_restrictions?
> From: Urban Loesch > > 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:12340 > I configured it like your example above and it works for me. > > Best > UrbanWell, so the right syntax (in my case) would be: -o smtpd_recipient_restrictions = reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject,check_policy_service inet:mailstore.example.com:12340 right? :-) And eventually, should you suggest me how made some functional verification test? Many many many thanks Urban!! ;-) Davide
Urban Loesch
2019-Mar-20 10:37 UTC
Dovecot quota and Postfix smtpd_recipient_restrictions?
Hi,> Well, > > so the right syntax (in my case) would be: > > -o smtpd_recipient_restrictions = reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject,check_policy_service > inet:mailstore.example.com:12340 > > right?? :-)I configured it before the "permit_sasl_authenticated" and the "reject" statement.> > > And eventually, should you suggest me how made some functional verification test?According to: http://www.postfix.org/SMTPD_POLICY_README.html try on your postfix: telnet mailstore.example.com 12340 and insert the following lines: sender=somesender at somedomain.com recipient=your at recipient.com size=12345 [empty line] Set a size= in bytes which is greater that your configured quota. In theory the policy service should respond with your configured error message "552 5.2.2 Mailbox is full". Example on my server: ... sender=postmaster at somedomain.com recipient=my at recipient.com size=123450000000 action=552 5.2.2 Mailbox is full ... For a livetest reduce the quota of your testaccount to ex. 100KB and the send a mail > 100BK from outside to it. You should see the "552" error message in your logs and you should get back a bouncemail from the sending server. Hope I explained it correct. Best Urban