Postfix After-Queue Content Filter
Introduction
This document requires Postfix version 2.1 or later.
Normally, Postfix receives mail, stores it in the mail queue
and then delivers it. With the external content filter described
here, mail is filtered AFTER it is queued. This approach decouples
mail receiving processes from mail filtering processes, and gives
you maximal control over how many filtering processes you are
willing to run in parallel.
The after-queue content filter is meant to be used as follows:
Network or local users |
-> |
Postfix queue |
-> |
Content filter |
-> |
Postfix queue |
-> |
Network or local mailbox |
This document describes implementations that use a single
Postfix instance for everything: receiving, filtering and delivering
mail. Applications that use two separate Postfix instances will
be covered by a later version of this document.
The after-queue content filter is not to be confused with the
approach that is described in the
SMTPD_PROXY_README document,
where incoming SMTP mail is filtered BEFORE it is stored into the
Postfix queue.
This document describes two approaches to content filter
all email, as well as several options to filter mail selectively: