Re: max-message-size

2021-07-13 Thread Pete


You're right. After a second thought i guess it's not a very good idea.




Re: max-message-size

2021-07-12 Thread Maarten de Vries
On Mon, 12 Jul 2021 at 20:36, Pete  wrote:

> Would it be possible to add an max-msgsize option to the match clause to
> get the desired result?
>
>
>
That might be a potential footgun if it means messages that are too large
end up with a subsequent match. Although careful documentation could maybe
alleviate that concern.

-- Maarten


Re: max-message-size

2021-07-12 Thread Pete
Would it be possible to add an max-msgsize option to the match clause to get 
the desired result?




Re: max-message-size

2021-07-12 Thread Martijn van Duren
This area of the code is not my strong suit, so my answer might be a
bit rough around the edges.

First of, a max-message-size-send doesn't make sense, since from the
perspective of smtpd an mbox delivery and relay are basically the
same, it's just some different backend code. So having a
max-message-size-recv of 35MB and max-message-size-send of 10MB would
result in the same behaviour in all cases: the limit will be 10MB.

If you want to expand on the train of thought and place a
max-message-size on action, this won't have the desired effect either,
because of the way smtpd is structured. A mail transaction works in
two phases.
In the first phase a mail is received (e.g. over smtp) and stored in a
backend (usually a file on disk) including some metadata.
In the second phase a mail and metadata is retrieved from the backend
and an appropriate action is choosen (e.g. relaying)

The problem arrises from the fact that these two phases are completely
independent from each other. As soon as a mail is committed ("." line in
the body) we can only state that we received it correctly and that it's
safe. If the commit is confirmed we can't be sure that it's send right
away (network issues, untimely restart of smtpd, ...). Now if during the
receiving and sending a config reload takes place we can't be sure that
the original action is still there or maybe the action changed because
the match rules changed.

This doesn't even include any issues further down the mail-path, e.g.
a final recipient might have a limit of 5MB. That's why we have the
report mails.

If you really do want this I suggest that you set up different servers
for incoming and outgoing mails.

martijn@

On Mon, 2021-07-12 at 13:44 +, Kent Watsen wrote:
> Would it be okay to add direction-specific versions of "max-message-size", 
> e.g., "max-message-size-send” and "max-message-size-recv”?
> 
> Reason:
> 
> My outbound email relay provider (amazonses) limits outbound message size to 
> 10M.   If I don’t set "max-message-size 10M” and accidentally send a larger 
> message, then my SMTP-client thinks the
> message is “sent” even though the backend relay fails.  Silent failures are 
> unacceptable to me, so I set "max-message-size 10M”.
> 
> But setting "max-message-size 10M” also limits inbound messages and I have a 
> contacts that like to send large attachments from time to time.  Fortunately 
> they do receive a “server reject due to
> size” message, and so know to instead try again by sending a link to some 
> file-service (e.g., dropbox), but apparently it’s enough of a hassle for them 
> to complain about.
> 
> 
> Thank you for your consideration.
> 
> Kent
> 
>