PCRE_README   [plain text]


PCRE (Perl Compatible Regular Expressions) map support
======================================================

The optional "pcre" map type allows you to specify regular expressions
with the PERL style notation such as \s for space and \S for
non-space.

One possible use is to add a restriction to main.cf:

   smtpd_recipient_restrictions = ... pcre:/etc/postfix/smtprecipient ...

The regular expressions are read from the file specified - sample
regexp patterns are shown in the Postfix pcre_table(5) manual page.

Building Postfix with PCRE support
==================================

In the future, Postfix will have a plug-in interface for adding
map types. Until then you need to compile PCRE support into Postfix.

You need the PCRE library (Perl Compatible Regular Expressions),
which can be obtained from:

   ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/

Postfix was tested with PCRE versions 2.8 and 3.7.

In order to build Postfix with PCRE support you need to add -DHAS_PCRE
and a -I for the PCRE include file to CCARGS, and add the path to the
PCRE library to AUXLIBS, for example:

   make -f Makefile.init makefiles \
	"CCARGS=-DHAS_PCRE -I/usr/local/include" \
	"AUXLIBS=-L/usr/local/lib -lpcre"

NOTE: pcre versions prior to 2.06 cannot be used.

Things to know
==============

For the sake of robustness, Postfix disables the matching of partial
addresses (breaking down user@domain into user@, domain, user,
@domain) that is normally done with Postfix access control tables,
canonical maps and virtual maps.

An additional restriction is that regular expression tables cannot
be used for local alias database lookups.  That would be a security
exposure anyway.