sample-pcre-body.cf   [plain text]


#
#	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. 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
#	that have special meaning to the regexp library (traditionally
#	the forward slash is used). The regular expression can contain
#	whitespace.
#
#	By default, matching is case-INsensitive, although following
#	the second slash with an 'i' will reverse this. Other flags are
#	supported, but the only other useful one is 'U', which makes
#	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.
#
#	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 body line.
#	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 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 body line is logged
#			together with the optional text.
#	DISCARD [optional text...]
#			Claim successful delivery and silently discard the
#			message.  The matched body line is logged together
#			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. More information about content filters
#			is in the Postfix FILTER_README file. This feature
#			overrides the main.cf content_filter setting.
#
#	Substitution of sub-strings from the matched expression is
#	possible using the conventional perl syntax. The macros in the
#	replacement string may need to be protected with curly braces
#	if they aren't followed by whitespace (see the examples
#	below).
#
#	Lines starting with whitespace are continuation lines - they are
#	appended to the previous line (there should be no whitespace
#	before your regular expression!)
#

# Skip over base 64 encoded blocks. This saves lots of CPU cycles.
# Expressions by Liviu Daia, amended by Victor Duchovni.
# Requires PCRE version 3.
~^[[:alnum:]+/]{60,}\s*$~	OK

# Your own body patterns go here.