~ubuntu-branches/ubuntu/hoary/postfix/hoary-security

« back to all changes in this revision

Viewing changes to README_FILES/PCRE_README

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-10-06 11:50:33 UTC
  • Revision ID: james.westby@ubuntu.com-20041006115033-ooo6yfg6kmoteu04
Tags: upstream-2.1.3
ImportĀ upstreamĀ versionĀ 2.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
PPoossttffiixx PPCCRREE SSuuppppoorrtt
 
2
 
 
3
-------------------------------------------------------------------------------
 
4
 
 
5
PPCCRREE ((PPeerrll CCoommppaattiibbllee RReegguullaarr EExxpprreessssiioonnss)) mmaapp ssuuppppoorrtt
 
6
 
 
7
The optional "pcre" map type allows you to specify regular expressions with the
 
8
PERL style notation such as \s for space and \S for non-space. The main
 
9
benefit, however, is that pcre lookups are often faster than regexp lookups.
 
10
This is because the pcre implementation is often more efficient than the POSIX
 
11
regular expression implementation that you find on many systems.
 
12
 
 
13
A description of how to use pcre tables, including examples, is given in the
 
14
pcre_table(5) manual page. Information about PCRE itself can be found at http:/
 
15
/www.pcre.org/.
 
16
 
 
17
BBuuiillddiinngg PPoossttffiixx wwiitthh PPCCRREE ssuuppppoorrtt
 
18
 
 
19
Note: to use pcre with Debian GNU/Linux's Postfix, all you need is to install
 
20
the postfix-pcre package and you're done. There is no need to recompile
 
21
Postfix.
 
22
 
 
23
In some future, Postfix will have a plug-in interface for adding map types.
 
24
Until then, you need to compile PCRE support into Postfix.
 
25
 
 
26
First of all, you need the PCRE library (Perl Compatible Regular Expressions),
 
27
which can be obtained from:
 
28
 
 
29
    ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/.
 
30
 
 
31
NOTE: pcre versions prior to 2.06 cannot be used.
 
32
 
 
33
In order to build Postfix with PCRE support you need to add -DHAS_PCRE and a -
 
34
I for the PCRE include file to CCARGS, and add the path to the PCRE library to
 
35
AUXLIBS, for example:
 
36
 
 
37
    make -f Makefile.init makefiles \
 
38
        "CCARGS=-DHAS_PCRE -I/usr/local/include" \
 
39
        "AUXLIBS=-L/usr/local/lib -lpcre"
 
40
 
 
41
TThhiinnggss ttoo kknnooww
 
42
 
 
43
  * When Postfix searches a pcre: or regexp: lookup table, each pattern is
 
44
    applied to the entire input string. Depending on the application, that
 
45
    string is an entire client hostname, an entire client IP address, or an
 
46
    entire mail address. Thus, no parent domain or parent network search is
 
47
    done, "user@domain" mail addresses are not broken up into their user and
 
48
    domain constituent parts, and "user+foo" is not broken up into user and
 
49
    foo.
 
50
 
 
51
  * Regular expression tables such as pcre: or regexp: are not allowed to do
 
52
    $number substitution in lookup results that can be security sensitive:
 
53
    currently, that restriction applies to the local aliases(5) database or the
 
54
    virtual(8) delivery agent tables.
 
55