1BOUNCE(5) File Formats Manual BOUNCE(5)
2
3
4
6 bounce - Postfix bounce message template format
7
9 bounce_template_file = /etc/postfix/bounce.cf
10
11 postconf -b [template_file]
12
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
28 To create a customized bounce template file, create a temporary copy of
29 the file /etc/postfix/bounce.cf.default and edit the temporary file.
30
31 To preview the results of $name expansions in the template text, use
32 the command
33
34 postconf -b temporary_file
35
36 Errors in the template will be reported to the standard error stream
37 and to the syslog daemon.
38
39 While previewing the text, be sure to pay particular attention to the
40 expansion of time value parameters that appear in the delayed mail
41 notification text.
42
43 Once the result is satisfactory, copy the template to the Postfix con‐
44 figuration directory and specify in main.cf something like:
45
46 /etc/postfix/main.cf:
47 bounce_template_file = /etc/postfix/bounce.cf
48
50 The template file can specify templates for failed mail, delayed mail,
51 successful delivery or for address verification. These templates are
52 named failure_template, delay_template, success_template and ver‐
53 ify_template, respectively. You can but do not have to specify all
54 four templates in a bounce template file.
55
56 Each template starts with "template_name = <<EOF" and ends with a line
57 that contains the word "EOF" only. You can change the word EOF, but you
58 can't enclose it in quotes as with the shell or with Perl (tem‐
59 plate_name = <<'EOF'). Here is an example:
60
61 # The failure template is used for undeliverable mail.
62
63 failure_template = <<EOF
64 Charset: us-ascii
65 From: MAILER-DAEMON (Mail Delivery System)
66 Subject: Undelivered Mail Returned to Sender
67 Postmaster-Subject: Postmaster Copy: Undelivered Mail
68
69 This is the mail system at host $myhostname.
70
71 I'm sorry to have to inform you that your message could not
72 be delivered to one or more recipients. It's attached below.
73
74 For further assistance, please send mail to postmaster.
75
76 If you do so, please include this problem report. You can
77 delete your own text from the attached returned message.
78
79 The mail system
80 EOF
81
82 The usage and specification of bounce templates is subject to the fol‐
83 lowing restrictions:
84
85 · No special meaning is given to the backslash character or to
86 leading whitespace; these are always taken literally.
87
88 · Inside the << context, the "$" character is special. To produce
89 a "$" character as output, specify "$$".
90
91 · Outside the << context, lines beginning with "#" are ignored, as
92 are empty lines, and lines consisting of whitespace only.
93
94 Examples of all templates can be found in the file bounce.cf.default in
95 the Postfix configuration directory.
96
98 The first portion of a bounce template consists of optional template
99 headers. These either become message headers in the delivery status
100 notification, or control the formatting of the notification. Headers
101 not specified in a template will be left at their default value.
102
103 The following headers are supported:
104
105 Charset:
106 The MIME character set of the template message text. See the
107 "TEMPLATE MESSAGE TEXT FORMAT" description below.
108
109 From: The sender address in the message header of the delivery status
110 notification.
111
112 Subject:
113 The subject in the message header of the delivery status notifi‐
114 cation.
115
116 Postmaster-Subject:
117 The subject that will be used in Postmaster copies of undeliver‐
118 able or delayed mail notifications. These copies are sent under
119 control of the notify_classes configuration parameter.
120
121 The usage and specification of template message headers is subject to
122 the following restrictions:
123
124 · Template message header names can be specified in upper case,
125 lower case or mixed case. Postfix always uses the spelling as
126 shown in the example above.
127
128 · Template message headers must not span multiple lines.
129
130 · Template message headers must not contain main.cf $parameters.
131
132 · Template message headers must contain ASCII characters only.
133
135 The second portion of a bounce template consists of message text. As
136 the above example shows, template message text may contain main.cf
137 $parameters. Besides the parameters that are defined in main.cf, the
138 following parameters are treated specially depending on the suffix that
139 is appended to their name.
140
141 delay_warning_time_suffix
142 Expands into the value of the delay_warning_time parameter,
143 expressed in the time unit specified by suffix, which is one of
144 seconds, minutes, hours, days, or weeks.
145
146 maximal_queue_lifetime_suffix
147 Expands into the value of the maximal_queue_lifetime parameter,
148 expressed in the time unit specified by suffix. See above under
149 delay_warning_time for possible suffix values.
150
151 The usage and specification of template message text is subject to the
152 following restrictions:
153
154 · The template message text is not sent in Postmaster copies of
155 delivery status notifications.
156
157 · If the template message text contains non-ASCII characters,
158 Postfix requires that the Charset: template header is updated.
159 Specify an appropriate superset of US-ASCII. A superset is
160 needed because Postfix appends ASCII text after the message tem‐
161 plate when it sends a delivery status notification.
162
164 bounce(8), Postfix delivery status notifications
165 postconf(5), configuration parameters
166
168 The Secure Mailer license must be distributed with this software.
169
171 The Postfix bounce template format was originally developed by Nicolas
172 Riendeau.
173
175 Wietse Venema
176 IBM T.J. Watson Research
177 P.O. Box 704
178 Yorktown Heights, NY 10598, USA
179
180
181
182 BOUNCE(5)