The before-filter Postfix SMTP server connects to the content
filter, delivers one message, and disconnects. While sending mail
into the content filter, Postfix speaks ESMTP but uses no command
pipelining. Postfix generates its own EHLO, XFORWARD (for logging
the remote client IP address instead of localhost[127.0.0.1]), DATA
and QUIT commands, and forwards unmodified copies of all the MAIL
FROM and RCPT TO commands that the before-filter Postfix SMTP server
didn't reject itself.
Postfix sends no other SMTP commands.
The content filter should accept the same MAIL FROM and RCPT
TO command syntax as the before-filter Postfix SMTP server, and
should forward the commands without modification to the after-filter
SMTP server. If the content filter or after-filter SMTP server
does not support all the ESMTP features that the before-filter
Postfix SMTP server supports, then the missing features must be
turned off in the before-filter Postfix SMTP server with the
When the filter rejects content, it should send a negative SMTP
response back to the before-filter Postfix SMTP server, and it
should abort the connection with the after-filter Postfix SMTP
server without completing the SMTP conversation with the after-filter
Postfix SMTP server.