From: "Sharma, Ashish" on
Hi,

I just want to confirm my two observations that I read from Postfix documentation:

1. In before queue mail filter (milter) the email is not put in postfix queue until it's passed by milters successfully, only after email gets passed through milters then only email is received fully from foreign email server..

2. In after queue content filter, the email is passed to the content filter from postfix queue and only if it's reinjected back into postfix, postfix have a reference of it else the email is lost and no reference etc is maintained in the postfix mail queue.

Am I correct?

Thanks in advance

Ashish Sharma

From: Wietse Venema on
Sharma, Ashish:
> Hi,
>
> I just want to confirm my two observations that I read from Postfix documentation:
>
> 1. In before queue mail filter (milter) the email is not put in
> postfix queue until it's passed by milters successfully, only
> after email gets passed through milters then only email is received
> fully from foreign email server.

Conforming to the SMTP standard, the Postfix SMTP server replies
"250 OK" to end-of-data AFTER the message is committed to the mail
queue.

This is regardless of whether there is a filter between the
Postfix SMTP server and the queue.

> 2. In after queue content filter, the email is passed to the
> content filter from postfix queue and only if it's reinjected back
> into postfix, postfix have a reference of it else the email is
> lost and no reference etc is maintained in the postfix mail queue.

Conforming to the SMTP standard, the Postfix SMTP client will remove
the recipient from the queue file after the Postfix SMTP client
receives "250 OK" in response to end-of-data (and the queue manager
removes queue files that have no left-over recipients).

This is regardless of whether the Postfix SMTP client delivers mail
to a content filter.

As documented in FILTER_README, it is the responsibility of the
content filter to discard the message, to quarantine the message,
to send the filtered mail back into the same Postfix instance, or
to send filtered mail into a different MTA instance (Postfix or
non-Postfix).

With Postfix 2.6 and later, using two Postfix instances makes
"after-queue" content inspection easier to manage.

Wietse