2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-09-03 23:55:18 +00:00

postfix-1.1.11-20020917

This commit is contained in:
Wietse Venema
2002-09-17 00:00:00 -05:00
committed by Viktor Dukhovni
parent 549abc01a8
commit 5ca8554dc7
41 changed files with 435 additions and 218 deletions

View File

@@ -6963,6 +6963,12 @@ Apologies for any names omitted.
This involved a rewrite of the pcre map code similar to This involved a rewrite of the pcre map code similar to
the regexp map code. File: util/dict_pcre.c. 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: Open problems:
Low: smtpd should log queue ID with reject/warn/hold/discard Low: smtpd should log queue ID with reject/warn/hold/discard

View File

@@ -12,30 +12,35 @@ snapshot release). Patches change the patchlevel and the release
date. Snapshots change only the release date, unless they include date. Snapshots change only the release date, unless they include
the same bugfixes as a patch release. 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 The relayhost setting now behaves as documented, i.e. you can no
longer specify multiple destinations. 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 Speedups of regexp table lookups by optimizing for the $number
execution settings for the actual number of $number substitutions substitutions that are actually present in the right-hand side.
in the right-hand side. Based on a suggestion by Liviu Daia. Based on a suggestion by Liviu Daia.
Speedups of regexp and pcre tables, using IF..ENDIF support based Speedups of regexp and pcre tables, using IF..ENDIF support. Based
on an idea by Bert Driehuis. To protect a block of patterns, use: on an idea by Bert Driehuis. To protect a block of patterns, use:
if /pattern/ if /pattern1/
/pattern2/ replacement text1 /pattern2/ result2
/pattern2/ replacement text2 /pattern3/ result3
endif endif
IF..ENDIF can nest. Don't specify blanks at the beginning of lines IF..ENDIF can nest. Don't specify blanks at the beginning of lines
inside IF..ENDIF. Lines beginning with whitespace are appended to inside IF..ENDIF, because lines beginning with whitespace are
the previous line. 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 Incompatible changes with Postfix snapshot 1.1.11-20020906
========================================================== ==========================================================

View File

@@ -6,6 +6,10 @@
# SYNOPSIS # SYNOPSIS
# postmap /etc/postfix/access # postmap /etc/postfix/access
# #
# postmap -q "string" /etc/postfix/access
#
# postmap -q - /etc/postfix/access <inputfile
#
# DESCRIPTION # DESCRIPTION
# The optional access table directs the Postfix SMTP server # The optional access table directs the Postfix SMTP server
# to selectively reject or accept mail. Access can be # to selectively reject or accept mail. Access can be

View File

@@ -1,4 +1,3 @@
#
# CANONICAL(5) CANONICAL(5) # CANONICAL(5) CANONICAL(5)
# #
# NAME # NAME
@@ -7,6 +6,10 @@
# SYNOPSIS # SYNOPSIS
# postmap /etc/postfix/canonical # postmap /etc/postfix/canonical
# #
# postmap -q "string" /etc/postfix/canonical
#
# postmap -q - /etc/postfix/canonical <inputfile
#
# DESCRIPTION # DESCRIPTION
# The optional canonical table specifies an address mapping # The optional canonical table specifies an address mapping
# for local and non-local addresses. The mapping is used by # for local and non-local addresses. The mapping is used by
@@ -183,5 +186,4 @@
# P.O. Box 704 # P.O. Box 704
# Yorktown Heights, NY 10598, USA # Yorktown Heights, NY 10598, USA
# #
# 1 # CANONICAL(5)
#

View File

@@ -411,38 +411,13 @@ mail_owner = postfix
# The header_checks parameter specifies an optional table with patterns # The header_checks parameter specifies an optional table with patterns
# that each logical message header is matched against, including # that each logical message header is matched against, including
# headers that span multiple physical lines. Patterns are matched # headers that span multiple physical lines.
# 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.
# #
# By default, these patterns also apply to MIME headers and to the # By default, these patterns also apply to MIME headers and to the
# headers of attached messages. With older Postfix versions, MIME and # headers of attached messages. With older Postfix versions, MIME and
# attached message headers were treated as body text. # 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 #header_checks = regexp:/etc/postfix/header_checks

View File

@@ -6,6 +6,10 @@
# SYNOPSIS # SYNOPSIS
# pcre:/etc/postfix/filename # pcre:/etc/postfix/filename
# #
# postmap -q "string" pcre:/etc/postfix/filename
#
# postmap -q - pcre:/etc/postfix/filename <inputfile
#
# DESCRIPTION # DESCRIPTION
# The Postfix mail system uses optional tables for address # The Postfix mail system uses optional tables for address
# rewriting or mail routing. These tables are usually in dbm # rewriting or mail routing. These tables are usually in dbm
@@ -15,109 +19,118 @@
# To find out what types of lookup tables your Postfix sys- # To find out what types of lookup tables your Postfix sys-
# tem supports use the postconf -m command. # 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: # The general form of a PCRE table is:
# #
# pattern result # /pattern/flags result
# When pattern matches a search string, use the cor- # When pattern matches a search string, use the cor-
# responding result. # responding result value.
# #
# blank lines and comments # blank lines and comments
# Empty lines and whitespace-only lines are ignored, # Empty lines and whitespace-only lines are ignored,
# as are lines whose first non-whitespace character # as are lines whose first non-whitespace character
# is a `#'. # is a `#'.
# #
# multi-line text # multi-line text
# A logical line starts with non-whitespace text. A # A logical line starts with non-whitespace text. A
# line that starts with whitespace continues a logi- # line that starts with whitespace continues a logi-
# cal line. # 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 # Each pattern is a perl-like regular expression. The
# expression delimiter can be any character, except whites- # expression delimiter can be any character, except whites-
# pace or characters that have special meaning (tradition- # pace or characters that have special meaning (tradition-
# ally the forward slash is used). The regular expression # ally the forward slash is used). The regular expression
# can contain whitespace. # can contain whitespace.
# #
# By default, matching is case-insensitive, and newlines are # By default, matching is case-insensitive, and newlines are
# not treated as special characters. The behavior is con- # not treated as special characters. The behavior is con-
# trolled by flags, which are toggled by appending one or # trolled by flags, which are toggled by appending one or
# more of the following characters after the pattern: # more of the following characters after the pattern:
# #
# i (default: on) # i (default: on)
# Toggles the case sensitivity flag. By default, # Toggles the case sensitivity flag. By default,
# matching is case insensitive. # matching is case insensitive.
# #
# m (default: off) # m (default: off)
# Toggles the PCRE_MULTILINE flag. When this flag is # Toggles the PCRE_MULTILINE flag. When this flag is
# on, the ^ and $ metacharacters match immediately # on, the ^ and $ metacharacters match immediately
# after and immediately before a newline character, # after and immediately before a newline character,
# respectively, in addition to matching at the start # respectively, in addition to matching at the start
# and end of the subject string. # and end of the subject string.
# #
# s (default: on) # s (default: on)
# Toggles the PCRE_DOTALL flag. When this flag is on, # Toggles the PCRE_DOTALL flag. When this flag is on,
# the . metacharacter matches the newline character. # 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- # is off by default, which is inconvenient for multi-
# line message header matching. # line message header matching.
# #
# x (default: off) # x (default: off)
# Toggles the pcre extended flag. When this flag is # Toggles the pcre extended flag. When this flag is
# on, whitespace in the pattern (other than in a # on, whitespace in the pattern (other than in a
# character class) and characters between a # outside # character class) and characters between a # outside
# a character class and the next newline character # a character class and the next newline character
# are ignored. An escaping backslash can be used to # are ignored. An escaping backslash can be used to
# include a whitespace or # character as part of the # include a whitespace or # character as part of the
# pattern. # pattern.
# #
# A (default: off) # A (default: off)
# Toggles the PCRE_ANCHORED flag. When this flag is # Toggles the PCRE_ANCHORED flag. When this flag is
# on, the pattern is forced to be "anchored", that # on, the pattern is forced to be "anchored", that
# is, it is constrained to match only at the start of # is, it is constrained to match only at the start of
# the string which is being searched (the "subject # the string which is being searched (the "subject
# string"). This effect can also be achieved by # string"). This effect can also be achieved by
# appropriate constructs in the pattern itself. # appropriate constructs in the pattern itself.
# #
# E (default: off) # E (default: off)
# Toggles the PCRE_DOLLAR_ENDONLY flag. When this # Toggles the PCRE_DOLLAR_ENDONLY flag. When this
# flag is on, a $ metacharacter in the pattern # flag is on, a $ metacharacter in the pattern
# matches only at the end of the subject string. # matches only at the end of the subject string.
# Without this flag, a dollar also matches immedi- # Without this flag, a dollar also matches immedi-
# ately before the final character if it is a newline # ately before the final character if it is a newline
# character (but not before any other newline charac- # 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. # is set.
# #
# U (default: off) # U (default: off)
# Toggles the ungreedy matching flag. When this flag # Toggles the ungreedy matching flag. When this flag
# is on, the pattern matching engine inverts the # is on, the pattern matching engine inverts the
# "greediness" of the quantifiers so that they are # "greediness" of the quantifiers so that they are
# not greedy by default, but become greedy if fol- # not greedy by default, but become greedy if fol-
# lowed by "?". This flag can also set by a (?U) # lowed by "?". This flag can also set by a (?U)
# modifier within the pattern. # modifier within the pattern.
# #
# X (default: off) # X (default: off)
# Toggles the PCRE_EXTRA flag. When this flag is on, # 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, # letter that has no special meaning causes an error,
# thus reserving these combinations for future expan- # thus reserving these combinations for future expan-
# sion. # sion.
# #
# Each pattern is applied to the entire lookup key string. # Each pattern is applied to the entire lookup key string.
# Depending on the application, that string is an entire # Depending on the application, that string is an entire
# client hostname, an entire client IP address, or an entire # client hostname, an entire client IP address, or an entire
# mail address. Thus, no parent domain or parent network # mail address. Thus, no parent domain or parent network
# search is done, and user@domain mail addresses are not # search is done, and user@domain mail addresses are not
# broken up into their user and domain constituent parts, # broken up into their user and domain constituent parts,
# nor is user+foo broken up into user and foo. # nor is user+foo broken up into user and foo.
# #
# Patterns are applied in the order as specified in the # Patterns are applied in the order as specified in the
# table, until a pattern is found that matches the search # table, until a pattern is found that matches the search
# string. # string.
# #
# Substitution of substrings from the matched expression # Substitution of substrings from the matched expression
# into the result string is possible using the conventional # into the result string is possible using the conventional
# perl syntax ($1, $2, etc.). The macros in the result # perl syntax ($1, $2, etc.). The macros in the result
# string may need to be written as ${n} or $(n) if they # string may need to be written as ${n} or $(n) if they
# aren't followed by whitespace. # aren't followed by whitespace.
# #
# EXAMPLE SMTPD ACCESS MAP # EXAMPLE SMTPD ACCESS MAP

View File

@@ -6,6 +6,10 @@
# SYNOPSIS # SYNOPSIS
# regexp:/etc/postfix/filename # regexp:/etc/postfix/filename
# #
# postmap -q "string" regexp:/etc/postfix/filename
#
# postmap -q - regexp:/etc/postfix/filename <inputfile
#
# DESCRIPTION # DESCRIPTION
# The Postfix mail system uses optional tables for address # The Postfix mail system uses optional tables for address
# rewriting or mail routing. These tables are usually in dbm # rewriting or mail routing. These tables are usually in dbm
@@ -15,24 +19,35 @@
# To find out what types of lookup tables your Postfix sys- # To find out what types of lookup tables your Postfix sys-
# tem supports use the postconf -m command. # 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: # The general form of a Postfix regular expression table is:
# #
# pattern result # /pattern/flags result
# When pattern matches a search string, use the cor- #
# responding result. # !/pattern/flags result
# When pattern matches (does not match) a search
# string, use the corresponding result value.
# #
# blank lines and comments # blank lines and comments
# Empty lines and whitespace-only lines are ignored, # Empty lines and whitespace-only lines are ignored,
# as are lines whose first non-whitespace character # as are lines whose first non-whitespace character
# is a `#'. # is a `#'.
# #
# multi-line text # multi-line text
# A logical line starts with non-whitespace text. A # A logical line starts with non-whitespace text. A
# line that starts with whitespace continues a logi- # line that starts with whitespace continues a logi-
# cal line. # cal line.
# #
# pattern1!pattern2 result # if /pattern/flags
# Matches pattern1 but not pattern2. #
# 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 # Each pattern is a regular expression enclosed by a pair of
# delimiters. The regular expression syntax is described in # delimiters. The regular expression syntax is described in

View File

@@ -8,11 +8,15 @@
# that each logical message header is matched against, including # that each logical message header is matched against, including
# headers that span multiple physical lines. Patterns are matched # headers that span multiple physical lines. Patterns are matched
# in the specified order, and the search stops upon the first match. # 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 # When a pattern matches, what happens next depends on the associated
# action that is specified in the right-hand side of the table: # action that is specified in the right-hand side of the table:
# #
# REJECT [optional text...] # 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. # originator and is logged to the maillog file.
# IGNORE Silently discard the header line. # IGNORE Silently discard the header line.
# WARN [optional text...] # 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 # related headers in message headers, and to the headers that follow
# multipart boundary strings. Headers may span multiple physical lines. # multipart boundary strings. Headers may span multiple physical lines.
# Patterns are matched in the specified order, and the search stops # Patterns are matched in the specified order, and the search stops
# upon the first match. When a pattern matches, what happens next # upon the first match.
# depends on the associated action that is specified in the right-hand #
# side of the table: # 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 [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. # originator and is logged to the maillog file.
# IGNORE Silently discard the body line # IGNORE Silently discard the body line
# WARN [optional text...] # WARN [optional text...]
# Log the body line and the optional text. This is useful # 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. # REJECT or into a DISCARD.
# HOLD [optional text...] # HOLD [optional text...]
# Place the message on the hold queue. Mail on hold can be # 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 # that each attached message header is matched against (except for
# MIME related headers). Headers may span multiple physical lines. # MIME related headers). Headers may span multiple physical lines.
# Patterns are matched in the specified order, and the search stops # Patterns are matched in the specified order, and the search stops
# upon the first match. When a pattern matches, what happens next # upon the first match.
# depends on the associated action that is specified in the right-hand #
# side of the table: # 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 the entire message is rejected.
# REJECT text.... The text is sent to the originator. # 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 # The body_checks parameter specifies an optional table with patterns
# that each physical line in the message body is matched against # that each physical line in the message body is matched against
# (including MIME headers inside the message body - Postfix does not # (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 # Lines are matched one at a time. Long lines are matched in chunks
# of at most $line_length_limit characters. Patterns are matched in # of at most $line_length_limit characters. Patterns are matched in
# the specified order, and the search stops upon the first match. # 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 # When a pattern matches, what happens next depends on the associated
# action that is specified in the right-hand side of the table: # action that is specified in the right-hand side of the table:
# #

View File

@@ -15,6 +15,12 @@
# matching ungreedy (see PCRE documentation and source for more # matching ungreedy (see PCRE documentation and source for more
# info). # 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 # The second field is the "replacement" string - the text
# returned by the match. When used for smtpd checks, this would # returned by the match. When used for smtpd checks, this would
# be a helpful message to misguided users (or an offensive # be a helpful message to misguided users (or an offensive

View File

@@ -2,9 +2,8 @@
# Sample pcre (PERL-compatible regular expression) map file for # Sample pcre (PERL-compatible regular expression) map file for
# mail body filtering. See pcre_table(5) for syntax description. # mail body filtering. See pcre_table(5) for syntax description.
# #
# Mail body lines are filtered one line at a time. In particular, # Mail body lines are filtered one line at a time. MIME headers are
# multi-line MIME headers in the message body are filtered one text # filtered as message headers, i.e. not as part of the mail body.
# line at a time.
# #
# The first field is a perl-like regular expression. The expression # The first field is a perl-like regular expression. The expression
# delimiter can be any character except whitespace, or characters # delimiter can be any character except whitespace, or characters
@@ -18,6 +17,12 @@
# matching ungreedy (see PCRE documentation and source for more # matching ungreedy (see PCRE documentation and source for more
# info). # 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 # The second field is the "replacement" string - the text
# returned by the match. # returned by the match.
# #

View File

@@ -18,6 +18,12 @@
# matching ungreedy (see PCRE documentation and source for more # matching ungreedy (see PCRE documentation and source for more
# info). # 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 # The second field is the "replacement" string - the text
# returned by the match. # returned by the match.
# #

View File

@@ -3,17 +3,24 @@
# #
# The general format of a table entry is PATTERN RESULT. # The general format of a table entry is PATTERN RESULT.
# #
# The pattern format is /regexp/flags or /regexp/flags!/regexp/flags # The pattern format is `/regexp/flags' or `!/regexp/flags' where regexp
# where regexp is a regular expression as found in regexp(5), and flags are # is a regular expression as found in re_format(7), and flags are
# i: toggle ignore case (REG_ICASE - default is to ignore case) # i: toggle ignore case (REG_ICASE - default is to ignore case)
# x: toggle extended expression (REG_EXTENDED - default is extended) # x: toggle extended expression (REG_EXTENDED - default is extended)
# m: toggle multiline mode (REG_NEWLINE - default is non-multiline mode) # 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 # In order for a line to match, the regexp must match. If the regexp
# second (if present) must not match. The first matching line wins, # is prefixed with !, it must not match. The first line with a successful
# terminating processing of the ruleset. # (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 # Disallow sender-specified routing. This is a must if you relay mail
#for other domains. #for other domains.

View File

@@ -1,20 +1,26 @@
# Sample regexp message body filter lookup "table". See regexp_table(5) # Sample regexp message body filter lookup "table". See regexp_table(5)
# for a description of the syntax. # for a description of the syntax.
# #
# Mail body lines are filtered one line at a time. In particular, multi-line # Mail body lines are filtered one line at a time. MIME headers are
# MIME headers in the message body are filtered one text line at a time. # filtered as message headers, i.e. not as part of the mail body.
# #
# The general format of a table entry is PATTERN RESULT. # The general format of a table entry is PATTERN RESULT.
# #
# The pattern format is /regexp/flags or /regexp/flags!/regexp/flags # The pattern format is `/regexp/flags' or `!/regexp/flags' where regexp
# where regexp is a regular expression as found in regexp(5), and flags are # is a regular expression as found in re_format(7), and flags are
# i: toggle ignore case (REG_ICASE - default is to ignore case) # i: toggle ignore case (REG_ICASE - default is to ignore case)
# x: toggle extended expression (REG_EXTENDED - default is extended) # x: toggle extended expression (REG_EXTENDED - default is extended)
# m: toggle multiline mode (REG_NEWLINE - default is non-multiline mode) # 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 # In order for a line to match, the regexp must match. If the regexp
# second (if present) must not match. The first matching line wins, # is prefixed with !, it must not match. The first line with a successful
# terminating processing of the ruleset. # (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: # The result is one of the following:
# REJECT [optional text...] # REJECT [optional text...]

View File

@@ -7,15 +7,21 @@
# #
# The general format of a table entry is PATTERN RESULT. # The general format of a table entry is PATTERN RESULT.
# #
# The pattern format is /regexp/flags or /regexp/flags!/regexp/flags # The pattern format is `/regexp/flags' or `!/regexp/flags' where regexp
# where regexp is a regular expression as found in regexp(5), and flags are # is a regular expression as found in re_format(7), and flags are
# i: toggle ignore case (REG_ICASE - default is to ignore case) # i: toggle ignore case (REG_ICASE - default is to ignore case)
# x: toggle extended expression (REG_EXTENDED - default is extended) # x: toggle extended expression (REG_EXTENDED - default is extended)
# m: toggle multiline mode (REG_NEWLINE - default is non-multiline mode) # 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 # In order for a line to match, the regexp must match. If the regexp
# second (if present) must not match. The first matching line wins, # is prefixed with !, it must not match. The first line with a successful
# terminating processing of the ruleset. # (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: # The result is one of the following:
# REJECT [optional text...] # REJECT [optional text...]

View File

@@ -6,6 +6,10 @@
# SYNOPSIS # SYNOPSIS
# postmap /etc/postfix/transport # postmap /etc/postfix/transport
# #
# postmap -q "string" /etc/postfix/transport
#
# postmap -q - /etc/postfix/transport <inputfile
#
# DESCRIPTION # DESCRIPTION
# The optional transport table specifies a mapping from # The optional transport table specifies a mapping from
# email addresses to message delivery transports and/or # email addresses to message delivery transports and/or

View File

@@ -6,6 +6,10 @@
# SYNOPSIS # SYNOPSIS
# postmap /etc/postfix/virtual # postmap /etc/postfix/virtual
# #
# postmap -q "string" /etc/postfix/virtual
#
# postmap -q - /etc/postfix/virtual <inputfile
#
# DESCRIPTION # DESCRIPTION
# The optional virtual table specifies address redirections # The optional virtual table specifies address redirections
# for local and non-local recipients or domains. The redi- # for local and non-local recipients or domains. The redi-

View File

@@ -7,6 +7,10 @@ ACCESS(5) ACCESS(5)
<b>SYNOPSIS</b> <b>SYNOPSIS</b>
<b>postmap</b> <b>/etc/postfix/access</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> <b>DESCRIPTION</b>
The optional <b>access</b> table directs the Postfix SMTP server The optional <b>access</b> table directs the Postfix SMTP server
to selectively reject or accept mail. Access can be to selectively reject or accept mail. Access can be

View File

@@ -1,5 +1,4 @@
<html> <head> </head> <body> <pre> <html> <head> </head> <body> <pre>
CANONICAL(5) CANONICAL(5) CANONICAL(5) CANONICAL(5)
<b>NAME</b> <b>NAME</b>
@@ -8,6 +7,10 @@ CANONICAL(5) CANONICAL(5)
<b>SYNOPSIS</b> <b>SYNOPSIS</b>
<b>postmap</b> <b>/etc/postfix/canonical</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> <b>DESCRIPTION</b>
The optional <b>canonical</b> table specifies an address mapping The optional <b>canonical</b> table specifies an address mapping
for local and non-local addresses. The mapping is used by for local and non-local addresses. The mapping is used by
@@ -184,6 +187,5 @@ CANONICAL(5) CANONICAL(5)
P.O. Box 704 P.O. Box 704
Yorktown Heights, NY 10598, USA Yorktown Heights, NY 10598, USA
1 CANONICAL(5)
</pre> </body> </html> </pre> </body> </html>

View File

@@ -5,7 +5,11 @@ PCRE_TABLE(5) PCRE_TABLE(5)
pcre_table - format of Postfix PCRE tables pcre_table - format of Postfix PCRE tables
<b>SYNOPSIS</b> <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> <b>DESCRIPTION</b>
The Postfix mail system uses optional tables for address 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- To find out what types of lookup tables your Postfix sys-
tem supports use the <b>postconf</b> <b>-m</b> command. 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: The general form of a PCRE table is:
<i>pattern</i> <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- When <i>pattern</i> matches a search string, use the cor-
responding <i>result</i>. responding <i>result</i> value.
blank lines and comments blank lines and comments
Empty lines and whitespace-only lines are ignored, Empty lines and whitespace-only lines are ignored,
as are lines whose first non-whitespace character as are lines whose first non-whitespace character
is a `#'. is a `#'.
multi-line text multi-line text
A logical line starts with non-whitespace text. A A logical line starts with non-whitespace text. A
line that starts with whitespace continues a logi- line that starts with whitespace continues a logi-
cal line. 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 Each pattern is a perl-like regular expression. The
expression delimiter can be any character, except whites- expression delimiter can be any character, except whites-
pace or characters that have special meaning (tradition- pace or characters that have special meaning (tradition-
ally the forward slash is used). The regular expression ally the forward slash is used). The regular expression
can contain whitespace. can contain whitespace.
By default, matching is case-insensitive, and newlines are By default, matching is case-insensitive, and newlines are
not treated as special characters. The behavior is con- not treated as special characters. The behavior is con-
trolled by flags, which are toggled by appending one or trolled by flags, which are toggled by appending one or
more of the following characters after the pattern: more of the following characters after the pattern:
<b>i</b> (default: on) <b>i</b> (default: on)
Toggles the case sensitivity flag. By default, Toggles the case sensitivity flag. By default,
matching is case insensitive. matching is case insensitive.
<b>m</b> (default: off) <b>m</b> (default: off)
Toggles the PCRE_MULTILINE flag. When this flag is Toggles the PCRE_MULTILINE flag. When this flag is
on, the <b>^</b> and $ metacharacters match immediately on, the <b>^</b> and $ metacharacters match immediately
after and immediately before a newline character, after and immediately before a newline character,
respectively, in addition to matching at the start respectively, in addition to matching at the start
and end of the subject string. and end of the subject string.
<b>s</b> (default: on) <b>s</b> (default: on)
Toggles the PCRE_DOTALL flag. When this flag is on, Toggles the PCRE_DOTALL flag. When this flag is on,
the <b>.</b> metacharacter matches the newline character. 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- is off by default, which is inconvenient for multi-
line message header matching. line message header matching.
<b>x</b> (default: off) <b>x</b> (default: off)
Toggles the pcre extended flag. When this flag is Toggles the pcre extended flag. When this flag is
on, whitespace in the pattern (other than in a on, whitespace in the pattern (other than in a
character class) and characters between a <b>#</b> outside character class) and characters between a <b>#</b> outside
a character class and the next newline character a character class and the next newline character
are ignored. An escaping backslash can be used to are ignored. An escaping backslash can be used to
include a whitespace or <b>#</b> character as part of the include a whitespace or <b>#</b> character as part of the
pattern. pattern.
<b>A</b> (default: off) <b>A</b> (default: off)
Toggles the PCRE_ANCHORED flag. When this flag is Toggles the PCRE_ANCHORED flag. When this flag is
on, the pattern is forced to be "anchored", that on, the pattern is forced to be "anchored", that
is, it is constrained to match only at the start of is, it is constrained to match only at the start of
the string which is being searched (the "subject the string which is being searched (the "subject
string"). This effect can also be achieved by string"). This effect can also be achieved by
appropriate constructs in the pattern itself. appropriate constructs in the pattern itself.
<b>E</b> (default: off) <b>E</b> (default: off)
Toggles the PCRE_DOLLAR_ENDONLY flag. When this Toggles the PCRE_DOLLAR_ENDONLY flag. When this
flag is on, a <b>$</b> metacharacter in the pattern flag is on, a <b>$</b> metacharacter in the pattern
matches only at the end of the subject string. matches only at the end of the subject string.
Without this flag, a dollar also matches immedi- Without this flag, a dollar also matches immedi-
ately before the final character if it is a newline ately before the final character if it is a newline
character (but not before any other newline charac- 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. is set.
<b>U</b> (default: off) <b>U</b> (default: off)
Toggles the ungreedy matching flag. When this flag Toggles the ungreedy matching flag. When this flag
is on, the pattern matching engine inverts the is on, the pattern matching engine inverts the
"greediness" of the quantifiers so that they are "greediness" of the quantifiers so that they are
not greedy by default, but become greedy if fol- not greedy by default, but become greedy if fol-
lowed by "?". This flag can also set by a (?U) lowed by "?". This flag can also set by a (?U)
modifier within the pattern. modifier within the pattern.
<b>X</b> (default: off) <b>X</b> (default: off)
Toggles the PCRE_EXTRA flag. When this flag is on, 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, letter that has no special meaning causes an error,
thus reserving these combinations for future expan- thus reserving these combinations for future expan-
sion. sion.
Each pattern is applied to the entire lookup key string. Each pattern is applied to the entire lookup key string.
Depending on the application, that string is an entire Depending on the application, that string is an entire
client hostname, an entire client IP address, or an entire client hostname, an entire client IP address, or an entire
mail address. Thus, no parent domain or parent network mail address. Thus, no parent domain or parent network
search is done, and <i>user@domain</i> mail addresses are not 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, 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>. 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 Patterns are applied in the order as specified in the
table, until a pattern is found that matches the search table, until a pattern is found that matches the search
string. string.
Substitution of substrings from the matched expression Substitution of substrings from the matched expression
into the result string is possible using the conventional into the result string is possible using the conventional
perl syntax ($1, $2, etc.). The macros in the result perl syntax ($1, $2, etc.). The macros in the result
string may need to be written as ${n} or $(n) if they string may need to be written as ${n} or $(n) if they
aren't followed by whitespace. aren't followed by whitespace.
<b>EXAMPLE</b> <b>SMTPD</b> <b>ACCESS</b> <b>MAP</b> <b>EXAMPLE</b> <b>SMTPD</b> <b>ACCESS</b> <b>MAP</b>

View File

@@ -107,7 +107,7 @@ PIPE(8) PIPE(8)
is specified, the corresponding group ID is used is specified, the corresponding group ID is used
instead of the group ID of <i>username</i>. 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 The output record delimiter. Typically one would
use either <b>\r\n</b> or <b>\n</b>. The usual C-style backslash 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> escape sequences are recognized: <b>\a</b> <b>\b</b> <b>\f</b> <b>\n</b> <b>\r</b> <b>\t</b>

View File

@@ -5,7 +5,11 @@ REGEXP_TABLE(5) REGEXP_TABLE(5)
regexp_table - format of Postfix regular expression tables regexp_table - format of Postfix regular expression tables
<b>SYNOPSIS</b> <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> <b>DESCRIPTION</b>
The Postfix mail system uses optional tables for address 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- To find out what types of lookup tables your Postfix sys-
tem supports use the <b>postconf</b> <b>-m</b> command. 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: The general form of a Postfix regular expression table is:
<i>pattern</i> <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>. <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 blank lines and comments
Empty lines and whitespace-only lines are ignored, Empty lines and whitespace-only lines are ignored,
as are lines whose first non-whitespace character as are lines whose first non-whitespace character
is a `#'. is a `#'.
multi-line text multi-line text
A logical line starts with non-whitespace text. A A logical line starts with non-whitespace text. A
line that starts with whitespace continues a logi- line that starts with whitespace continues a logi-
cal line. cal line.
<i>pattern1!pattern2</i> <i>result</i> <b>if</b> <b>/</b><i>pattern</i><b>/</b><i>flags</i>
Matches <i>pattern1</i> but not <i>pattern2</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 Each pattern is a regular expression enclosed by a pair of
delimiters. The regular expression syntax is described in delimiters. The regular expression syntax is described in

View File

@@ -7,6 +7,10 @@ TRANSPORT(5) TRANSPORT(5)
<b>SYNOPSIS</b> <b>SYNOPSIS</b>
<b>postmap</b> <b>/etc/postfix/transport</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> <b>DESCRIPTION</b>
The optional <b>transport</b> table specifies a mapping from The optional <b>transport</b> table specifies a mapping from
email addresses to message delivery transports and/or email addresses to message delivery transports and/or

View File

@@ -7,6 +7,10 @@ VIRTUAL(5) VIRTUAL(5)
<b>SYNOPSIS</b> <b>SYNOPSIS</b>
<b>postmap</b> <b>/etc/postfix/virtual</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> <b>DESCRIPTION</b>
The optional <b>virtual</b> table specifies address redirections The optional <b>virtual</b> table specifies address redirections
for local and non-local recipients or domains. The redi- for local and non-local recipients or domains. The redi-

View File

@@ -191,6 +191,10 @@ case "$SYSTEM.$RELEASE" in
echo "See the RELEASE_NOTES file for more information." 1>&2 echo "See the RELEASE_NOTES file for more information." 1>&2
exit 1 exit 1
fi 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. # GDBM locks the DBM .pag file after open. This breaks postmap.
# if [ -f /usr/include/gdbm-ndbm.h ] # if [ -f /usr/include/gdbm-ndbm.h ]
# then # then
@@ -202,7 +206,7 @@ case "$SYSTEM.$RELEASE" in
# GDBM_LIBS=gdbm # GDBM_LIBS=gdbm
# fi # fi
SYSLIBS="-ldb" SYSLIBS="-ldb"
for name in nsl resolv $GDBM_LIBS for name in nsl resolv pcre $GDBM_LIBS
do do
test -e /usr/lib/lib$name.a -o -e /usr/lib/lib$name.so \ 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 \ -o -e /lib/lib$name.a -o -e /lib/lib$name.so \

View File

@@ -9,6 +9,10 @@ format of Postfix access table
.na .na
.nf .nf
\fBpostmap /etc/postfix/access\fR \fBpostmap /etc/postfix/access\fR
\fBpostmap -q "\fIstring\fB" /etc/postfix/access\fR
\fBpostmap -q - /etc/postfix/access <\fIinputfile\fR
.SH DESCRIPTION .SH DESCRIPTION
.ad .ad
.fi .fi

View File

@@ -9,6 +9,10 @@ format of Postfix canonical table
.na .na
.nf .nf
\fBpostmap /etc/postfix/canonical\fR \fBpostmap /etc/postfix/canonical\fR
\fBpostmap -q "\fIstring\fB" /etc/postfix/canonical\fR
\fBpostmap -q - /etc/postfix/canonical <\fIinputfile\fR
.SH DESCRIPTION .SH DESCRIPTION
.ad .ad
.fi .fi

View File

@@ -8,7 +8,11 @@ format of Postfix PCRE tables
.SH SYNOPSIS .SH SYNOPSIS
.na .na
.nf .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 .SH DESCRIPTION
.ad .ad
.fi .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 To find out what types of lookup tables your Postfix system
supports use the \fBpostconf -m\fR command. 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: 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 When \fIpattern\fR matches a search string, use the corresponding
\fIresult\fR. \fIresult\fR value.
.IP "blank lines and comments" .IP "blank lines and comments"
Empty lines and whitespace-only lines are ignored, as Empty lines and whitespace-only lines are ignored, as
are lines whose first non-whitespace character is a `#'. are lines whose first non-whitespace character is a `#'.
.IP "multi-line text" .IP "multi-line text"
A logical line starts with non-whitespace text. A line that A logical line starts with non-whitespace text. A line that
starts with whitespace continues a logical line. 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 .PP
Each pattern is a perl-like regular expression. The expression Each pattern is a perl-like regular expression. The expression
delimiter can be any character, except whitespace or characters delimiter can be any character, except whitespace or characters

View File

@@ -8,7 +8,11 @@ format of Postfix regular expression tables
.SH SYNOPSIS .SH SYNOPSIS
.na .na
.nf .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 .SH DESCRIPTION
.ad .ad
.fi .fi
@@ -20,18 +24,27 @@ can be specified in POSIX regular expression form.
To find out what types of lookup tables your Postfix system To find out what types of lookup tables your Postfix system
supports use the \fBpostconf -m\fR command. 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: The general form of a Postfix regular expression table is:
.IP "\fIpattern result\fR" .IP "\fB/\fIpattern\fB/\fIflags result\fR"
When \fIpattern\fR matches a search string, use the corresponding .IP "\fB!/\fIpattern\fB/\fIflags result\fR"
\fIresult\fR. When \fIpattern\fR matches (does not match) a search string,
use the corresponding \fIresult\fR value.
.IP "blank lines and comments" .IP "blank lines and comments"
Empty lines and whitespace-only lines are ignored, as Empty lines and whitespace-only lines are ignored, as
are lines whose first non-whitespace character is a `#'. are lines whose first non-whitespace character is a `#'.
.IP "multi-line text" .IP "multi-line text"
A logical line starts with non-whitespace text. A line that A logical line starts with non-whitespace text. A line that
starts with whitespace continues a logical line. starts with whitespace continues a logical line.
.IP "\fIpattern1!pattern2 result\fR" .IP "\fBif /\fIpattern\fB/\fIflags\fR"
Matches \fIpattern1\fR but not \fIpattern2\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 .PP
Each pattern is a regular expression enclosed by a pair of delimiters. Each pattern is a regular expression enclosed by a pair of delimiters.
The regular expression syntax is described in \fIre_format\fR(7). The regular expression syntax is described in \fIre_format\fR(7).

View File

@@ -9,6 +9,10 @@ format of Postfix transport table
.na .na
.nf .nf
\fBpostmap /etc/postfix/transport\fR \fBpostmap /etc/postfix/transport\fR
\fBpostmap -q "\fIstring\fB" /etc/postfix/transport\fR
\fBpostmap -q - /etc/postfix/transport <\fIinputfile\fR
.SH DESCRIPTION .SH DESCRIPTION
.ad .ad
.fi .fi

View File

@@ -9,6 +9,10 @@ format of Postfix virtual table
.na .na
.nf .nf
\fBpostmap /etc/postfix/virtual\fR \fBpostmap /etc/postfix/virtual\fR
\fBpostmap -q "\fIstring\fB" /etc/postfix/virtual\fR
\fBpostmap -q - /etc/postfix/virtual <\fIinputfile\fR
.SH DESCRIPTION .SH DESCRIPTION
.ad .ad
.fi .fi

View File

@@ -105,7 +105,7 @@ commands with root privileges, or with the privileges of the
mail system owner. If \fIgroupname\fR is specified, the mail system owner. If \fIgroupname\fR is specified, the
corresponding group ID is used instead of the group ID of corresponding group ID is used instead of the group ID of
\fIusername\fR. \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 The output record delimiter. Typically one would use either
\fB\er\en\fR or \fB\en\fR. The usual C-style backslash escape \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 sequences are recognized: \fB\ea \eb \ef \en \er \et \ev

View File

@@ -5,6 +5,10 @@
# format of Postfix access table # format of Postfix access table
# SYNOPSIS # SYNOPSIS
# \fBpostmap /etc/postfix/access\fR # \fBpostmap /etc/postfix/access\fR
#
# \fBpostmap -q "\fIstring\fB" /etc/postfix/access\fR
#
# \fBpostmap -q - /etc/postfix/access <\fIinputfile\fR
# DESCRIPTION # DESCRIPTION
# The optional \fBaccess\fR table directs the Postfix SMTP server # The optional \fBaccess\fR table directs the Postfix SMTP server
# to selectively reject or accept mail. Access can be allowed or # to selectively reject or accept mail. Access can be allowed or

View File

@@ -5,6 +5,10 @@
# format of Postfix canonical table # format of Postfix canonical table
# SYNOPSIS # SYNOPSIS
# \fBpostmap /etc/postfix/canonical\fR # \fBpostmap /etc/postfix/canonical\fR
#
# \fBpostmap -q "\fIstring\fB" /etc/postfix/canonical\fR
#
# \fBpostmap -q - /etc/postfix/canonical <\fIinputfile\fR
# DESCRIPTION # DESCRIPTION
# The optional \fBcanonical\fR table specifies an address mapping for # The optional \fBcanonical\fR table specifies an address mapping for
# local and non-local addresses. The mapping is used by the # local and non-local addresses. The mapping is used by the

View File

@@ -4,7 +4,11 @@
# SUMMARY # SUMMARY
# format of Postfix PCRE tables # format of Postfix PCRE tables
# SYNOPSIS # 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 # DESCRIPTION
# The Postfix mail system uses optional tables for address # The Postfix mail system uses optional tables for address
# rewriting or mail routing. These tables are usually in # rewriting or mail routing. These tables are usually in
@@ -14,16 +18,24 @@
# To find out what types of lookup tables your Postfix system # To find out what types of lookup tables your Postfix system
# supports use the \fBpostconf -m\fR command. # 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: # 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 # When \fIpattern\fR matches a search string, use the corresponding
# \fIresult\fR. # \fIresult\fR value.
# .IP "blank lines and comments" # .IP "blank lines and comments"
# Empty lines and whitespace-only lines are ignored, as # Empty lines and whitespace-only lines are ignored, as
# are lines whose first non-whitespace character is a `#'. # are lines whose first non-whitespace character is a `#'.
# .IP "multi-line text" # .IP "multi-line text"
# A logical line starts with non-whitespace text. A line that # A logical line starts with non-whitespace text. A line that
# starts with whitespace continues a logical line. # 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 # .PP
# Each pattern is a perl-like regular expression. The expression # Each pattern is a perl-like regular expression. The expression
# delimiter can be any character, except whitespace or characters # delimiter can be any character, except whitespace or characters

View File

@@ -4,7 +4,11 @@
# SUMMARY # SUMMARY
# format of Postfix regular expression tables # format of Postfix regular expression tables
# SYNOPSIS # 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 # DESCRIPTION
# The Postfix mail system uses optional tables for address # The Postfix mail system uses optional tables for address
# rewriting or mail routing. These tables are usually in # rewriting or mail routing. These tables are usually in
@@ -14,18 +18,27 @@
# To find out what types of lookup tables your Postfix system # To find out what types of lookup tables your Postfix system
# supports use the \fBpostconf -m\fR command. # 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: # The general form of a Postfix regular expression table is:
# .IP "\fIpattern result\fR" # .IP "\fB/\fIpattern\fB/\fIflags result\fR"
# When \fIpattern\fR matches a search string, use the corresponding # .IP "\fB!/\fIpattern\fB/\fIflags result\fR"
# \fIresult\fR. # When \fIpattern\fR matches (does not match) a search string,
# use the corresponding \fIresult\fR value.
# .IP "blank lines and comments" # .IP "blank lines and comments"
# Empty lines and whitespace-only lines are ignored, as # Empty lines and whitespace-only lines are ignored, as
# are lines whose first non-whitespace character is a `#'. # are lines whose first non-whitespace character is a `#'.
# .IP "multi-line text" # .IP "multi-line text"
# A logical line starts with non-whitespace text. A line that # A logical line starts with non-whitespace text. A line that
# starts with whitespace continues a logical line. # starts with whitespace continues a logical line.
# .IP "\fIpattern1!pattern2 result\fR" # .IP "\fBif /\fIpattern\fB/\fIflags\fR"
# Matches \fIpattern1\fR but not \fIpattern2\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 # .PP
# Each pattern is a regular expression enclosed by a pair of delimiters. # Each pattern is a regular expression enclosed by a pair of delimiters.
# The regular expression syntax is described in \fIre_format\fR(7). # The regular expression syntax is described in \fIre_format\fR(7).

View File

@@ -5,6 +5,10 @@
# format of Postfix transport table # format of Postfix transport table
# SYNOPSIS # SYNOPSIS
# \fBpostmap /etc/postfix/transport\fR # \fBpostmap /etc/postfix/transport\fR
#
# \fBpostmap -q "\fIstring\fB" /etc/postfix/transport\fR
#
# \fBpostmap -q - /etc/postfix/transport <\fIinputfile\fR
# DESCRIPTION # DESCRIPTION
# The optional \fBtransport\fR table specifies a mapping from email # The optional \fBtransport\fR table specifies a mapping from email
# addresses to message delivery transports and/or relay hosts. The # addresses to message delivery transports and/or relay hosts. The

View File

@@ -5,6 +5,10 @@
# format of Postfix virtual table # format of Postfix virtual table
# SYNOPSIS # SYNOPSIS
# \fBpostmap /etc/postfix/virtual\fR # \fBpostmap /etc/postfix/virtual\fR
#
# \fBpostmap -q "\fIstring\fB" /etc/postfix/virtual\fR
#
# \fBpostmap -q - /etc/postfix/virtual <\fIinputfile\fR
# DESCRIPTION # DESCRIPTION
# The optional \fBvirtual\fR table specifies address redirections for # The optional \fBvirtual\fR table specifies address redirections for
# local and non-local recipients or domains. The redirections are used # local and non-local recipients or domains. The redirections are used

View File

@@ -20,7 +20,7 @@
* Patches change the patchlevel and the release date. Snapshots change the * Patches change the patchlevel and the release date. Snapshots change the
* release date only, unless they include the same bugfix as a patch release. * 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 VAR_MAIL_VERSION "mail_version"
#define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE #define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE

View File

@@ -95,7 +95,7 @@
/* mail system owner. If \fIgroupname\fR is specified, the /* mail system owner. If \fIgroupname\fR is specified, the
/* corresponding group ID is used instead of the group ID of /* corresponding group ID is used instead of the group ID of
/* \fIusername\fR. /* \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 /* The output record delimiter. Typically one would use either
/* \fB\er\en\fR or \fB\en\fR. The usual C-style backslash escape /* \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 /* sequences are recognized: \fB\ea \eb \ef \en \er \et \ev

View File

@@ -335,7 +335,7 @@ static void dict_pcre_close(DICT *dict)
case DICT_PCRE_OP_ENDIF: case DICT_PCRE_OP_ENDIF:
break; break;
default: default:
msg_panic("dict_regexp_close: unknown operation %d", rule->op); msg_panic("dict_pcre_close: unknown operation %d", rule->op);
} }
myfree((char *) rule); myfree((char *) rule);
} }
@@ -645,6 +645,10 @@ DICT *dict_pcre_open(const char *mapname, int unused_flags, int dict_flags)
last_rule = rule; last_rule = rule;
} }
if (nesting)
msg_warn("pcre map %s, line %d: more IFs than ENDIFs",
mapname, lineno);
vstring_free(line_buffer); vstring_free(line_buffer);
vstream_fclose(map_fp); vstream_fclose(map_fp);

View File

@@ -574,11 +574,16 @@ static DICT_REGEXP_RULE *dict_regexp_parseline(const char *mapname, int lineno,
#define FREE_EXPR_AND_RETURN(expr, rval) \ #define FREE_EXPR_AND_RETURN(expr, rval) \
{ regfree(expr); myfree((char *) (expr)); return (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; first_pat.options |= REG_NOSUB;
if ((first_exp = dict_regexp_compile_pat(mapname, lineno, if ((first_exp = dict_regexp_compile_pat(mapname, lineno,
&first_pat)) == 0) &first_pat)) == 0)
return (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) { if (prescan_context.max_sub > first_exp->re_nsub) {
msg_warn("regexp map %s, line %d: out of range replacement index \"%d\": " msg_warn("regexp map %s, line %d: out of range replacement index \"%d\": "
"skipping this rule", mapname, lineno, "skipping this rule", mapname, lineno,