
defer Command in Linux
Postfix is an open-source mail transfer agent (MTA) that handles the routing and delivery of emails on Linux and other Unix-like operating systems. Its bounce daemon maintains a per-message log and posts a bounce message when the message delivery fails.
If a message is temporarily not delivered, it will be logged as deferred. If it is permanently undelivered, it will be logged and notified as bounced. Both services bounce and defer, use the same executable called bounce but their roles in the mail delivery system are different.
Table of Contents
Here is a comprehensive guide to the options available with the defer command −
- Prerequisites of Using defer Command
- Syntax of Postfix defer Service
- Configuring Postfix defer Service on Linux
- Configuring Postfix defer Parameters
Prerequisites of Using defer Command
The defer is a Postfix service, it must be installed and configured on Linux. To check whether Postfix is installed or not, use the following command −
sudo postfix status

If it does not show the Postfix status, it is not installed.
To get Postfix on Ubuntu, Debian, and other Debian-based distributions, run −
sudo apt install postfix
To install it on Red Hat-based distros, such as CentOS or Fedora, run −
sudo yum install postfix
After installing Postfix, perform an initial setup.
On Debian-based distributions including Ubuntu, it can be done interactively through the dpkg command −
sudo dpkg-reconfigure postfix
On Red Hat-based distributions, it has to be done by manually configuring the /etc/postfix/main.cf file. To access this file, use the nano editor −
sudo nano /etc/postfix/main.cf
After the initial Postfix configuration, reload the service.
sudo systemctl reload postfix
Syntax of Postfix defer Service
The defer service can be configured in the master.cf file using the following syntax −
defer [generic postfix daemon options]
The [generic postfix daemon options] are listed in the following table −
Options | Description |
---|---|
service | To specify is the name of the service |
type | To specify the type of the service from fifo, inet, unix, or pass |
private (yes) | To keep the service private or public (default: private) |
unpriv (yes) | To keep the service accessible with reduced privileges (default: yes) |
chroot (no) | To keep the service running in chroot jail (default: no) |
wakeup (never) | To specify the time in seconds to wake up service for maintenance (default: never) |
maxproc (100) | To specify the maximum number of processes for the service (default: 100) |
command + args | To specify the command with arguments to run |
These options are explicitly mentioned in the master.cf file, as shown in the image below −

Configuring Postfix defer Service in Linux
The defer service is pre-configured in the /etc/postfix/master.cf file. However, if it is not present, it can easily be configured as shown in the image below −

In the configuration above −
- service − It is set to defer
- type − It is set as unix, which means the service uses Unix domain sockets
- private − It is set to default (-), which means the service is private
- unpriv − It is also set to default (-), which means the service runs without root privileges
- chroot − It is set as y, which signifies that the service runs in the chroot jail
- wakeup − It is set as -, which shows no wake-up time
- maxproc − It is set as 0, which means there is no limit to the number of simultaneous processes
- command + args − The bounce is the given command
Configuring Postfix defer Parameters
The parameters of the defer service can be configured in the main.cf. The commonly used parameters are listed in the following table −
Parameters | Description |
---|---|
bounce_notice_recipient | To specify the email address to receive notifications for single bounce messages |
2bounce_notice_recipient | To specify the email address to receive notification for double bounce messages (when the bounce message itself bounces) |
delay_notice_recipient | To specify the email address to receive the delayed mail notification |
bounce_size_limit | To limit the size of bounce message sent to non-delivery system (in bytes) |
mail_name | To specify the mail system name (Introductory text comes with the bounce message) |
notify_classes | To specify the types of notifications (bounce, delay, policy, protocol, resource) |
To configure these parameters, open the main.cf file in any text editor −
sudo nano /etc/postfix/main.cf
For example, the bounce_notice_recipient parameter can be set as −
bounce_notice_recipient = postfix@example.com
Replace the postfix@example.com address with the actual email address.
Similarly, to limit the size of bounce email content, use −
bounce_size_limit = 30000
Where 30000 is in bytes.
There are various notify classes; one or more classes can be mentioned as follows −
notify_classes = bounce, delay, policy

After making these changes reload the service −
sudo systemctl reload postfix
Conclusion
The defer Postfix service uses the bounce executable to notify the temporarily undelivered emails. The daemon that manages the log and status notifications is called bounce.
The bounce daemon appends the status to the log file and sends the bounce message to the specified recipient. The bounce email also contains a copy of the failed message. Once the bounce message is delivered, the log file is deleted. The defer service is preconfigured in the Postfix main.cf file.
This tutorial explained the Postfix defer service, its syntax, and its configuration on Linux.