Postfix SMTP Access Policy Delegation
Purpose of Postfix SMTP access policy delegation
The Postfix SMTP server has a number of built-in mechanisms to
block or accept mail at specific SMTP protocol stages. As of version
2.1, Postfix can delegate policy decisions to an external server
that runs outside Postfix.
With this policy delegation mechanism, a simple
greylist policy can be implemented with only a dozen lines of
Perl, as is shown at the end of this document. Another example of
policy delegation is the SPF policy server by Meng Wong at
https://spf.pobox.com/. Examples of both policies can be found in
the Postfix source code, in the directory examples/smtpd-policy.
Policy delegation is now the preferred method for adding policies
to Postfix. It's much easier to develop a new feature in few lines
of Perl, than trying to do the same in C code. The difference in
performance will be unnoticeable except in the most demanding
environments. On active systems a policy daemon process is used
multiple times, for up to $
max_use incoming SMTP connections.
This document covers the following topics: