On Sat, Aug 22, 2015 at 02:06:42PM +0200, Alexandre Ellert wrote:

> I have two Postfix inbound servers which serve multiple domain and I'd
> like to accept 20 Mb email for all domain except one (I want 10 Mb limit
> for this one).

> In main.cf I set message_size_limit = 20971520 and I use a policy server
> (postfwd) to check the recipient and the mail size.

Is the policy service check in "smtpd_recipient_restrictions", in
"smtpd_end_of_data_restrictions" or both?

> I configured postfwd that way : when the recipient belongs to the 10Mb
> domain and the size attribute is over 10 MB, then  return a 5xx error.
> In most case, it works but sometime it doesn't and I don't understand why
> and how to debug?

The message size is not always known at "RCPT TO" time, the real
size is known only at "end of data" time.  However Postfix does
not store the full recipient list in memory, so your policy service
would have the compute the lowest per-recipient message size as
each recipient goes by, and then apply that limit at "end of data"
time (using "instance" attribute to correlate the recipients with
each other and the final end-of-data check).

-- 
        Viktor.

Reply via email to