From 8f6da007395f861a6385e6fe5aa313d2aea1c5b9 Mon Sep 17 00:00:00 2001
From: Wietse Venema
+BOUNCE(5) BOUNCE(5)
+
+NAME
+ bounce - Postfix bounce message template format
+
+SYNOPSIS
+ bounce_template_file = /etc/postfix/bounce.cf
+
+ postconf -b [template_file]
+
+DESCRIPTION
+ The Postfix bounce(8) server produces delivery status
+ notification (DSN) messages for undeliverable mail,
+ delayed mail, successful delivery or address verification
+ requests.
+
+ By default, these notifications are generated from built-
+ in templates with message headers and message text. Sites
+ can override the built-in information by specifying a
+ bounce template file with the bounce_template_file config-
+ uration parameter.
+
+ This document describes the general procedure to create a
+ bounce template file, followed by the specific details of
+ bounce template formats.
+
+GENERAL PROCEDURE
+ To create customized bounce template file, create a tempo-
+ rary copy of the file /etc/postfix/bounce.cf.default and
+ edit the temporary file.
+
+ To preview the results of $name expansions in the template
+ text, use the command
+
+ postconf -b temporary_file
+
+ Errors in the template will be reported to the standard
+ error stream and to the syslog daemon.
+
+ While previewing the text, be sure to pay particular
+ attention to the expansion of time value parameters that
+ appear in the delayed mail notification text.
+
+ Once the result is satisfactory, copy the template to the
+ Postfix configuration directory and specify in main.cf
+ something like:
+
+ /etc/postfix/main.cf:
+ bounce_template_file = /etc/postfix/bounce.cf
+
+TEMPLATE FILE FORMAT
+ The template file can specify templates for failed mail,
+ delayed mail, successful delivery or for address verifica-
+ tion. These templates are named failure_template,
+ delay_template, success_template and verify_template,
+ respectively. You can but do not have to specify all four
+ templates in a bounce template file.
+
+ Each template starts with "template_name = <<EOF" and ends
+ with a line that contains the word "EOF" only. You can
+ change the word EOF, but you can't enclose it in quotes as
+ with the shell or with Perl (template_name = <<'EOF').
+ Here is an example:
+
+ # The failure template is used for undeliverable mail.
+
+ failure_template = <<EOF
+ Charset: us-ascii
+ From: MAILER-DAEMON (Mail Delivery System)
+ Subject: Undelivered Mail Returned to Sender
+ Postmaster-Subject: Postmaster Copy: Undelivered Mail
+
+ This is the $mail_name program at host $myhostname.
+
+ I'm sorry to have to inform you that your message could not
+ be delivered to one or more recipients. It's attached below.
+
+ For further assistance, please send mail to <postmaster>
+
+ If you do so, please include this problem report. You can
+ delete your own text from the attached returned message.
+
+ The $mail_name program
+ EOF
+
+ No special meaning is given to the backslash character or
+ to leading whitespace; these are always taken literally.
+
+ Outside the << context, lines beginning with "#" are
+ ignored, as are empty lines, and lines consisting of
+ whitespace only.
+
+ Examples of all templates can be found in the file
+ bounce.cf.default in the Postfix configuration directory.
+
+TEMPLATE HEADER FORMAT
+ The first portion of a bounce template consists of
+ optional template headers. These either become message
+ headers in the delivery status notification, or control
+ the formatting of the notification. Headers not specified
+ in a template will be left at their default value.
+
+ The following headers are supported:
+
+ Charset:
+ The MIME character set of the template message
+ text. See the "TEMPLATE MESSAGE TEXT FORMAT"
+ description below.
+
+ From: The sender address that the recipient will see.
+
+ Subject:
+ The subject that the recipient will see.
+
+ Postmaster-Subject:
+ The subject that will be used in Postmaster copies
+ of undeliverable or delayed mail notifications.
+ These copies are sent under control of the
+ notify_classes configuration parameter.
+
+ The usage and specification of template message headers is
+ subject to the following restrictions:
+
+ o Template message header names can be specified in
+ upper case, lower case or mixed case. Postfix
+ always uses the spelling as shown in the example
+ above.
+
+ o Template message headers must not span multiple
+ lines.
+
+ o Template message headers must not contain main.cf
+ $parameters.
+
+ o Template message headers must contain ASCII charac-
+ ters only.
+
+TEMPLATE MESSAGE TEXT FORMAT
+ The second portion of a bounce template consists of mes-
+ sage text. As the above example shows, template message
+ text may contain main.cf $parameters. Besides the parame-
+ ters that are defined in main.cf, the following parameters
+ are treated specially depending on the suffix that is
+ appended to their name.
+
+ delay_warning_time_suffix
+ Expands into the value of the delay_warning_time
+ parameter, expressed in the time unit specified by
+ suffix, which is one of seconds, minutes, hours,
+ days, or weeks.
+
+ maximal_queue_lifetime_suffix
+ Expands into the value of the maximal_queue_life-
+ time parameter, expressed in the time unit speci-
+ fied by suffix. See above under delay_warning_time
+ for possible suffix values.
+
+ The usage and specification of template message text is
+ subject to the following restrictions:
+
+ o The template message text is not sent in Postmaster
+ copies of delivery status notifications.
+
+ o If the template message text contains non-ASCII
+ characters, Postfix requires that the Charset: tem-
+ plate header is updated. Specify an appropriate
+ superset of US-ASCII. A superset is needed because
+ Postfix appends ASCII text after the message tem-
+ plate when it sends a delivery status notification.
+
+SEE ALSO
+ bounce(8), Postfix delivery status notifications
+ postconf(5), configuration parameters
+
+LICENSE
+ The Secure Mailer license must be distributed with this
+ software.
+
+HISTORY
+ The Postfix bounce template format was originally devel-
+ oped by Nicolas Riendeau.
+
+AUTHOR(S)
+ Wietse Venema
+ IBM T.J. Watson Research
+ P.O. Box 704
+ Yorktown Heights, NY 10598, USA
+
+ BOUNCE(5)
+
diff --git a/postfix/html/bounce.8.html b/postfix/html/bounce.8.html
index 7fa056803..b63647871 100644
--- a/postfix/html/bounce.8.html
+++ b/postfix/html/bounce.8.html
@@ -7,19 +7,18 @@
BOUNCE(8) BOUNCE(8)
NAME
- bounce - Postfix message bounce or defer daemon
+ bounce - Postfix delivery status reports
SYNOPSIS
bounce [generic Postfix daemon options]
DESCRIPTION
The bounce(8) daemon maintains per-message log files with
- non-delivery status information. Each log file is named
- after the queue file that it corresponds to, and is kept
- in a queue subdirectory named after the service name in
- the master.cf file (either bounce, defer or trace). This
- program expects to be run from the master(8) process man-
- ager.
+ delivery status information. Each log file is named after
+ the queue file that it corresponds to, and is kept in a
+ queue subdirectory named after the service name in the
+ master.cf file (either bounce, defer or trace). This pro-
+ gram expects to be run from the master(8) process manager.
The bounce(8) daemon processes two types of service
requests:
@@ -78,7 +77,7 @@ BOUNCE(8) BOUNCE(8)
The maximal amount of original message text that is
sent in a non-delivery notification.
- bounce_template_file (empty)
+ bounce_template_file (empty)
Pathname of a configuration file with bounce mes-
sage templates.
@@ -152,6 +151,7 @@ BOUNCE(8) BOUNCE(8)
/var/spool/postfix/trace/* delivery status records
SEE ALSO
+ bounce(5), bounce message template format
qmgr(8), queue manager
postconf(5), configuration parameters
master(5), generic daemon options
diff --git a/postfix/html/postconf.1.html b/postfix/html/postconf.1.html
index da2895a55..55d8c2cec 100644
--- a/postfix/html/postconf.1.html
+++ b/postfix/html/postconf.1.html
@@ -14,14 +14,31 @@ POSTCONF(1) POSTCONF(1)
postconf [-ev] [-c config_dir] [parameter=value ...]
+ postconf [-btv] [-c config_dir] [template_file]
+
DESCRIPTION
- The postconf(1) command prints the actual value of parame-
- ter (all known parameters by default) one parameter per
- line, changes its value, or prints other information about
+ The postconf(1) command displays the actual values of con-
+ figuration parameters, changes configuration parameter
+ values, or displays other configuration information about
the Postfix mail system.
Options:
+ -b [template_file]
+ Display the message text that appears at the begin-
+ ning of delivery status notification (DSN) mes-
+ sages, with $name expressions replaced by actual
+ values. To override the built-in message text,
+ specify a template file at the end of the command
+ line, or specify a template file in main.cf with
+ the bounce_template_file parameter. To force
+ selection of the built-in message text templates,
+ specify an empty template file name (in shell lan-
+ guage: "").
+
+ This feature is available with Postfix 2.3 and
+ later.
+
-c config_dir
The main.cf configuration file is in the named
directory instead of the default configuration
@@ -151,15 +168,27 @@ POSTCONF(1) POSTCONF(1)
is a group file entry in group(5)
format.
- Other table types may exist depending on how Postfix was
- built.
+ Other table types may exist depending on how Post-
+ fix was built.
-n Print parameter settings that are not left at their
built-in default value, because they are explicitly
specified in main.cf.
+ -t [template_file]
+ Display the templates for delivery status notifica-
+ tion (DSN) messages. To override the built-in tem-
+ plates, specify a template file at the end of the
+ command line, or specify a template file in main.cf
+ with the bounce_template_file parameter. To force
+ selection of the built-in templates, specify an
+ empty template file name (in shell language: "").
+
+ This feature is available with Postfix 2.3 and
+ later.
+
-v Enable verbose logging for debugging purposes. Mul-
- tiple -v options make the software increasingly
+ tiple -v options make the software increasingly
verbose.
DIAGNOSTICS
@@ -170,20 +199,25 @@ POSTCONF(1) POSTCONF(1)
Directory with Postfix configuration files.
CONFIGURATION PARAMETERS
- The following main.cf parameters are especially relevant
+ The following main.cf parameters are especially relevant
to this program.
- The text below provides only a parameter summary. See
+ The text below provides only a parameter summary. See
postconf(5) for more details including examples.
config_directory (see 'postconf -d' output)
- The default location of the Postfix main.cf and
+ The default location of the Postfix main.cf and
master.cf configuration files.
+ bounce_template_file (empty)
+ Pathname of a configuration file with bounce mes-
+ sage templates.
+
FILES
/etc/postfix/main.cf, Postfix configuration parameters
SEE ALSO
+ bounce(5), bouce template file format
postconf(5), configuration parameters
README FILES
diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html
index 1d721f539..d3ff4cfdf 100644
--- a/postfix/html/postconf.5.html
+++ b/postfix/html/postconf.5.html
@@ -1108,7 +1108,15 @@ proportionally.
Pathname of a configuration file with bounce message templates. -
+These override the bounce(8) server built-in templates of delivery +status notification (DSN) messages for undeliverable mail, for +delayed mail, for successful delivery, or for mail delivery +verification. + +Template message body text may contain $name references to +Postfix configuration parameters. The result of $name expansion can +be previewed with "postconf -b file_name" before the file +is placed into the Postfix configuration directory.
This feature is available in Postfix 2.3 and later.
diff --git a/postfix/html/postfix-manuals.html b/postfix/html/postfix-manuals.html index 042ee6502..ed013d06f 100644 --- a/postfix/html/postfix-manuals.html +++ b/postfix/html/postfix-manuals.html @@ -111,6 +111,8 @@ the following convention:Pathname of a configuration file with bounce message templates. -
+These override the bounce(8) server built-in templates of delivery +status notification (DSN) messages for undeliverable mail, for +delayed mail, for successful delivery, or for mail delivery +verification. + +Template message body text may contain $name references to +Postfix configuration parameters. The result of $name expansion can +be previewed with "postconf -b file_name" before the file +is placed into the Postfix configuration directory.
This feature is available in Postfix 2.3 and later.
diff --git a/postfix/src/bounce/Makefile.in b/postfix/src/bounce/Makefile.in index f6f3c6141..4a1edaae1 100644 --- a/postfix/src/bounce/Makefile.in +++ b/postfix/src/bounce/Makefile.in @@ -22,9 +22,12 @@ LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) -../../conf/bounce.cf.default: $(PROG) fix-template.pl +# Avoid dependency on installed Postfix. +../../conf/bounce.cf.default: $(PROG) annotate.pl rm -f $@ - ./$(PROG) -Szn default | perl fix-template.pl >$@ + echo queue_directory=. >main.cf + MAIL_CONFIG=. ./$(PROG) -SVzndump_templates | perl annotate.pl >$@ + rm -f main.cf $(OBJS): ../../conf/makedefs.out @@ -52,15 +55,18 @@ lint: lint $(DEFS) $(SRCS) $(LINTFIX) clean: - rm -f *.o *core $(PROG) $(TESTPROG) junk + rm -f *.o *core $(PROG) $(TESTPROG) junk main.cf rm -rf printfck tidy: clean -template_test: - ./bounce -Szn default >junk - ./bounce -Szn actual -o bounce_template_file=`pwd`/junk | diff junk - - rm -f junk +# Avoid dependency on installed Postfix. +template_test: $(PROG) + echo queue_directory=. >main.cf + MAIL_CONFIG=. ./$(PROG) -SVzndump_templates >junk + MAIL_CONFIG=. ./$(PROG) -SVzndump_templates \ + -o bounce_template_file=junk | diff junk - + rm -f junk main.cf depend: $(MAKES) (sed '1,/^# do not edit/!d' Makefile.in; \ diff --git a/postfix/src/bounce/fix-template.pl b/postfix/src/bounce/annotate.pl similarity index 56% rename from postfix/src/bounce/fix-template.pl rename to postfix/src/bounce/annotate.pl index 5d0dde5ca..a7aabfe67 100644 --- a/postfix/src/bounce/fix-template.pl +++ b/postfix/src/bounce/annotate.pl @@ -4,51 +4,69 @@ print <<'EOF' # notification (DSN) messages that are built into Postfix. # # To change Postfix DSN messages, perhaps to add non-English text, -# follow instructions in the BOUNCE_README document. +# follow instructions in the bounce(5) manual page. # +EOF + # QUICK INSTRUCTIONS: # -# Copy this file to $config_directory/bounce.cf, edit that file, -# then specify in main.cf: -# -# bounce_template_file = $config_directory/bounce.cf +#-Edit a temporary copy of this file, and preview the result of $name +# expansions with "postconf -b temporary_file". If there are any +# problems, Postfix will log "warning" or "fatal" messages to the +# maillog file. # #-The template file can specify bounce message templates for -# failed mail, delayed mail, successful delivery, and verbose delivery. -# You don't have to specify templates for all of these. If there is -# anything about a template that Postfix does not like it logs a -# warning and keeps using its built-in template. -# -#-Each template consists of a few headers and message text. The -# headers control what the recipient sees as From: and Subject:, and -# what MIME information Postfix will generate. The message text is -# not sent in Postmaster copies of delivery status notifications. -# -#-You can specify main.cf parameters in a template message text. -# Some parameters have additional features as described below. -# -#-You cannot specify main.cf parameters in template headers. +# failed mail, for delayed mail, for successful delivery, or for +# verbose delivery. You don't have to specify all templates. # #-Each template starts with "template_name = <