On 30 Nov 2016, at 20:20, Michael Munger wrote:

First, there can be no TO address before the client sends MAIL FROM.
Second, the size check is done before checking the sender address,
presumably because it is more efficient that way. But I guess some
code could be swapped around.

My mistake. I thought:

552 5.3.4 Message size exceeds fixed limit;

I did not know that the message size was declared prior to the MAIL FROM
and RCPT TO commands.

I figured it would come either after the DATA command or after the
message was received so that it could calculate sizes. I'll rethink my
strategy here.

See https://tools.ietf.org/html/rfc1870

Maximum message size is advertised in the EHLO response and senders can announce message size as an extra argument to MAIL. Many SMTP clients honor the advertised maximum and simply QUIT the session if it is too small, others proceed to MAIL with the SIZE argument and get rejected explicitly there (that 552 reply.)

I have been scouring the docs to determine what checks are perform when
and in what order. I assume they follow the SMTP prtocol (HELO checks
first, MAIL FROM checks next, RCPT TO checks next, and so on...).

I found the architecture readme, which is excellent. Is there a list of
which programs do which checks? I could assemble a list from there.
Unless you (or someone) already had such a list?

You can get most of this in the postconf(5) man page, and whatever isn't detailed there will be in the man pages for the various Postfix components. The Postfix README files are great for a high-level instructional view of how it all works, but for the full technical details you really need to look at man pages.

Reply via email to