1BOUNCE(5)                     File Formats Manual                    BOUNCE(5)
2
3
4

NAME

6       bounce - Postfix bounce message template format
7

SYNOPSIS

9       bounce_template_file = /etc/postfix/bounce.cf
10
11       postconf -b [template_file]
12

DESCRIPTION

14       The  Postfix  bounce(8)  server  produces  delivery status notification
15       (DSN) messages for undeliverable mail, delayed mail, successful  deliv‐
16       ery or address verification requests.
17
18       By  default,  these notifications are generated from built-in templates
19       with message headers and message text. Sites can override the  built-in
20       information  by  specifying a bounce template file with the bounce_tem‐
21       plate_file configuration parameter.
22
23       This document describes the general procedure to create a  bounce  tem‐
24       plate  file,  followed  by the specific details of bounce template for‐
25       mats.
26

GENERAL PROCEDURE

28       To create a customized bounce template file, create a temporary copy of
29       the  file  /usr/share/doc/postfix-2.7.7/bounce.cf.default  and edit the
30       temporary file.
31
32       To preview the results of $name expansions in the  template  text,  use
33       the command
34
35           postconf -b temporary_file
36
37       Errors  in  the  template will be reported to the standard error stream
38       and to the syslog daemon.
39
40       While previewing the text, be sure to pay particular attention  to  the
41       expansion  of  time  value  parameters  that appear in the delayed mail
42       notification text.
43
44       Once the result is satisfactory, copy the template to the Postfix  con‐
45       figuration directory and specify in main.cf something like:
46
47       /etc/postfix/main.cf:
48           bounce_template_file = /etc/postfix/bounce.cf
49

TEMPLATE FILE FORMAT

51       The  template file can specify templates for failed mail, delayed mail,
52       successful delivery or for address verification.  These  templates  are
53       named   failure_template,  delay_template,  success_template  and  ver‐
54       ify_template, respectively.  You can but do not  have  to  specify  all
55       four templates in a bounce template file.
56
57       Each  template starts with "template_name = <<EOF" and ends with a line
58       that contains the word "EOF" only. You can change the word EOF, but you
59       can't  enclose  it  in  quotes  as  with  the  shell or with Perl (tem‐
60       plate_name = <<'EOF'). Here is an example:
61
62           # The failure template is used for undeliverable mail.
63
64           failure_template = <<EOF
65           Charset: us-ascii
66           From: MAILER-DAEMON (Mail Delivery System)
67           Subject: Undelivered Mail Returned to Sender
68           Postmaster-Subject: Postmaster Copy: Undelivered Mail
69
70           This is the mail system at host $myhostname.
71
72           I'm sorry to have to inform you that your message could not
73           be delivered to one or more recipients. It's attached below.
74
75           For further assistance, please send mail to postmaster.
76
77           If you do so, please include this problem report. You can
78           delete your own text from the attached returned message.
79
80                              The mail system
81           EOF
82
83       The usage and specification of bounce templates is subject to the  fol‐
84       lowing restrictions:
85
86       ·      No  special  meaning  is  given to the backslash character or to
87              leading whitespace; these are always taken literally.
88
89       ·      Inside the << context, the "$" character is special. To  produce
90              a "$" character as output, specify "$$".
91
92       ·      Outside the << context, lines beginning with "#" are ignored, as
93              are empty lines, and lines consisting of whitespace only.
94
95       Examples of all templates can be found in the file bounce.cf.default in
96       the Postfix configuration directory.
97

TEMPLATE HEADER FORMAT

99       The  first  portion  of a bounce template consists of optional template
100       headers.  Some become message headers in the delivery status  notifica‐
101       tion;  some  control  the  formatting of that notification. Headers not
102       specified in a template will be left at their default value.
103
104       The following headers are supported:
105
106       Charset:
107              The MIME character set of the template message  text.   See  the
108              "TEMPLATE MESSAGE TEXT FORMAT" description below.
109
110       From:  The  sender address in the message header of the delivery status
111              notification.
112
113       Subject:
114              The subject in the message header of the delivery status notifi‐
115              cation that is returned to the sender.
116
117       Postmaster-Subject:
118              The subject that will be used in Postmaster copies of undeliver‐
119              able or delayed mail notifications. These copies are sent  under
120              control of the notify_classes configuration parameter.
121
122       The  usage  and specification of template message headers is subject to
123       the following restrictions:
124
125       ·      Template message header names can be specified  in  upper  case,
126              lower case or mixed case. Postfix always produces bounce message
127              header labels of the form "From:" and "Subject:".
128
129       ·      Template message headers must not span multiple lines.
130
131       ·      Template message headers do not support $parameter expansions.
132
133       ·      Template message headers must contain ASCII characters only, and
134              must not contain ASCII null characters.
135

TEMPLATE MESSAGE TEXT FORMAT

137       The  second  portion  of a bounce template consists of message text. As
138       the above example shows, template  message  text  may  contain  main.cf
139       $parameters.  Besides  the  parameters that are defined in main.cf, the
140       following parameters are treated specially depending on the suffix that
141       is appended to their name.
142
143       delay_warning_time_suffix
144              Expands  into  the  value  of  the delay_warning_time parameter,
145              expressed in the time unit specified by suffix, which is one  of
146              seconds, minutes, hours, days, or weeks.
147
148       maximal_queue_lifetime_suffix
149              Expands  into the value of the maximal_queue_lifetime parameter,
150              expressed in the time unit specified by suffix.  See above under
151              delay_warning_time for possible suffix values.
152
153       The  usage and specification of template message text is subject to the
154       following restrictions:
155
156       ·      The template message text is not sent in  Postmaster  copies  of
157              delivery status notifications.
158
159       ·      If  the  template  message  text  contains non-ASCII characters,
160              Postfix requires that the Charset: template header  is  updated.
161              Specify  an  appropriate  superset  of  US-ASCII.  A superset is
162              needed because Postfix appends ASCII text after the message tem‐
163              plate when it sends a delivery status notification.
164

SEE ALSO

166       bounce(8), Postfix delivery status notifications
167       postconf(5), configuration parameters
168

LICENSE

170       The Secure Mailer license must be distributed with this software.
171

HISTORY

173       The  Postfix bounce template format was originally developed by Nicolas
174       Riendeau.
175

AUTHOR(S)

177       Wietse Venema
178       IBM T.J. Watson Research
179       P.O. Box 704
180       Yorktown Heights, NY 10598, USA
181
182
183
184                                                                     BOUNCE(5)
Impressum