bounce - Postfix delivery status reports
| Use Case | Command | Description |
|---|---|---|
| ๐ View bounce (non-delivery) records | ls /var/spool/postfix/bounce/ | List per-message log files for undeliverable mail |
| ๐ View defer (delayed) records | ls /var/spool/postfix/defer/ | List per-message log files for deferred delivery |
| ๐ View trace (delivery status) records | ls /var/spool/postfix/trace/ | List per-message log files for delivery status |
| โ๏ธ Configure bounce template file | postconf -e bounce_template_file=/etc/postfix/bounce.cf | Set custom bounce message template |
| ๐๏ธ Preview bounce template expansions | postconf -b template_file | Preview template with $name expansions |
| ๐ Reload Postfix configuration | postfix reload | Apply main.cf changes to bounce daemon |
| ๐ง Set 2bounce notice recipient | postconf -e 2bounce_notice_recipient=postmaster | Recipient of undeliverable mail that cannot be returned |
| ๐ Set bounce size limit | postconf -e bounce_size_limit=50000 | Max original message text in non-delivery notification (bytes) |
bounce [generic Postfix daemon options]
The bounce(8) daemon maintains per-message log files with 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 manager.
The bounce(8) daemon processes two types of service requests:
The software does a best notification effort. A non-delivery notification is sent even when the log file or the original message cannot be read.
Optionally, a bounce (defer, trace) client can request that the per-message log file be deleted when the requested operation fails. This is used by clients that cannot retry transactions by themselves, and that depend on retry logic in their own client.
Problems and transactions are logged to syslogd(8) or postlogd(8).
Changes to main.cf are picked up automatically, as bounce(8) processes run for only a limited amount of time. Use the command postfix reload to speed up a change.
The text below provides only a parameter summary. See postconf(5) for more details including examples.
| Parameter | Default | Description |
|---|---|---|
2bounce_notice_recipient | postmaster | ๐ง The recipient of undeliverable mail that cannot be returned to the sender. |
backwards_bounce_logfile_compatibility | yes | ๐ Produce additional bounce(8) logfile records readable by Postfix versions before 2.0. |
bounce_notice_recipient | postmaster | ๐ง The recipient of postmaster notifications with message headers of undelivered mail and SMTP conversation transcripts of unreceived mail. |
bounce_size_limit | 50000 | ๐ The maximal amount of original message text sent in a non-delivery notification. |
bounce_template_file | empty | ๐ Pathname of a configuration file with bounce message templates. |
config_directory | see 'postconf -d' | ๐ Default location of Postfix main.cf and master.cf configuration files. |
daemon_timeout | 18000s | โฑ๏ธ How long a Postfix daemon process may handle a request before watchdog termination. |
delay_notice_recipient | postmaster | ๐ง Recipient of postmaster notifications with headers of mail delayed beyond $delay_warning_time. |
deliver_lock_attempts | 20 | ๐ Max attempts to acquire an exclusive lock on a mailbox or bounce(8) logfile. |
deliver_lock_delay | 1s | โฑ๏ธ Time between attempts to acquire an exclusive lock on a mailbox or bounce(8) logfile. |
ipc_timeout | 3600s | โฑ๏ธ Time limit for sending/receiving information over an internal communication channel. |
internal_mail_filter_classes | empty | ๐ Categories of Postfix-generated mail subject to before-queue content inspection by non_smtpd_milters, header_checks and body_checks. |
mail_name | Postfix | ๐ท๏ธ Mail system name displayed in Received: headers, SMTP greeting banner, and bounced mail. |
max_idle | 100s | โฑ๏ธ Max time an idle Postfix daemon waits for an incoming connection before voluntary termination. |
max_use | 100 | ๐ข Max number of incoming connections a Postfix daemon services before voluntary termination. |
notify_classes | resource, software | ๐ง List of error classes reported to the postmaster. |
process_id | read-only | ๐ Process ID of a Postfix command or daemon process. |
process_name | read-only | ๐ท๏ธ Process name of a Postfix command or daemon process. |
queue_directory | see 'postconf -d' | ๐ Location of the Postfix top-level queue directory. |
syslog_facility | ๐ Syslog facility of Postfix logging. | |
syslog_name | see 'postconf -d' | ๐ท๏ธ Prefix prepended to process name in syslog records (e.g., "smtpd" becomes "prefix/smtpd"). |
Available in Postfix 3.0 and later:
| Parameter | Default | Description |
|---|---|---|
smtputf8_autodetect_classes | sendmail, verify | ๐ Detect that a message requires SMTPUTF8 support for specified mail origin classes. |
Available in Postfix 3.3 and later:
| Parameter | Default | Description |
|---|---|---|
service_name | read-only | ๐ท๏ธ The master.cf service name of a Postfix daemon process. |
Available in Postfix 3.6 and later:
| Parameter | Default | Description |
|---|---|---|
enable_threaded_bounces | no | ๐งต Enable non-delivery, success, and delay notifications that link to the original message via References: and In-Reply-To: headers. |
/var/spool/postfix/bounce/* โ non-delivery records/var/spool/postfix/defer/* โ non-delivery records/var/spool/postfix/trace/* โ delivery status recordsThe Secure Mailer license must be distributed with this software.
Wietse Venema
IBM T.J. Watson Research
P.O. Box 704
Yorktown Heights, NY 10598, USA
Wietse Venema
Google, Inc.
111 8th Avenue
New York, NY 10011, USA
bounce - Postfix bounce message template format
| Use Case | Command | Description |
|---|---|---|
| ๐ Create bounce template from default | cp /etc/postfix/bounce.cf.default /etc/postfix/bounce.cf | Copy the default template file as a starting point |
| ๐๏ธ Preview template expansions | postconf -b /etc/postfix/bounce.cf | Preview $name expansions in your template |
| โ๏ธ Set custom template in main.cf | postconf -e bounce_template_file=/etc/postfix/bounce.cf | Activate your custom bounce template |
| ๐ Reload Postfix | postfix reload | Apply configuration changes |
bounce_template_file = /etc/postfix/bounce.cf
postconf -b [template_file]
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 configuration parameter.
This document describes the general procedure to create a bounce template file, followed by the specific details of bounce template formats.
To create a customized bounce template file, create a temporary 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
The template file can specify templates for failed mail, delayed mail, successful delivery or for address verification. 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 system 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 system
EOF
The usage and specification of bounce templates is subject to the following restrictions:
Examples of all templates can be found in the file bounce.cf.default in the Postfix configuration directory.
The first portion of a bounce template consists of optional template headers. Some become message headers in the delivery status notification; some control the formatting of that notification. Headers not specified in a template will be left at their default value.
The following headers are supported:
The usage and specification of template message headers is subject to the following restrictions:
The second portion of a bounce template consists of message text. As the above example shows, template message text may contain main.cf $parameters. Besides the parameters that are defined in main.cf, the following parameters are treated specially depending on the suffix that is appended to their name.
The usage and specification of template message text is subject to the following restrictions:
The Secure Mailer license must be distributed with this software.
The Postfix bounce template format was originally developed by Nicolas Riendeau.
Wietse Venema
IBM T.J. Watson Research
P.O. Box 704
Yorktown Heights, NY 10598, USA
Wietse Venema
Google, Inc.
111 8th Avenue
New York, NY 10011, USA
Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-16 09:23 @2600:1f28:365:80b0:7cb9:fb:26c1:e368
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)