pickup Daemon in Linux



The pickup in Linux is a Postfix daemon responsible for detecting new mail in the maildrop directory and passing it to the cleanup daemon. Malformed files are deleted without notification. It is designed to run under the control of the master process manager and operates with low privileges, enhancing security by minimizing potential risks associated with reading files from untrusted sources.

Table of Contents

Here is a comprehensive guide to the options available with the pickup command −

Syntax of pickup Daemon

The syntax of the pickup daemon is as follows −

pickup [generic Postfix daemon options]

The pickup daemon can be configured with several generic options mentioned in the next section that control its behavior.

pickup Daemon Options

The generic options of the pickup daemon are listed below −

Option Description
content_filter After the message is queued, send the entire message to the specified transport:destination.
receive_override_options Enable or disable recipient validation, built-in content filtering, or address mapping.
config_directory The default location of the Postfix main.cf and master.cf configuration files.
ipc_timeout The time limit for sending or receiving information over an internal communication channel. Default: 3600s.
line_length_limit Upon input, long lines are chopped up into pieces of at most this length; upon delivery, long lines are reconstructed. Default: 2048.
max_idle The maximum amount of time that an idle Postfix daemon process waits for an incoming connection before terminating voluntarily. Default: 100s.
max_use The maximal number of incoming connections that a Postfix daemon process will service before terminating voluntarily. Default: 100.
process_id The process ID of a Postfix command or daemon process. (Read-only)
process_name The process name of a Postfix command or daemon process. (Read-only)
queue_directory The location of the Postfix top-level queue directory.
syslog_facility The syslog facility of Postfix logging. Default: mail.
syslog_name A prefix that is prepended to the process name in syslog records, so that, for example, smtpd becomes prefix/smtpd.
service_name The master.cf service name of a Postfix daemon process. (Available in Postfix 3.3 and later.)
info_log_address_format The email address form that will be used in non-debug logging (info, warning, etc.). (Available in Postfix 3.5 and later)

Checking the Status of pickup Daemon

To check the status of the pickup service, use the following command −

ps aux | grep pickup
Pickup Daemon in Linux1

The output shows the pickup process is running as a Postfix daemon.

Configuration of pickup Daemon

Postfix automatically manages the pickup daemon and does not require direct configuration. However, its behavior can be adjusted using Postfix configuration files (main.cf and master.cf). Below are key configuration steps and examples −

The pickup service is defined in /etc/postfix/master.cf. Ensure this entry exists and is not commented out −

sudo nano /etc/postfix/master.cf
Pickup Daemon in Linux2
  • Service name: pickup
  • Communication method: Unix domain socket (unix)
  • Chrooted: No chroot environment (n)
  • Per-user privilege: Not used (-)
  • Log to syslog: Yes (y)
  • Idle timeout: 60 seconds before terminating (60)
  • Max concurrent processes: 1 (1)
  • Command: Runs the pickup process itself (pickup)

The above options can be modified to change the pickup service definition. Other parameters that can be specified in the master file are listed below −

Setting max_use

To set the maximum number of incoming connections that a pickup process will service before terminating, modify the max_use parameter. By default, this is 100.

max_use = 200

Setting max_idle

To set the maximum idle time before the pickup process terminates, set the max_idle parameter.

max_idle = 300s

The default idle time for the pickup daemon is 100s.

Pickup Daemon in Linux3

To apply the changes, restart the Postfix service.

Modifying Configurations for pickup Daemon

In this section, various options for pickup daemon will be discussed along with the process to set them.

The pickup service options are configured in /etc/postfix/main.cf file. To access this file, use any text editor with sudo privileges.

sudo nano /etc/postfix/main.cf

Setting ipc_timeout

The ipc_timeout defines the time limit for sending or receiving data over an internal communication channel. By default, it is 3600 seconds, however, it can be added or modified.

ipc_timeout = 7200

Setting line_length_limit

The line_length_limit controls the maximum length of lines Postfix will accept. By default, this is 2048.

line_length_limit = 3000

Setting config_directory

To check the default, configuration directory, use the following command −

postconf -d | grep config_directory
Pickup Daemon in Linux4

By default, it is /etc/postfix. It can be changed by specifying the config_directory in the main.cf file.

config_directory = /path/to/directory

Post Configuration Process

After making the modifications in the main.cf or master.cf file, restart the Postfix to apply the changes.

sudo systemctl restart postfix

Conclusion

The pickup daemon plays a crucial role in handling new mail by detecting files in the maildrop directory and passing them to the cleanup daemon. It operates with minimal privileges to enhance security, ensuring the safe handling of untrusted files.

Although it doesn't require direct configuration, various options like ipc_timeout, line_length_limit, and max_idle can be adjusted through configuration files such as main.cf and master.cf. After modifying these settings, restarting Postfix ensures that changes take effect.

Advertisements