On 7 Sep 2018, at 16:14, Viktor Dukhovni wrote:
On Sep 7, 2018, at 4:04 PM, Kevin Miller <[email protected]>
wrote:
When someone sends an attachment via email that exceeds our limit,
I'd like to return a custom error message directing them to our
in-house web based file upload/download utility (similar to Dropbox
in functionality). I've looked at the bounce.cf options, but I don't
see an option to address message size. Is that a possibility?
Oversize messages are not "bounced" by a receiving server, they are
rejected.
The custom message would have to be a change in the Postfix source
code that
rejects messages that exceed the message size limit.
Even worse (from a customization perspective) Postfix advertises the
message_size_limit in its reply to EHLO, which many SMTP clients will
detect and honor without sending a MAIL command at all for the server to
reply to. Such clients simply disconnect and construct their own message
to pass back to the sender about the oversize mail. Nothing you do to
Postfix, even in the source code, will let you customize what the sender
sees in those cases.