On 2/27/2018 2:06 PM, SAAHIL IFTEKHAR wrote:
> Hi
> 
> My setup contains Postfix 2.10.1, Dovecot 2.2.10 on RHEL 7.3. The
> feature I tried to implement is "quota status to postfix". 
> 
> The configuration for this feature needs to be done both in dovecot
> and postfix. Though more configuration are from dovecot side but
> error is coming from postfix side configuration.
> 
> I have implemented Quota status to postfix in our setup. I have an
> imap server (dovecot) and mail server (postfix) in every node. I am
> able to send quota status to postfix and mails are rejected after
> 100% mail quota is crossed. This rejection is happening both in
> across the nodes and within the nodes.
> 
> The problem is if I am sending mails to any node and if any other
> node's dovecot is down, mails are not going. For example, I am
> sending an email within the system but if some other node's dovecot
> is down then email within the system also will not go.
> 
> My dovecot version is 2.2.10.
> My postfix version is 2.1.10.
> 
> *doveconf -n output is below:-*

... dovecot config irrelevant.

> Here "service quota status" is the concerned section in conf file.
> ________________________________________________________________________________________________________
> 
> *Postfix configuration is below:- *
> 
> smtpd_relay_restrictions =
>           check_policy_service inet:201.123.80.9:54317 
> <http://201.123.80.9:54317>
>           check_policy_service inet:201.123.80.23:54317 
> <http://201.123.80.23:54317>


Nitpick: this should really be in smtpd_recipient_restrictions, not
relay restrictions.

(unneeded debug output stripped)

> Feb 22 12:43:25 1CorpHQ postfix/smtpd[7326]: warning: problem talking to
> server 201.123.80.9:54317 <http://201.123.80.9:54317>: Connection refused
> Feb 22 12:43:25 1CorpHQ postfix/smtpd[7326]: NOQUEUE: reject: RCPT from
> 1CorpHQ[201.123.80.23]: 451 4.3.5 Server configuration problem; from=<
> [email protected] <mailto:[email protected]>> 
> to=<[email protected] <mailto:[email protected]>> proto=ESMTP
> helo=<1CorpHQ>

Postfix here does the only reasonable thing: mail is deferred to the
sender to try again later.


Instead of asking every server about quota for every recipient, just
ask the server where the recipient resides.

Something like (untested, but the general idea is sound):
# main.cf
smtpd_restriction_classes =
  quota_server9
  quota_server23

quota_server9 =
   check_policy_service inet:201.123.80.9:54317

quota_server23 =
   check_policy_service inet:201.123.80.23:54317

smtpd_relay_restrictions =
(use what is appropriate for your site, such as:)
   permit_mynetworks
   permit_sasl_authenticated

smtpd_recipient_restrictions =
   check_recipient_access hash:/etc/postfix/check_quota
... other restrictions as appropriate


# /etc/postfix/check_quota
[email protected]   quota_server9
[email protected]   quota_server9
[email protected]   quota_server23
[email protected]   quota_server23


This example uses a hash: map, but any supported map type can be used.

This example method will scale nicely to a few servers.  If you have
hundreds of servers, the postfix config will become unmanageable and
require a different solution.


Reference:
http://www.postfix.org/RESTRICTION_CLASS_README.html
http://www.postfix.org/SMTPD_POLICY_README.html
http://www.postfix.org/DATABASE_README.html
http://www.postfix.org/documentation.html




  -- Noel Jones

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Reply via email to