On Fri, Mar 13, 2015 at 01:46:07PM -0700, Brainslug wrote:

> Is it possible to configure postfix to accept all incoming email regardless
> of size but decline all outgoing email exceeding a predefined size limit?

You'll need to use separate smtpd(8) listener for the outbound mail
and an associated cleanup service for that smtpd(8), both with
appropriate message_size_limit values.  Minimally separate master.cf
entries, better a separate Postfix instance (MULTI_INSTANCE_README),
or even a separate machine.

The separate smtpd can "message_size_limit" to the desired limit,
while the main.cf limit is set much higher.  That way clients that
understand ESMTP "SIZE" won't waste time sending large mails only
to see them rejected.

> If I set message_size_limit in main.cf, it is applied to both, incoming and
> outgoing email, which is not what I need.

Add a master.cf override for just the smtpd(8) with the lower than
global limit, and its associated cleanup service.  However, a
separate Postfix intance for outbound mail is better in the long-run.

-- 
        Viktor.

Reply via email to