]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-1.1.11-20020917
authorWietse Venema <wietse@porcupine.org>
Tue, 17 Sep 2002 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:28:14 +0000 (06:28 +0000)
41 files changed:
postfix/HISTORY
postfix/RELEASE_NOTES
postfix/conf/access
postfix/conf/canonical
postfix/conf/main.cf
postfix/conf/pcre_table
postfix/conf/regexp_table
postfix/conf/sample-filter.cf
postfix/conf/sample-pcre-access.cf
postfix/conf/sample-pcre-body.cf
postfix/conf/sample-pcre-header.cf
postfix/conf/sample-regexp-access.cf
postfix/conf/sample-regexp-body.cf
postfix/conf/sample-regexp-header.cf
postfix/conf/transport
postfix/conf/virtual
postfix/html/access.5.html
postfix/html/canonical.5.html
postfix/html/pcre_table.5.html
postfix/html/pipe.8.html
postfix/html/regexp_table.5.html
postfix/html/transport.5.html
postfix/html/virtual.5.html
postfix/makedefs
postfix/man/man5/access.5
postfix/man/man5/canonical.5
postfix/man/man5/pcre_table.5
postfix/man/man5/regexp_table.5
postfix/man/man5/transport.5
postfix/man/man5/virtual.5
postfix/man/man8/pipe.8
postfix/proto/access
postfix/proto/canonical
postfix/proto/pcre_table
postfix/proto/regexp_table
postfix/proto/transport
postfix/proto/virtual
postfix/src/global/mail_version.h
postfix/src/pipe/pipe.c
postfix/src/util/dict_pcre.c
postfix/src/util/dict_regexp.c

index d69f0f425fbf4c7abfa381d65cabaabfbc2d1325..fb84cba05114d795d0562f7da4aaee671327e153 100644 (file)
@@ -6963,6 +6963,12 @@ Apologies for any names omitted.
        This involved a rewrite of the pcre map code similar to
        the regexp map code.  File:  util/dict_pcre.c.
 
+20020917
+
+       Feature: on Linux, support for PCRE lookup tables is now
+       compiled in if the PCRE library code is found under
+       /usr/include and /usr/lib.  File: makedefs.
+
 Open problems:
 
        Low: smtpd should log queue ID with reject/warn/hold/discard
index d8fdc327e3081fe7b88c08c14f36f6f9cdd481e0..b8542435dd928c8a0b5a63f27fa570bf7fb09fb4 100644 (file)
@@ -12,30 +12,35 @@ snapshot release).  Patches change the patchlevel and the release
 date. Snapshots change only the release date, unless they include
 the same bugfixes as a patch release.
 
-Incompatible changes with Postfix snapshot 1.1.11-20020916
+Incompatible changes with Postfix snapshot 1.1.11-20020917
 ==========================================================
 
 The relayhost setting now behaves as documented, i.e. you can no
 longer specify multiple destinations.
 
-Major changes with Postfix snapshot 1.1.11-20020916
+In regexp lookup tables, the form /pattern1/!/pattern2/ is going
+away. Use the cleaner and more flexible "if !/pattern2/..endif"
+form.  The old form still exists but is no longer documented.
+
+Major changes with Postfix snapshot 1.1.11-20020917
 ===================================================
 
-Speedups of regexp table lookups by optimizing the compilation and
-execution settings for the actual number of $number substitutions
-in the right-hand side.  Based on a suggestion by Liviu Daia.
+Speedups of regexp table lookups by optimizing for the $number
+substitutions that are actually present in the right-hand side.
+Based on a suggestion by Liviu Daia.
 
-Speedups of regexp and pcre tables, using IF..ENDIF support based
-on an idea by Bert Driehuis. To protect a block of patterns, use:
+Speedups of regexp and pcre tables, using IF..ENDIF support. Based
+on an idea by Bert Driehuis.  To protect a block of patterns, use:
 
-    if /pattern/
-    /pattern2/ replacement text1
-    /pattern2/ replacement text2
+    if /pattern1/
+    /pattern2/ result2
+    /pattern3/ result3
     endif
 
 IF..ENDIF can nest. Don't specify blanks at the beginning of lines
-inside IF..ENDIF. Lines beginning with whitespace are appended to
-the previous line.
+inside IF..ENDIF, because lines beginning with whitespace are
+appended to the previous line. More details about the syntax are
+given in the pcre_table(5) and regexp_table(5) manual pages.
 
 Incompatible changes with Postfix snapshot 1.1.11-20020906
 ==========================================================
index 9de3e55241caf54dd734fd9c8a487c352be589d7..3dcd6000ed005b441f4b3e9d2c9684568c7ca6e8 100644 (file)
@@ -6,6 +6,10 @@
 # SYNOPSIS
 #        postmap /etc/postfix/access
 # 
+#        postmap -q "string" /etc/postfix/access
+# 
+#        postmap -q - /etc/postfix/access <inputfile
+# 
 # DESCRIPTION
 #        The  optional access table directs the Postfix SMTP server
 #        to selectively  reject  or  accept  mail.  Access  can  be
index b7528ae7a9f304857a80d1a2f79d10076711b09a..82214a0b017888789eb651d79df1141737e0753e 100644 (file)
@@ -1,4 +1,3 @@
-# 
 # CANONICAL(5)                                         CANONICAL(5)
 # 
 # NAME
@@ -7,6 +6,10 @@
 # SYNOPSIS
 #        postmap /etc/postfix/canonical
 # 
+#        postmap -q "string" /etc/postfix/canonical
+# 
+#        postmap -q - /etc/postfix/canonical <inputfile
+# 
 # DESCRIPTION
 #        The  optional canonical table specifies an address mapping
 #        for local and non-local addresses. The mapping is used  by
 #        P.O. Box 704
 #        Yorktown Heights, NY 10598, USA
 # 
-#                                                                 1
-# 
+#                                                      CANONICAL(5)
index 1aee92cc6dc90820ddae520b6aeb7dc2a2d56058..f3528a70cf21ef7a51e763dd873b55544e017a50 100644 (file)
@@ -411,38 +411,13 @@ mail_owner = postfix
 
 # The header_checks parameter specifies an optional table with patterns
 # that each logical message header is matched against, including
-# headers that span multiple physical lines.  Patterns are matched
-# in the specified order, and the search stops upon the first match.
-# When a pattern matches, what happens next depends on the associated
-# action that is specified in the right-hand side of the table:
-#
-# REJECT [optional text...]
-#       Reject the entire message. The optional text is sent to the
-#       originator and is logged to the maillog file.
-# IGNORE Silently discard the header line.
-# WARN [optional text...]
-#       Log the message header and the optional text. This is useful
-#       for testing. When the pattern is OK, change the WARN into a
-#       REJECT or into a DISCARD.
-# HOLD [optional text...]
-#       Place the message on the hold queue. Mail on hold can be
-#       inspected with the postcat command, and can be destroyed or
-#       taken off hold (i.e. delivered) with the postsuper command.
-#      The matched header is logged with the optional text.
-# DISCARD [optional text...]
-#       Claim successful delivery and silently discard the message.
-#      The matched header is logged with the optional text.
-# FILTER transport:nexthop
-#      after the message is queued, send the entire message through
-#      a content filter. This requires different cleanup servers
-#      before and after the filter, with header/body checks turned
-#      off in the second cleanup server.
+# headers that span multiple physical lines.
 #
 # By default, these patterns also apply to MIME headers and to the
 # headers of attached messages. With older Postfix versions, MIME and
 # attached message headers were treated as body text.
 #
-# See also the body_checks example in the sample-filter.cf file.
+# For details, see the sample-filter.cf file.
 #
 #header_checks = regexp:/etc/postfix/header_checks
 
index 6039eadee91cfee63c9d0c53396b619003aad43a..c8db65bac1a2060b474dc854a3a8f9365d04ed62 100644 (file)
@@ -6,6 +6,10 @@
 # SYNOPSIS
 #        pcre:/etc/postfix/filename
 # 
+#        postmap -q "string" pcre:/etc/postfix/filename
+# 
+#        postmap -q - pcre:/etc/postfix/filename <inputfile
+# 
 # DESCRIPTION
 #        The  Postfix  mail system uses optional tables for address
 #        rewriting or mail routing. These tables are usually in dbm
 #        To find out what types of lookup tables your Postfix  sys-
 #        tem supports use the postconf -m command.
 # 
+#        To   test  lookup  tables,  use  the  postmap  command  as
+#        described in the SYNOPSIS above.
+# 
 #        The general form of a PCRE table is:
 # 
-#        pattern result
-#               When  pattern matches a search string, use the cor-
-#               responding result.
+#        /pattern/flags result
+#               When pattern matches a search string, use the  cor-
+#               responding result value.
 # 
 #        blank lines and comments
-#               Empty lines and whitespace-only lines are  ignored,
-#               as  are  lines whose first non-whitespace character
+#               Empty  lines and whitespace-only lines are ignored,
+#               as are lines whose first  non-whitespace  character
 #               is a `#'.
 # 
 #        multi-line text
-#               A logical line starts with non-whitespace  text.  A
-#               line  that starts with whitespace continues a logi-
+#               A  logical  line starts with non-whitespace text. A
+#               line that starts with whitespace continues a  logi-
 #               cal line.
 # 
+#        if /pattern/flags
+# 
+#        endif  Examine the lines between if..endif only if pattern
+#               matches. The if..endif can nest.   Do  not  prepend
+#               whitespace to patterns inside if..endif.
+# 
 #        Each  pattern  is  a  perl-like  regular  expression.  The
-#        expression  delimiter can be any character, except whites-
-#        pace or characters that have special  meaning  (tradition-
-#        ally  the  forward slash is used).  The regular expression
+#        expression delimiter can be any character, except  whites-
+#        pace  or  characters that have special meaning (tradition-
+#        ally the forward slash is used).  The  regular  expression
 #        can contain whitespace.
 # 
 #        By default, matching is case-insensitive, and newlines are
-#        not  treated  as  special characters. The behavior is con-
-#        trolled by flags, which are toggled by  appending  one  or
+#        not treated as special characters. The  behavior  is  con-
+#        trolled  by  flags,  which are toggled by appending one or
 #        more of the following characters after the pattern:
 # 
 #        i (default: on)
-#               Toggles  the  case  sensitivity  flag.  By default,
+#               Toggles the  case  sensitivity  flag.  By  default,
 #               matching is case insensitive.
 # 
 #        m (default: off)
-#               Toggles the PCRE_MULTILINE flag. When this flag  is
-#               on,  the  ^  and $ metacharacters match immediately
-#               after and immediately before a  newline  character,
-#               respectively,  in addition to matching at the start
+#               Toggles  the PCRE_MULTILINE flag. When this flag is
+#               on, the ^ and $  metacharacters  match  immediately
+#               after  and  immediately before a newline character,
+#               respectively, in addition to matching at the  start
 #               and end of the subject string.
 # 
 #        s (default: on)
 #               Toggles the PCRE_DOTALL flag. When this flag is on,
 #               the .  metacharacter matches the newline character.
-#               With Postfix versions prior to 20020528,  The  flag
+#               With  Postfix  versions prior to 20020528, The flag
 #               is off by default, which is inconvenient for multi-
 #               line message header matching.
 # 
 #        x (default: off)
-#               Toggles the pcre extended flag. When this  flag  is
-#               on,  whitespace  in  the  pattern  (other than in a
+#               Toggles  the  pcre extended flag. When this flag is
+#               on, whitespace in the  pattern  (other  than  in  a
 #               character class) and characters between a # outside
-#               a  character  class  and the next newline character
-#               are ignored. An escaping backslash can be  used  to
-#               include  a whitespace or # character as part of the
+#               a character class and the  next  newline  character
+#               are  ignored.  An escaping backslash can be used to
+#               include a whitespace or # character as part of  the
 #               pattern.
 # 
 #        A (default: off)
-#               Toggles the PCRE_ANCHORED flag.  When this flag  is
-#               on,  the  pattern  is forced to be "anchored", that
+#               Toggles  the PCRE_ANCHORED flag.  When this flag is
+#               on, the pattern is forced to  be  "anchored",  that
 #               is, it is constrained to match only at the start of
-#               the  string  which  is being searched (the "subject
-#               string"). This  effect  can  also  be  achieved  by
+#               the string which is being  searched  (the  "subject
+#               string").  This  effect  can  also  be  achieved by
 #               appropriate constructs in the pattern itself.
 # 
 #        E (default: off)
-#               Toggles  the  PCRE_DOLLAR_ENDONLY  flag.  When this
-#               flag is  on,  a  $  metacharacter  in  the  pattern
-#               matches  only  at  the  end  of the subject string.
-#               Without this flag, a dollar  also  matches  immedi-
+#               Toggles the  PCRE_DOLLAR_ENDONLY  flag.  When  this
+#               flag  is  on,  a  $  metacharacter  in  the pattern
+#               matches only at the  end  of  the  subject  string.
+#               Without  this  flag,  a dollar also matches immedi-
 #               ately before the final character if it is a newline
 #               character (but not before any other newline charac-
-#               ters).  This flag is ignored if PCRE_MULTILINE flag
+#               ters). This flag is ignored if PCRE_MULTILINE  flag
 #               is set.
 # 
 #        U (default: off)
 #               Toggles the ungreedy matching flag.  When this flag
-#               is  on,  the  pattern  matching  engine inverts the
-#               "greediness" of the quantifiers so  that  they  are
-#               not  greedy  by  default, but become greedy if fol-
-#               lowed by "?".  This flag can also  set  by  a  (?U)
+#               is on, the  pattern  matching  engine  inverts  the
+#               "greediness"  of  the  quantifiers so that they are
+#               not greedy by default, but become  greedy  if  fol-
+#               lowed  by  "?".   This  flag can also set by a (?U)
 #               modifier within the pattern.
 # 
 #        X (default: off)
 #               Toggles the PCRE_EXTRA flag.  When this flag is on,
-#               any backslash in a pattern that is  followed  by  a
+#               any  backslash  in  a pattern that is followed by a
 #               letter that has no special meaning causes an error,
 #               thus reserving these combinations for future expan-
 #               sion.
 # 
-#        Each  pattern  is applied to the entire lookup key string.
-#        Depending on the application, that  string  is  an  entire
+#        Each pattern is applied to the entire lookup  key  string.
+#        Depending  on  the  application,  that string is an entire
 #        client hostname, an entire client IP address, or an entire
-#        mail address.  Thus, no parent domain  or  parent  network
-#        search  is  done,  and  user@domain mail addresses are not
-#        broken up into their user and  domain  constituent  parts,
+#        mail  address.   Thus,  no parent domain or parent network
+#        search is done, and user@domain  mail  addresses  are  not
+#        broken  up  into  their user and domain constituent parts,
 #        nor is user+foo broken up into user and foo.
 # 
-#        Patterns  are  applied  in  the  order as specified in the
-#        table, until a pattern is found that  matches  the  search
+#        Patterns are applied in the  order  as  specified  in  the
+#        table,  until  a  pattern is found that matches the search
 #        string.
 # 
-#        Substitution  of  substrings  from  the matched expression
-#        into the result string is possible using the  conventional
-#        perl  syntax  ($1,  $2,  etc.).   The macros in the result
-#        string may need to be written as  ${n}  or  $(n)  if  they
+#        Substitution of substrings  from  the  matched  expression
+#        into  the result string is possible using the conventional
+#        perl syntax ($1, $2, etc.).   The  macros  in  the  result
+#        string  may  need  to  be  written as ${n} or $(n) if they
 #        aren't followed by whitespace.
 # 
 # EXAMPLE SMTPD ACCESS MAP
index eed807ab7f0d6baa9d84beea86642c34af4ee518..2cefe946c0f877c90f52960a926c3092ae08e0ed 100644 (file)
@@ -6,6 +6,10 @@
 # SYNOPSIS
 #        regexp:/etc/postfix/filename
 # 
+#        postmap -q "string" regexp:/etc/postfix/filename
+# 
+#        postmap -q - regexp:/etc/postfix/filename <inputfile
+# 
 # DESCRIPTION
 #        The Postfix mail system uses optional tables  for  address
 #        rewriting or mail routing. These tables are usually in dbm
 #        To  find out what types of lookup tables your Postfix sys-
 #        tem supports use the postconf -m command.
 # 
+#        To  test  lookup  tables,  use  the  postmap  command   as
+#        described in the SYNOPSIS above.
+# 
 #        The general form of a Postfix regular expression table is:
 # 
-#        pattern result
-#               When  pattern matches a search string, use the cor-
-#               responding result.
+#        /pattern/flags result
+# 
+#        !/pattern/flags result
+#               When pattern matches  (does  not  match)  a  search
+#               string, use the corresponding result value.
 # 
 #        blank lines and comments
-#               Empty lines and whitespace-only lines are  ignored,
-#               as  are  lines whose first non-whitespace character
+#               Empty  lines and whitespace-only lines are ignored,
+#               as are lines whose first  non-whitespace  character
 #               is a `#'.
 # 
 #        multi-line text
-#               A logical line starts with non-whitespace  text.  A
-#               line  that starts with whitespace continues a logi-
+#               A  logical  line starts with non-whitespace text. A
+#               line that starts with whitespace continues a  logi-
 #               cal line.
 # 
-#        pattern1!pattern2 result
-#               Matches pattern1 but not pattern2.
+#        if /pattern/flags
+# 
+#        if !/pattern/flags
+# 
+#        endif  Examine the lines between if..endif only if pattern
+#               matches (does not match). The if..endif  can  nest.
+#               Do   not  prepend  whitespace  to  patterns  inside
+#               if..endif.
 # 
 #        Each pattern is a regular expression enclosed by a pair of
 #        delimiters.  The regular expression syntax is described in
index f6e7388a394e2eaf0a831f4a8332bbc9c448f3f5..248c4e891fc2e0f34a6299c5fed88413b3e2d337 100644 (file)
@@ -8,11 +8,15 @@
 # that each logical message header is matched against, including
 # headers that span multiple physical lines.  Patterns are matched
 # in the specified order, and the search stops upon the first match.
+#
+# For examples of pattern syntax see the sample-regexp-header.cf and
+# sample-pcre-header.cf files.
+#
 # When a pattern matches, what happens next depends on the associated
 # action that is specified in the right-hand side of the table:
 #
 # REJECT [optional text...]
-#      Reject the entire message. The optional text is sent to the 
+#      Reject the entire message. The optional text is sent to the
 #      originator and is logged to the maillog file.
 # IGNORE Silently discard the header line.
 # WARN [optional text...]
@@ -47,17 +51,21 @@ header_checks = regexp:/etc/postfix/header_checks
 # related headers in message headers, and to the headers that follow
 # multipart boundary strings. Headers may span multiple physical lines.
 # Patterns are matched in the specified order, and the search stops
-# upon the first match.  When a pattern matches, what happens next
-# depends on the associated action that is specified in the right-hand
-# side of the table:
+# upon the first match.
+#
+# For examples of pattern syntax see the sample-regexp-header.cf and
+# sample-pcre-header files.
+#
+# When a pattern matches, what happens next depends on the associated
+# action that is specified in the right-hand side of the table:
 #
 # REJECT [optional text...]
-#       Reject the entire message. The optional text is sent to the 
+#       Reject the entire message. The optional text is sent to the
 #       originator and is logged to the maillog file.
 # IGNORE Silently discard the body line
-# WARN [optional text...] 
+# WARN [optional text...]
 #       Log the body line and the optional text. This is useful
-#       for testing. When the pattern is OK, change the WARN into a 
+#       for testing. When the pattern is OK, change the WARN into a
 #       REJECT or into a DISCARD.
 # HOLD [optional text...]
 #       Place the message on the hold queue. Mail on hold can be
@@ -83,9 +91,13 @@ mime_header_checks = $header_checks
 # that each attached message header is matched against (except for
 # MIME related headers). Headers may span multiple physical lines.
 # Patterns are matched in the specified order, and the search stops
-# upon the first match.  When a pattern matches, what happens next
-# depends on the associated action that is specified in the right-hand
-# side of the table:
+# upon the first match.
+#
+# For examples of pattern syntax see the sample-regexp-header.cf and
+# sample-pcre-header.cf files.
+#
+# When a pattern matches, what happens next depends on the associated
+# action that is specified in the right-hand side of the table:
 #
 # REJECT the entire message is rejected.
 # REJECT text.... The text is sent to the originator.
@@ -107,10 +119,14 @@ nested_header_checks = $header_checks
 # The body_checks parameter specifies an optional table with patterns
 # that each physical line in the message body is matched against
 # (including MIME headers inside the message body - Postfix does not
-# recognize multi-line MIME headers in the message body).  
+# recognize multi-line MIME headers in the message body).
 # Lines are matched one at a time.  Long lines are matched in chunks
 # of at most $line_length_limit characters. Patterns are matched in
 # the specified order, and the search stops upon the first match.
+#
+# For examples of pattern syntax see the sample-regexp-body.cf and
+# sample-pcre-body.cf files.
+#
 # When a pattern matches, what happens next depends on the associated
 # action that is specified in the right-hand side of the table:
 #
index 849641fc0e74932debef76273bbde0dcaf06c963..c9735698f8a932e5453d7f6b4356a3609f07a8ca 100644 (file)
 #      matching ungreedy (see PCRE documentation and source for more
 #      info).
 #
+#       A block of table entries may be "enclosed" by a line with    
+#       `if /pattern/flags' and a line with `endif'.  This causes
+#       the block of table entries to be examined only when the
+#       pattern produces a successful match. The `if..endif' may
+#       be nested. There currently is no `else' operator.
+#
 #      The second field is the "replacement" string - the text
 #      returned by the match. When used for smtpd checks, this would
 #      be a helpful message to misguided users (or an offensive
index 1d314a3be1114e6b52da7aef0271f0ea168cfb77..14e151225f1b1c83060c29d7e4408aca1c81e117 100644 (file)
@@ -2,9 +2,8 @@
 #      Sample pcre (PERL-compatible regular expression) map file for
 #      mail body filtering. See pcre_table(5) for syntax description.
 #
-#      Mail body lines are filtered one line at a time. In particular,
-#      multi-line MIME headers in the message body are filtered one text
-#      line at a time.
+#      Mail body lines are filtered one line at a time. MIME headers are
+#      filtered as message headers, i.e. not as part of the mail body.
 #
 #      The first field is a perl-like regular expression. The expression
 #      delimiter can be any character except whitespace, or characters
 #      matching ungreedy (see PCRE documentation and source for more
 #      info).
 #
+#       A block of table entries may be "enclosed" by a line with    
+#       `if /pattern/flags' and a line with `endif'.  This causes
+#       the block of table entries to be examined only when the
+#       pattern produces a successful match. The `if..endif' may
+#       be nested. There currently is no `else' operator.
+#
 #      The second field is the "replacement" string - the text
 #      returned by the match.
 #
index e69dda78322e824ac797c0db32ff11c3ce649f74..c0fcd7f0d1fa12f5ed5f7a97b561e2638a9b95db 100644 (file)
 #      matching ungreedy (see PCRE documentation and source for more
 #      info).
 #
+#       A block of table entries may be "enclosed" by a line with    
+#       `if /pattern/flags' and a line with `endif'.  This causes
+#       the block of table entries to be examined only when the
+#       pattern produces a successful match. The `if..endif' may
+#       be nested. There currently is no `else' operator.
+#
 #      The second field is the "replacement" string - the text
 #      returned by the match. 
 #
index 9ac54c1ab769eda95954387a43e0aef41480a0c6..6d6d1c27ec3fdf8badc8d43cd61db406de784e6d 100644 (file)
@@ -3,17 +3,24 @@
 #
 # The general format of a table entry is PATTERN RESULT.
 #
-# The pattern format is /regexp/flags or /regexp/flags!/regexp/flags
-# where regexp is a regular expression as found in regexp(5), and flags are
+# The pattern format is `/regexp/flags' or `!/regexp/flags' where regexp
+# is a regular expression as found in re_format(7), and flags are
 #   i: toggle ignore case (REG_ICASE - default is to ignore case)
 #   x: toggle extended expression (REG_EXTENDED - default is extended)
 #   m: toggle multiline mode (REG_NEWLINE - default is non-multiline mode)
 #
-# In order for a line to match, the first regexp must match, and the
-# second (if present) must not match.  The first matching line wins,
-# terminating processing of the ruleset.
+# In order for a line to match, the regexp must match. If the regexp
+# is prefixed with !, it must not match.  The first line with a successful
+# (non)match wins, terminating processing of the ruleset.
 #
-# The result syntax is described in the access(5) manual page.
+# A block of table entries may be "enclosed" by a line with `if
+# /pattern/flags' or `if !/pattern/flags' and a line with `endif'.
+# This causes the block of table entries to be examined only when
+# the pattern produces a successful (non)match. The `if..endif' may
+# be nested. There currently is no `else' operator.
+#
+# The syntax of access table results is described in the Postfix
+# access(5) manual page.
 
 # Disallow sender-specified routing. This is a must if you relay mail
 #for other domains.
index 69f78d38ab013970d551ca3a09febd76a33cb34c..0111e68e53b9bcb4e22ec3fc4f0475e89f0f0cf0 100644 (file)
@@ -1,20 +1,26 @@
 # Sample regexp message body filter lookup "table". See regexp_table(5)
 # for a description of the syntax.
 #
-# Mail body lines are filtered one line at a time. In particular, multi-line
-# MIME headers in the message body are filtered one text line at a time.
+# Mail body lines are filtered one line at a time. MIME headers are
+# filtered as message headers, i.e. not as part of the mail body.
 #
 # The general format of a table entry is PATTERN RESULT.
 #
-# The pattern format is /regexp/flags or /regexp/flags!/regexp/flags
-# where regexp is a regular expression as found in regexp(5), and flags are
+# The pattern format is `/regexp/flags' or `!/regexp/flags' where regexp
+# is a regular expression as found in re_format(7), and flags are
 #   i: toggle ignore case (REG_ICASE - default is to ignore case)
 #   x: toggle extended expression (REG_EXTENDED - default is extended)
 #   m: toggle multiline mode (REG_NEWLINE - default is non-multiline mode)
 #
-# In order for a line to match, the first regexp must match, and the
-# second (if present) must not match.  The first matching line wins,
-# terminating processing of the ruleset.
+# In order for a line to match, the regexp must match. If the regexp
+# is prefixed with !, it must not match.  The first line with a successful
+# (non)match wins, terminating processing of the ruleset.
+#
+# A block of table entries may be "enclosed" by a line with `if
+# /pattern/flags' or `if !/pattern/flags' and a line with `endif'.
+# This causes the block of table entries to be examined only when
+# the pattern produces a successful (non)match. The `if..endif' may
+# be nested. There currently is no `else' operator.
 #
 # The result is one of the following:
 # REJECT [optional text...]
index 9684f682bceeec65a26b8e42f515a7f827240ea7..f1b6d4a899b549abf5d3305481a4e739292a9176 100644 (file)
@@ -7,15 +7,21 @@
 #
 # The general format of a table entry is PATTERN RESULT. 
 #
-# The pattern format is /regexp/flags or /regexp/flags!/regexp/flags
-# where regexp is a regular expression as found in regexp(5), and flags are
+# The pattern format is `/regexp/flags' or `!/regexp/flags' where regexp
+# is a regular expression as found in re_format(7), and flags are
 #   i: toggle ignore case (REG_ICASE - default is to ignore case)
 #   x: toggle extended expression (REG_EXTENDED - default is extended)
 #   m: toggle multiline mode (REG_NEWLINE - default is non-multiline mode)
 #
-# In order for a line to match, the first regexp must match, and the
-# second (if present) must not match.  The first matching line wins,
-# terminating processing of the ruleset.
+# In order for a line to match, the regexp must match. If the regexp
+# is prefixed with !, it must not match.  The first line with a successful
+# (non)match wins, terminating processing of the ruleset.
+#
+# A block of table entries may be "enclosed" by a line with `if
+# /pattern/flags' or `if !/pattern/flags' and a line with `endif'.
+# This causes the block of table entries to be examined only when
+# the pattern produces a successful (non)match. The `if..endif' may
+# be nested. There currently is no `else' operator.
 #
 # The result is one of the following:
 # REJECT [optional text...]
index 52b9a87eeec8a22d6416aa7c12ea4cc9be1b7d2e..8cf9d9a7e70f6fa616938eed4376c10fd34aba12 100644 (file)
@@ -6,6 +6,10 @@
 # SYNOPSIS
 #        postmap /etc/postfix/transport
 # 
+#        postmap -q "string" /etc/postfix/transport
+# 
+#        postmap -q - /etc/postfix/transport <inputfile
+# 
 # DESCRIPTION
 #        The  optional  transport  table  specifies  a mapping from
 #        email addresses  to  message  delivery  transports  and/or
index 338aa6439048cd45aaf9e0dc1d81e0196487701f..37f762ab17510266520ae39b7d268d39d3ee74f6 100644 (file)
@@ -6,6 +6,10 @@
 # SYNOPSIS
 #        postmap /etc/postfix/virtual
 # 
+#        postmap -q "string" /etc/postfix/virtual
+# 
+#        postmap -q - /etc/postfix/virtual <inputfile
+# 
 # DESCRIPTION
 #        The  optional virtual table specifies address redirections
 #        for local and non-local recipients or domains.  The  redi-
index db7a589f19cb44ebdcae2169ff8cda16e0e41d54..aff8bac218f72a67b512a7c4f2ef2ce00c530bab 100644 (file)
@@ -7,6 +7,10 @@ ACCESS(5)                                               ACCESS(5)
 <b>SYNOPSIS</b>
        <b>postmap</b> <b>/etc/postfix/access</b>
 
+       <b>postmap</b> <b>-q</b> <b>"</b><i>string</i><b>"</b> <b>/etc/postfix/access</b>
+
+       <b>postmap</b> <b>-q</b> <b>-</b> <b>/etc/postfix/access</b> &lt;<i>inputfile</i>
+
 <b>DESCRIPTION</b>
        The  optional <b>access</b> table directs the Postfix SMTP server
        to selectively  reject  or  accept  mail.  Access  can  be
index 2ec7403ca72bafc6ff4ba1e35df1d27fee6f0b19..569d1ff2e0624bb9443f1dc7c14013ed04f6c7da 100644 (file)
@@ -1,5 +1,4 @@
 <html> <head> </head> <body> <pre>
-
 CANONICAL(5)                                         CANONICAL(5)
 
 <b>NAME</b>
@@ -8,6 +7,10 @@ CANONICAL(5)                                         CANONICAL(5)
 <b>SYNOPSIS</b>
        <b>postmap</b> <b>/etc/postfix/canonical</b>
 
+       <b>postmap</b> <b>-q</b> <b>"</b><i>string</i><b>"</b> <b>/etc/postfix/canonical</b>
+
+       <b>postmap</b> <b>-q</b> <b>-</b> <b>/etc/postfix/canonical</b> &lt;<i>inputfile</i>
+
 <b>DESCRIPTION</b>
        The  optional <b>canonical</b> table specifies an address mapping
        for local and non-local addresses. The mapping is used  by
@@ -184,6 +187,5 @@ CANONICAL(5)                                         CANONICAL(5)
        P.O. Box 704
        Yorktown Heights, NY 10598, USA
 
-                                                                1
-
+                                                     CANONICAL(5)
 </pre> </body> </html>
index b03d4710772e6dbad3457804d0710d2441b0088c..d74644c637ccfbe442bc01ad364cc91a6ca03b73 100644 (file)
@@ -5,7 +5,11 @@ PCRE_TABLE(5)                                       PCRE_TABLE(5)
        pcre_table - format of Postfix PCRE tables
 
 <b>SYNOPSIS</b>
-       pcre:/etc/postfix/filename
+       <b>pcre:/etc/postfix/</b><i>filename</i>
+
+       <b>postmap</b> <b>-q</b> <b>"</b><i>string</i><b>"</b> <b>pcre:/etc/postfix/</b><i>filename</i>
+
+       <b>postmap</b> <b>-q</b> <b>-</b> <b>pcre:/etc/postfix/</b><i>filename</i> &lt;<i>inputfile</i>
 
 <b>DESCRIPTION</b>
        The  Postfix  mail system uses optional tables for address
@@ -16,109 +20,118 @@ PCRE_TABLE(5)                                       PCRE_TABLE(5)
        To find out what types of lookup tables your Postfix  sys-
        tem supports use the <b>postconf</b> <b>-m</b> command.
 
+       To   test  lookup  tables,  use  the  <b>postmap</b>  command  as
+       described in the SYNOPSIS above.
+
        The general form of a PCRE table is:
 
-       <i>pattern</i> <i>result</i>
-              When  <i>pattern</i> matches a search string, use the cor-
-              responding <i>result</i>.
+       <b>/</b><i>pattern</i><b>/</b><i>flags</i> <i>result</i>
+              When <i>pattern</i> matches a search string, use the  cor-
+              responding <i>result</i> value.
 
        blank lines and comments
-              Empty lines and whitespace-only lines are  ignored,
-              as  are  lines whose first non-whitespace character
+              Empty  lines and whitespace-only lines are ignored,
+              as are lines whose first  non-whitespace  character
               is a `#'.
 
        multi-line text
-              A logical line starts with non-whitespace  text.  A
-              line  that starts with whitespace continues a logi-
+              A  logical  line starts with non-whitespace text. A
+              line that starts with whitespace continues a  logi-
               cal line.
 
+       <b>if</b> <b>/</b><i>pattern</i><b>/</b><i>flags</i>
+
+       <b>endif</b>  Examine the lines between <b>if</b>..<b>endif</b> only if <i>pattern</i>
+              matches. The <b>if</b>..<b>endif</b> can nest.   Do  not  prepend
+              whitespace to patterns inside <b>if</b>..<b>endif</b>.
+
        Each  pattern  is  a  perl-like  regular  expression.  The
-       expression  delimiter can be any character, except whites-
-       pace or characters that have special  meaning  (tradition-
-       ally  the  forward slash is used).  The regular expression
+       expression delimiter can be any character, except  whites-
+       pace  or  characters that have special meaning (tradition-
+       ally the forward slash is used).  The  regular  expression
        can contain whitespace.
 
        By default, matching is case-insensitive, and newlines are
-       not  treated  as  special characters. The behavior is con-
-       trolled by flags, which are toggled by  appending  one  or
+       not treated as special characters. The  behavior  is  con-
+       trolled  by  flags,  which are toggled by appending one or
        more of the following characters after the pattern:
 
        <b>i</b> (default: on)
-              Toggles  the  case  sensitivity  flag.  By default,
+              Toggles the  case  sensitivity  flag.  By  default,
               matching is case insensitive.
 
        <b>m</b> (default: off)
-              Toggles the PCRE_MULTILINE flag. When this flag  is
-              on,  the  <b>^</b>  and $ metacharacters match immediately
-              after and immediately before a  newline  character,
-              respectively,  in addition to matching at the start
+              Toggles  the PCRE_MULTILINE flag. When this flag is
+              on, the <b>^</b> and $  metacharacters  match  immediately
+              after  and  immediately before a newline character,
+              respectively, in addition to matching at the  start
               and end of the subject string.
 
        <b>s</b> (default: on)
               Toggles the PCRE_DOTALL flag. When this flag is on,
               the <b>.</b>  metacharacter matches the newline character.
-              With Postfix versions prior to 20020528,  The  flag
+              With  Postfix  versions prior to 20020528, The flag
               is off by default, which is inconvenient for multi-
               line message header matching.
 
        <b>x</b> (default: off)
-              Toggles the pcre extended flag. When this  flag  is
-              on,  whitespace  in  the  pattern  (other than in a
+              Toggles  the  pcre extended flag. When this flag is
+              on, whitespace in the  pattern  (other  than  in  a
               character class) and characters between a <b>#</b> outside
-              a  character  class  and the next newline character
-              are ignored. An escaping backslash can be  used  to
-              include  a whitespace or <b>#</b> character as part of the
+              a character class and the  next  newline  character
+              are  ignored.  An escaping backslash can be used to
+              include a whitespace or <b>#</b> character as part of  the
               pattern.
 
        <b>A</b> (default: off)
-              Toggles the PCRE_ANCHORED flag.  When this flag  is
-              on,  the  pattern  is forced to be "anchored", that
+              Toggles  the PCRE_ANCHORED flag.  When this flag is
+              on, the pattern is forced to  be  "anchored",  that
               is, it is constrained to match only at the start of
-              the  string  which  is being searched (the "subject
-              string"). This  effect  can  also  be  achieved  by
+              the string which is being  searched  (the  "subject
+              string").  This  effect  can  also  be  achieved by
               appropriate constructs in the pattern itself.
 
        <b>E</b> (default: off)
-              Toggles  the  PCRE_DOLLAR_ENDONLY  flag.  When this
-              flag is  on,  a  <b>$</b>  metacharacter  in  the  pattern
-              matches  only  at  the  end  of the subject string.
-              Without this flag, a dollar  also  matches  immedi-
+              Toggles the  PCRE_DOLLAR_ENDONLY  flag.  When  this
+              flag  is  on,  a  <b>$</b>  metacharacter  in  the pattern
+              matches only at the  end  of  the  subject  string.
+              Without  this  flag,  a dollar also matches immedi-
               ately before the final character if it is a newline
               character (but not before any other newline charac-
-              ters).  This flag is ignored if PCRE_MULTILINE flag
+              ters). This flag is ignored if PCRE_MULTILINE  flag
               is set.
 
        <b>U</b> (default: off)
               Toggles the ungreedy matching flag.  When this flag
-              is  on,  the  pattern  matching  engine inverts the
-              "greediness" of the quantifiers so  that  they  are
-              not  greedy  by  default, but become greedy if fol-
-              lowed by "?".  This flag can also  set  by  a  (?U)
+              is on, the  pattern  matching  engine  inverts  the
+              "greediness"  of  the  quantifiers so that they are
+              not greedy by default, but become  greedy  if  fol-
+              lowed  by  "?".   This  flag can also set by a (?U)
               modifier within the pattern.
 
        <b>X</b> (default: off)
               Toggles the PCRE_EXTRA flag.  When this flag is on,
-              any backslash in a pattern that is  followed  by  a
+              any  backslash  in  a pattern that is followed by a
               letter that has no special meaning causes an error,
               thus reserving these combinations for future expan-
               sion.
 
-       Each  pattern  is applied to the entire lookup key string.
-       Depending on the application, that  string  is  an  entire
+       Each pattern is applied to the entire lookup  key  string.
+       Depending  on  the  application,  that string is an entire
        client hostname, an entire client IP address, or an entire
-       mail address.  Thus, no parent domain  or  parent  network
-       search  is  done,  and  <i>user@domain</i> mail addresses are not
-       broken up into their <i>user</i> and  <i>domain</i>  constituent  parts,
+       mail  address.   Thus,  no parent domain or parent network
+       search is done, and <i>user@domain</i>  mail  addresses  are  not
+       broken  up  into  their <i>user</i> and <i>domain</i> constituent parts,
        nor is <i>user+foo</i> broken up into <i>user</i> and <i>foo</i>.
 
-       Patterns  are  applied  in  the  order as specified in the
-       table, until a pattern is found that  matches  the  search
+       Patterns are applied in the  order  as  specified  in  the
+       table,  until  a  pattern is found that matches the search
        string.
 
-       Substitution  of  substrings  from  the matched expression
-       into the result string is possible using the  conventional
-       perl  syntax  ($1,  $2,  etc.).   The macros in the result
-       string may need to be written as  ${n}  or  $(n)  if  they
+       Substitution of substrings  from  the  matched  expression
+       into  the result string is possible using the conventional
+       perl syntax ($1, $2, etc.).   The  macros  in  the  result
+       string  may  need  to  be  written as ${n} or $(n) if they
        aren't followed by whitespace.
 
 <b>EXAMPLE</b> <b>SMTPD</b> <b>ACCESS</b> <b>MAP</b>
index 168c3d21b2f5fbc0f2e7016ef63dd1fadba79d5d..d74f25b3e10bc8ce1ab6a4ee09860b549fa8a8bb 100644 (file)
@@ -107,7 +107,7 @@ PIPE(8)                                                   PIPE(8)
               is  specified,  the  corresponding group ID is used
               instead of the group ID of <i>username</i>.
 
-       <b>eol=string</b> (default: <b>\n</b>)
+       <b>eol=string</b> (optional, default: <b>\n</b>)
               The output record delimiter.  Typically  one  would
               use  either <b>\r\n</b> or <b>\n</b>. The usual C-style backslash
               escape sequences are recognized: <b>\a</b> <b>\b</b> <b>\f</b> <b>\n</b> <b>\r</b>  <b>\t</b>
index a81657af1bca15ddf0ad5a2e0c64834ac4cceff8..a4e957ef850849879e729db224fcaf92b93fcc69 100644 (file)
@@ -5,7 +5,11 @@ REGEXP_TABLE(5)                                   REGEXP_TABLE(5)
        regexp_table - format of Postfix regular expression tables
 
 <b>SYNOPSIS</b>
-       regexp:/etc/postfix/filename
+       <b>regexp:/etc/postfix/</b><i>filename</i>
+
+       <b>postmap</b> <b>-q</b> <b>"</b><i>string</i><b>"</b> <b>regexp:/etc/postfix/</b><i>filename</i>
+
+       <b>postmap</b> <b>-q</b> <b>-</b> <b>regexp:/etc/postfix/</b><i>filename</i> &lt;<i>inputfile</i>
 
 <b>DESCRIPTION</b>
        The Postfix mail system uses optional tables  for  address
@@ -16,24 +20,35 @@ REGEXP_TABLE(5)                                   REGEXP_TABLE(5)
        To  find out what types of lookup tables your Postfix sys-
        tem supports use the <b>postconf</b> <b>-m</b> command.
 
+       To  test  lookup  tables,  use  the  <b>postmap</b>  command   as
+       described in the SYNOPSIS above.
+
        The general form of a Postfix regular expression table is:
 
-       <i>pattern</i> <i>result</i>
-              When  <i>pattern</i> matches a search string, use the cor-
-              responding <i>result</i>.
+       <b>/</b><i>pattern</i><b>/</b><i>flags</i> <i>result</i>
+
+       <b>!/</b><i>pattern</i><b>/</b><i>flags</i> <i>result</i>
+              When <i>pattern</i> matches  (does  not  match)  a  search
+              string, use the corresponding <i>result</i> value.
 
        blank lines and comments
-              Empty lines and whitespace-only lines are  ignored,
-              as  are  lines whose first non-whitespace character
+              Empty  lines and whitespace-only lines are ignored,
+              as are lines whose first  non-whitespace  character
               is a `#'.
 
        multi-line text
-              A logical line starts with non-whitespace  text.  A
-              line  that starts with whitespace continues a logi-
+              A  logical  line starts with non-whitespace text. A
+              line that starts with whitespace continues a  logi-
               cal line.
 
-       <i>pattern1!pattern2</i> <i>result</i>
-              Matches <i>pattern1</i> but not <i>pattern2</i>.
+       <b>if</b> <b>/</b><i>pattern</i><b>/</b><i>flags</i>
+
+       <b>if</b> <b>!/</b><i>pattern</i><b>/</b><i>flags</i>
+
+       <b>endif</b>  Examine the lines between <b>if</b>..<b>endif</b> only if <i>pattern</i>
+              matches (does not match). The <b>if</b>..<b>endif</b>  can  nest.
+              Do   not  prepend  whitespace  to  patterns  inside
+              <b>if</b>..<b>endif</b>.
 
        Each pattern is a regular expression enclosed by a pair of
        delimiters.  The regular expression syntax is described in
index 28b826f853d02e179aac92669b50c7825fc82089..a826316b127af8063d850eb86f2ce68514daf1f4 100644 (file)
@@ -7,6 +7,10 @@ TRANSPORT(5)                                         TRANSPORT(5)
 <b>SYNOPSIS</b>
        <b>postmap</b> <b>/etc/postfix/transport</b>
 
+       <b>postmap</b> <b>-q</b> <b>"</b><i>string</i><b>"</b> <b>/etc/postfix/transport</b>
+
+       <b>postmap</b> <b>-q</b> <b>-</b> <b>/etc/postfix/transport</b> &lt;<i>inputfile</i>
+
 <b>DESCRIPTION</b>
        The  optional  <b>transport</b>  table  specifies  a mapping from
        email addresses  to  message  delivery  transports  and/or
index 0a1f49a699ec4c8c7571009098053397faee4a21..772b59483778842384d5181c4c4a8072525067fb 100644 (file)
@@ -7,6 +7,10 @@ VIRTUAL(5)                                             VIRTUAL(5)
 <b>SYNOPSIS</b>
        <b>postmap</b> <b>/etc/postfix/virtual</b>
 
+       <b>postmap</b> <b>-q</b> <b>"</b><i>string</i><b>"</b> <b>/etc/postfix/virtual</b>
+
+       <b>postmap</b> <b>-q</b> <b>-</b> <b>/etc/postfix/virtual</b> &lt;<i>inputfile</i>
+
 <b>DESCRIPTION</b>
        The  optional <b>virtual</b> table specifies address redirections
        for local and non-local recipients or domains.  The  redi-
index f8f5300fc0bb43553309c2af3f6ab258f9491691..730b64e9d0d3d8c975e067cb20d6fe8a4057bbab 100644 (file)
@@ -191,6 +191,10 @@ case "$SYSTEM.$RELEASE" in
                    echo "See the RELEASE_NOTES file for more information." 1>&2
                    exit 1
                fi
+               if [ -f /usr/include/pcre/pcre.h ]
+               then
+                   CCARGS="$CCARGS -DHAS_PCRE -I/usr/include/pcre"
+               fi
                # GDBM locks the DBM .pag file after open. This breaks postmap.
                # if [ -f /usr/include/gdbm-ndbm.h ]
                # then
@@ -202,7 +206,7 @@ case "$SYSTEM.$RELEASE" in
                #     GDBM_LIBS=gdbm
                # fi
                SYSLIBS="-ldb"
-               for name in nsl resolv $GDBM_LIBS
+               for name in nsl resolv pcre $GDBM_LIBS
                do
                    test -e /usr/lib/lib$name.a -o -e /usr/lib/lib$name.so \
                        -o -e /lib/lib$name.a -o -e /lib/lib$name.so \
index 3e28f8eaf7a7a5da010b200d8cc71d0d364590fb..2fa6fac6b861d8fc77531b4e799aff7c2dae05bf 100644 (file)
@@ -9,6 +9,10 @@ format of Postfix access table
 .na
 .nf
 \fBpostmap /etc/postfix/access\fR
+
+\fBpostmap -q "\fIstring\fB" /etc/postfix/access\fR
+
+\fBpostmap -q - /etc/postfix/access <\fIinputfile\fR
 .SH DESCRIPTION
 .ad
 .fi
index 42cf796570067e2f212d2e2ad5422e6db18ec2c3..cd731797b145467cd60a47c4d124ab299cc7b40b 100644 (file)
@@ -9,6 +9,10 @@ format of Postfix canonical table
 .na
 .nf
 \fBpostmap /etc/postfix/canonical\fR
+
+\fBpostmap -q "\fIstring\fB" /etc/postfix/canonical\fR
+
+\fBpostmap -q - /etc/postfix/canonical <\fIinputfile\fR
 .SH DESCRIPTION
 .ad
 .fi
index a17bc553c334b00f48f748848a8790776c246da8..fbb07661774fc75ab59f18df01c861045d63389b 100644 (file)
@@ -8,7 +8,11 @@ format of Postfix PCRE tables
 .SH SYNOPSIS
 .na
 .nf
-pcre:/etc/postfix/filename
+\fBpcre:/etc/postfix/\fIfilename\fR
+
+\fBpostmap -q "\fIstring\fB" pcre:/etc/postfix/\fIfilename\fR
+
+\fBpostmap -q - pcre:/etc/postfix/\fIfilename\fR <\fIinputfile\fR
 .SH DESCRIPTION
 .ad
 .fi
@@ -20,16 +24,24 @@ can be specified in Perl Compatible Regular Expression form.
 To find out what types of lookup tables your Postfix system
 supports use the \fBpostconf -m\fR command.
 
+To test lookup tables, use the \fBpostmap\fR command as
+described in the SYNOPSIS above.
+
 The general form of a PCRE table is:
-.IP "\fIpattern result\fR"
+.IP "\fB/\fIpattern\fB/\fIflags result\fR"
 When \fIpattern\fR matches a search string, use the corresponding
-\fIresult\fR.
+\fIresult\fR value.
 .IP "blank lines and comments"
 Empty lines and whitespace-only lines are ignored, as
 are lines whose first non-whitespace character is a `#'.
 .IP "multi-line text"
 A logical line starts with non-whitespace text. A line that
 starts with whitespace continues a logical line.
+.IP "\fBif /\fIpattern\fB/\fIflags\fR"
+.IP "\fBendif\fR"
+Examine the lines between \fBif\fR..\fBendif\fR only if
+\fIpattern\fR matches. The \fBif\fR..\fBendif\fR can nest.
+Do not prepend whitespace to patterns inside \fBif\fR..\fBendif\fR.
 .PP
 Each pattern is a perl-like regular expression. The expression
 delimiter can be any character, except whitespace or characters
index 095f21e722694d6cdf15d1696557f0ea0d5535d9..0aa3df518eb953296996f359559ca1ebeff8aa2a 100644 (file)
@@ -8,7 +8,11 @@ format of Postfix regular expression tables
 .SH SYNOPSIS
 .na
 .nf
-regexp:/etc/postfix/filename
+\fBregexp:/etc/postfix/\fIfilename\fR
+
+\fBpostmap -q "\fIstring\fB" regexp:/etc/postfix/\fIfilename\fR
+
+\fBpostmap -q - regexp:/etc/postfix/\fIfilename\fR <\fIinputfile\fR
 .SH DESCRIPTION
 .ad
 .fi
@@ -20,18 +24,27 @@ can be specified in POSIX regular expression form.
 To find out what types of lookup tables your Postfix system
 supports use the \fBpostconf -m\fR command.
 
+To test lookup tables, use the \fBpostmap\fR command as
+described in the SYNOPSIS above.
+
 The general form of a Postfix regular expression table is:
-.IP "\fIpattern result\fR"
-When \fIpattern\fR matches a search string, use the corresponding
-\fIresult\fR.
+.IP "\fB/\fIpattern\fB/\fIflags result\fR"
+.IP "\fB!/\fIpattern\fB/\fIflags result\fR"
+When \fIpattern\fR matches (does not match) a search string,
+use the corresponding \fIresult\fR value.
 .IP "blank lines and comments"
 Empty lines and whitespace-only lines are ignored, as
 are lines whose first non-whitespace character is a `#'.
 .IP "multi-line text"
 A logical line starts with non-whitespace text. A line that
 starts with whitespace continues a logical line.
-.IP "\fIpattern1!pattern2 result\fR"
-Matches \fIpattern1\fR but not \fIpattern2\fR.
+.IP "\fBif /\fIpattern\fB/\fIflags\fR"
+.IP "\fBif !/\fIpattern\fB/\fIflags\fR"
+.IP "\fBendif\fR"
+Examine the lines between \fBif\fR..\fBendif\fR only if
+\fIpattern\fR matches (does not match). The \fBif\fR..\fBendif\fR
+can nest.
+Do not prepend whitespace to patterns inside \fBif\fR..\fBendif\fR.
 .PP
 Each pattern is a regular expression enclosed by a pair of delimiters.
 The regular expression syntax is described in \fIre_format\fR(7).
index 48f350a599b9cf03b5670a17b7be00707a593081..b883920a824669f9dd7a9317e46685205a314814 100644 (file)
@@ -9,6 +9,10 @@ format of Postfix transport table
 .na
 .nf
 \fBpostmap /etc/postfix/transport\fR
+
+\fBpostmap -q "\fIstring\fB" /etc/postfix/transport\fR
+
+\fBpostmap -q - /etc/postfix/transport <\fIinputfile\fR
 .SH DESCRIPTION
 .ad
 .fi
index 780581039a5e46595175be80c0250bd4bba3b4f1..ce5d3af85e6cf5bbe84eebe3e35f86487831c5db 100644 (file)
@@ -9,6 +9,10 @@ format of Postfix virtual table
 .na
 .nf
 \fBpostmap /etc/postfix/virtual\fR
+
+\fBpostmap -q "\fIstring\fB" /etc/postfix/virtual\fR
+
+\fBpostmap -q - /etc/postfix/virtual <\fIinputfile\fR
 .SH DESCRIPTION
 .ad
 .fi
index db989d670c182afc2f46e5c4a75e4aa511f76a2c..233e7df3e510d9c7177d89a9e9c18f52cbaa0af1 100644 (file)
@@ -105,7 +105,7 @@ commands with root privileges, or with the privileges of the
 mail system owner. If \fIgroupname\fR is specified, the
 corresponding group ID is used instead of the group ID of
 \fIusername\fR.
-.IP "\fBeol=string\fR (default: \fB\en\fR)"
+.IP "\fBeol=string\fR (optional, default: \fB\en\fR)"
 The output record delimiter. Typically one would use either
 \fB\er\en\fR or \fB\en\fR. The usual C-style backslash escape
 sequences are recognized: \fB\ea \eb \ef \en \er \et \ev
index 4352a72890a36c0e5b35c5c39e8b54a81c001d39..75c64cd104d331efcbe5ae972565aa8532efd1c4 100644 (file)
@@ -5,6 +5,10 @@
 #      format of Postfix access table
 # SYNOPSIS
 #      \fBpostmap /etc/postfix/access\fR
+#
+#       \fBpostmap -q "\fIstring\fB" /etc/postfix/access\fR
+#
+#       \fBpostmap -q - /etc/postfix/access <\fIinputfile\fR
 # DESCRIPTION
 #      The optional \fBaccess\fR table directs the Postfix SMTP server
 #      to selectively reject or accept mail. Access can be allowed or
index 7cf0829a4e60230e4f47acf7e142f63360e093b5..f696a3aefb3b5aaa5252c67a28b770ffe15088d4 100644 (file)
@@ -5,6 +5,10 @@
 #      format of Postfix canonical table
 # SYNOPSIS
 #      \fBpostmap /etc/postfix/canonical\fR
+#
+#      \fBpostmap -q "\fIstring\fB" /etc/postfix/canonical\fR
+#
+#      \fBpostmap -q - /etc/postfix/canonical <\fIinputfile\fR
 # DESCRIPTION
 #      The optional \fBcanonical\fR table specifies an address mapping for
 #      local and non-local addresses. The mapping is used by the
index 43f273df4deab71aa61ecf6f913b483edf825ef0..97c0f4e85ff6ef0dc894b21e58285f444cbfc430 100644 (file)
@@ -4,7 +4,11 @@
 # SUMMARY
 #      format of Postfix PCRE tables
 # SYNOPSIS
-#      pcre:/etc/postfix/filename
+#      \fBpcre:/etc/postfix/\fIfilename\fR
+#
+#      \fBpostmap -q "\fIstring\fB" pcre:/etc/postfix/\fIfilename\fR
+#
+#      \fBpostmap -q - pcre:/etc/postfix/\fIfilename\fR <\fIinputfile\fR
 # DESCRIPTION
 #      The Postfix mail system uses optional tables for address
 #      rewriting or mail routing. These tables are usually in
 #      To find out what types of lookup tables your Postfix system
 #      supports use the \fBpostconf -m\fR command.
 #
+#      To test lookup tables, use the \fBpostmap\fR command as
+#      described in the SYNOPSIS above.
+#
 #      The general form of a PCRE table is:
-# .IP "\fIpattern result\fR"
+# .IP "\fB/\fIpattern\fB/\fIflags result\fR"
 #      When \fIpattern\fR matches a search string, use the corresponding
-#      \fIresult\fR.
+#      \fIresult\fR value.
 # .IP "blank lines and comments"
 #      Empty lines and whitespace-only lines are ignored, as
 #      are lines whose first non-whitespace character is a `#'.
 # .IP "multi-line text"
 #      A logical line starts with non-whitespace text. A line that
 #      starts with whitespace continues a logical line.
+# .IP "\fBif /\fIpattern\fB/\fIflags\fR"
+# .IP "\fBendif\fR"
+#      Examine the lines between \fBif\fR..\fBendif\fR only if
+#      \fIpattern\fR matches. The \fBif\fR..\fBendif\fR can nest.
+#      Do not prepend whitespace to patterns inside \fBif\fR..\fBendif\fR.
 # .PP
 #      Each pattern is a perl-like regular expression. The expression
 #      delimiter can be any character, except whitespace or characters
index c937d895d6def7bfc08ef00640066fea993b9de8..d275f7b8debc5c340693e1ed090d4f5f7f1c89f3 100644 (file)
@@ -4,7 +4,11 @@
 # SUMMARY
 #      format of Postfix regular expression tables
 # SYNOPSIS
-#      regexp:/etc/postfix/filename
+#      \fBregexp:/etc/postfix/\fIfilename\fR
+#
+#      \fBpostmap -q "\fIstring\fB" regexp:/etc/postfix/\fIfilename\fR
+#
+#      \fBpostmap -q - regexp:/etc/postfix/\fIfilename\fR <\fIinputfile\fR
 # DESCRIPTION
 #      The Postfix mail system uses optional tables for address
 #      rewriting or mail routing. These tables are usually in
 #      To find out what types of lookup tables your Postfix system
 #      supports use the \fBpostconf -m\fR command.
 #
+#      To test lookup tables, use the \fBpostmap\fR command as
+#      described in the SYNOPSIS above.
+#
 #      The general form of a Postfix regular expression table is:
-# .IP "\fIpattern result\fR"
-#      When \fIpattern\fR matches a search string, use the corresponding
-#      \fIresult\fR.
+# .IP "\fB/\fIpattern\fB/\fIflags result\fR"
+# .IP "\fB!/\fIpattern\fB/\fIflags result\fR"
+#      When \fIpattern\fR matches (does not match) a search string,
+#      use the corresponding \fIresult\fR value.
 # .IP "blank lines and comments"
 #      Empty lines and whitespace-only lines are ignored, as
 #      are lines whose first non-whitespace character is a `#'.
 # .IP "multi-line text"
 #      A logical line starts with non-whitespace text. A line that
 #      starts with whitespace continues a logical line.
-# .IP "\fIpattern1!pattern2 result\fR"
-#      Matches \fIpattern1\fR but not \fIpattern2\fR.
+# .IP "\fBif /\fIpattern\fB/\fIflags\fR"
+# .IP "\fBif !/\fIpattern\fB/\fIflags\fR"
+# .IP "\fBendif\fR"
+#       Examine the lines between \fBif\fR..\fBendif\fR only if
+#       \fIpattern\fR matches (does not match). The \fBif\fR..\fBendif\fR
+#      can nest.
+#       Do not prepend whitespace to patterns inside \fBif\fR..\fBendif\fR.
 # .PP
 #      Each pattern is a regular expression enclosed by a pair of delimiters.
 #      The regular expression syntax is described in \fIre_format\fR(7).
index 0ac28451b0f5ef2efc62f805f9d63930a0727a94..f17e39514cdbc1a12bbe7f909e106a5f12a83e5d 100644 (file)
@@ -5,6 +5,10 @@
 #      format of Postfix transport table
 # SYNOPSIS
 #      \fBpostmap /etc/postfix/transport\fR
+#
+#       \fBpostmap -q "\fIstring\fB" /etc/postfix/transport\fR
+#
+#       \fBpostmap -q - /etc/postfix/transport <\fIinputfile\fR
 # DESCRIPTION
 #      The optional \fBtransport\fR table specifies a mapping from email
 #      addresses to message delivery transports and/or relay hosts. The
index 7255da7ca6f0eb964664eba7786ccb047eee61e9..1d1f16b198b44e058b02a985a42c39f62637276d 100644 (file)
@@ -5,6 +5,10 @@
 #      format of Postfix virtual table
 # SYNOPSIS
 #      \fBpostmap /etc/postfix/virtual\fR
+#
+#      \fBpostmap -q "\fIstring\fB" /etc/postfix/virtual\fR
+#
+#      \fBpostmap -q - /etc/postfix/virtual <\fIinputfile\fR
 # DESCRIPTION
 #      The optional \fBvirtual\fR table specifies address redirections for
 #      local and non-local recipients or domains. The redirections are used
index bcea63e29ff8fab8109a4bb6749414be9e7a6ee6..f912a87f16e8e27d5977a74920d33412428abe84 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change the patchlevel and the release date. Snapshots change the
   * release date only, unless they include the same bugfix as a patch release.
   */
-#define MAIL_RELEASE_DATE      "20020916"
+#define MAIL_RELEASE_DATE      "20020917"
 
 #define VAR_MAIL_VERSION       "mail_version"
 #define DEF_MAIL_VERSION       "1.1.11-" MAIL_RELEASE_DATE
index edceda7cce89ee291f8efa4ee93a4246661511a4..c838969a43a4de7f48d9f0554e30f11dbd717b6c 100644 (file)
@@ -95,7 +95,7 @@
 /*     mail system owner. If \fIgroupname\fR is specified, the
 /*     corresponding group ID is used instead of the group ID of
 /*     \fIusername\fR.
-/* .IP "\fBeol=string\fR (default: \fB\en\fR)"
+/* .IP "\fBeol=string\fR (optional, default: \fB\en\fR)"
 /*     The output record delimiter. Typically one would use either
 /*     \fB\er\en\fR or \fB\en\fR. The usual C-style backslash escape
 /*     sequences are recognized: \fB\ea \eb \ef \en \er \et \ev
index 1391da0fdee3d226b13750b426ab7ec1bbd53b22..534c1ad196babfa0b7563e369b4f693182b016ee 100644 (file)
@@ -335,7 +335,7 @@ static void dict_pcre_close(DICT *dict)
        case DICT_PCRE_OP_ENDIF:
            break;
        default:
-           msg_panic("dict_regexp_close: unknown operation %d", rule->op);
+           msg_panic("dict_pcre_close: unknown operation %d", rule->op);
        }
        myfree((char *) rule);
     }
@@ -645,6 +645,10 @@ DICT   *dict_pcre_open(const char *mapname, int unused_flags, int dict_flags)
        last_rule = rule;
     }
 
+    if (nesting)
+        msg_warn("pcre map %s, line %d: more IFs than ENDIFs",
+                 mapname, lineno);
+
     vstring_free(line_buffer);
     vstream_fclose(map_fp);
 
index f741ea3a4d170e93ac1b34e2dbace08cf302ad31..fbd0f24f0709fb7b46e61d7733d063d888d8d52b 100644 (file)
@@ -574,11 +574,16 @@ static DICT_REGEXP_RULE *dict_regexp_parseline(const char *mapname, int lineno,
 #define FREE_EXPR_AND_RETURN(expr, rval) \
        { regfree(expr); myfree((char *) (expr)); return (rval); }
 
-       if (prescan_context.max_sub == 0)
+       if (prescan_context.max_sub == 0 || first_pat.match == 0)
            first_pat.options |= REG_NOSUB;
        if ((first_exp = dict_regexp_compile_pat(mapname, lineno,
                                                 &first_pat)) == 0)
            return (0);
+       if (prescan_context.max_sub > 0 && first_pat.match == 0) {
+           msg_warn("regexp map %s, line %d: $number found in negative match replacement text: "
+                    "skipping this rule", mapname, lineno);
+           FREE_EXPR_AND_RETURN(first_exp, 0);
+       }
        if (prescan_context.max_sub > first_exp->re_nsub) {
            msg_warn("regexp map %s, line %d: out of range replacement index \"%d\": "
                     "skipping this rule", mapname, lineno,