different message_size_limit per smtpd

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

different message_size_limit per smtpd

A. Schulze

Hello,

My goal is to allow different message size on MX and submission.
As message_size_limit is a cleanup option, this is my (non working) setup
based on http://www.postfix.org/BUILTIN_FILTER_README.html#mx_submission

main.cf
       message_size_limit = 5120000

master.cf
       # define a separate cleanup service
       submission-cleanup                     unix  n - - -     0 cleanup
         -o syslog_name=postfix/submission
         -o message_size_limit=40000000

       # MX smtpd use default cleanup with size=5 MB
       smtp                                   inet  n - - -     - smtpd

       # Submission smtpd use separate cleanup with size=40 MB
       587                                    inet  n - - -     - smtpd
        -o cleanup_service_name=submission-cleanup
        -o smtpd_recipient_restrictions=permit_tls_clientcerts,reject
        -o syslog_name=postfix/submission

But that don't work as intended. Both smtpd announce size=5MB
Running multiple postfix instances should solve the problem.
are there other solutions?

Thanks
Andreas


Reply | Threaded
Open this post in threaded view
|

Re: different message_size_limit per smtpd

Wietse Venema
A. Schulze:
>
> Hello,
>
> My goal is to allow different message size on MX and submission.
> As message_size_limit is a cleanup option, this is my (non working) setup
> based on http://www.postfix.org/BUILTIN_FILTER_README.html#mx_submission

The SMTP daemon also enforces the message size limit independently.
You can therefore specify different limits on the submission and
port25 services.

However, those limits cannot be larger than the limit that is
enforced by the cleanup daemon.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: different message_size_limit per smtpd

@lbutlr
On 20 Nov 2019, at 08:16, Wietse Venema <[hidden email]> wrote:
> A. Schulze:
>> My goal is to allow different message size on MX and submission.
>> As message_size_limit is a cleanup option, this is my (non working) setup
>> based on http://www.postfix.org/BUILTIN_FILTER_README.html#mx_submission

> The SMTP daemon also enforces the message size limit independently.
> You can therefore specify different limits on the submission and
> port25 services.
>
> However, those limits cannot be larger than the limit that is
> enforced by the cleanup daemon.

How do you set a different limit in cleanup then? Or do you set message_size_limit to the maximum size for submission and then set a separate limit for smtpd? How would you do that?

main.cf:
   message_size_limit=40000000

smtp                                    inet  n - - -     - smtpd
      -o message_size_limit= 5120000

And leave submission alone?


--
"He is not only dull himself; he is the cause of dullness in others."
Samuel Johnson

Reply | Threaded
Open this post in threaded view
|

Re: different message_size_limit per smtpd (solved)

A. Schulze


Am 20.11.19 um 17:57 schrieb @lbutlr:

>> The SMTP daemon also enforces the message size limit independently.
>> You can therefore specify different limits on the submission and
>> port25 services.
>>
>> However, those limits cannot be larger than the limit that is
>> enforced by the cleanup daemon.
>
> How do you set a different limit in cleanup then? Or do you set message_size_limit to the maximum size for submission and then set a separate limit for smtpd? How would you do that?
>
> main.cf:
>    message_size_limit=40000000
>
> smtp                                    inet  n - - -     - smtpd
>       -o message_size_limit= 5120000
>
> And leave submission alone?
just verified it work exactly this way...

Andreas
 
Reply | Threaded
Open this post in threaded view
|

Re: different message_size_limit per smtpd (solved)

Viktor Dukhovni
> On Nov 20, 2019, at 12:38 PM, A. Schulze <[hidden email]> wrote:
>
>>> The SMTP daemon also enforces the message size limit independently.
>>> You can therefore specify different limits on the submission and
>>> port25 services.
>>>
>>> However, those limits cannot be larger than the limit that is
>>> enforced by the cleanup daemon.
>>
>> How do you set a different limit in cleanup then? Or do you set message_size_limit to the maximum size for submission and then set a separate limit for smtpd? How would you do that?
>>
>> main.cf:
>>   message_size_limit=40000000
>>
>> smtp                                    inet  n - - -     - smtpd
>>      -o message_size_limit= 5120000
>>
>> And leave submission alone?
> just verified it work exactly this way...

Just make sure that message_size_limit is never smaller for any
of the backend components that process the message, this includes
cleanup and delivery agents.  Therefore, the main.cf setting must
be the maximum of any values you set in any smtpd(8) or in
postdrop(8).

--
--
        Viktor.