local

title: local(8)

text:
# local(8)

## NAME
local - Postfix local mail delivery

## SYNOPSIS

```
local [generic Postfix daemon options]
```

## DESCRIPTION

The local(8) daemon processes delivery requests from the Postfix queue manager to deliver mail to local recipients. Each delivery request specifies a queue file, a sender address, a domain or host to deliver to, and one or more recipients. This program expects to be run from the master(8) process manager.

The local(8) daemon updates queue files and marks recipients as finished, or it informs the queue manager that delivery should be tried again at a later time. Delivery status reports are sent to the bounce(8), defer(8) or trace(8) daemon as appropriate.

## CASE FOLDING

```

```

All delivery decisions are made using the bare recipient name (i.e. the address localpart), folded to lower case. See also under ADDRESS EXTENSION below for a few exceptions.

## SYSTEM-WIDE AND USER-LEVEL ALIASING

```

```

The system administrator can set up one or more system-wide sendmail-style alias databases. Users can have sendmail-style ~/.forward files. Mail for name is delivered to the alias name, to destinations in ~name/.forward, to the mailbox owned by the user name, or it is sent back as undeliverable.

The system administrator can specify a comma/space separated list of ~/.forward like files through the forward_path configuration parameter. Upon delivery, the local delivery agent tries each pathname in the list until a file is found.

Delivery via ~/.forward files is done with the privileges of the recipient. Thus, ~/.forward like files must be readable by the recipient, and their parent directory needs to have "execute" permission for the recipient.

The forward_path parameter is subject to interpolation of $user (recipient username), $home (recipient home directory), $shell (recipient shell), $recipient (complete recipient address), $extension (recipient address extension), $domain (recipient domain), $local (entire recipient address localpart) and $recipient_delimiter. The forms ${name?value} and ${name:value} expand conditionally to value when $name is (is not) defined. Characters that may have special meaning to the shell or file system are replaced by underscores. The list of acceptable characters is specified with the forward_expansion_filter configuration parameter.

An alias or ~/.forward file may list any combination of external commands, destination file names, :include: directives, or mail addresses. See aliases(5) for a precise description. Each line in a user's .forward file has the same syntax as the right-hand part of an alias.

When an address is found in its own alias expansion, delivery is made to the user instead. When a user is listed in the user's own ~/.forward file, delivery is made to the user's mailbox instead. An empty ~/.forward file means do not forward mail.

In order to prevent the mail system from using up unreasonable amounts of memory, input records read from :include: or from ~/.forward files are broken up into chunks of length line_length_limit.

While expanding aliases, ~/.forward files, and so on, the program attempts to avoid duplicate deliveries. The duplicate_filter_limit configuration parameter limits the number of remembered recipients.

## MAIL FORWARDING

```

```

For the sake of reliability, forwarded mail is re-submitted as a new message, so that each recipient has a separate on-file delivery status record.

In order to stop mail forwarding loops early, the software adds an optional Delivered-To: header with the final envelope recipient address. If mail arrives for a recipient that is already listed in a Delivered-To: header, the message is bounced.

## MAILBOX DELIVERY

```

```

The default per-user mailbox is a file in the UNIX mail spool directory (/var/mail/user or /var/spool/mail/user); the location can be specified with the mail_spool_directory configuration parameter. Specify a name ending in / for qmail-compatible maildir delivery.

Alternatively, the per-user mailbox can be a file in the user's home directory with a name specified via the home_mailbox configuration parameter. Specify a relative path name. Specify a name ending in / for qmail-compatible maildir delivery.

Mailbox delivery can be delegated to an external command specified with the mailbox_command_maps and mailbox_command configuration parameters. The command executes with the privileges of the recipient user (exceptions: secondary groups are not enabled; in case of delivery as root, the command executes with the privileges of default_privs).

Mailbox delivery can be delegated to alternative message transports specified in the master.cf file. The mailbox_transport_maps and mailbox_transport configuration parameters specify an optional message transport that is to be used for all local recipients, regardless of whether they are found in the UNIX passwd database. The fallback_transport_maps and fallback_transport parameters specify an optional message transport for recipients that are not found in the aliases(5) or UNIX passwd database.

In the case of UNIX-style mailbox delivery, the local(8) daemon prepends a "From sender time_stamp" envelope header to each message, prepends an X-Original-To: header with the recipient address as given to Postfix, prepends an optional Delivered-To: header with the final envelope recipient address, prepends a Return-Path: header with the envelope sender address, prepends a > character to lines beginning with "From ", and appends an empty line. The mailbox is locked for exclusive access while delivery is in progress. In case of problems, an attempt is made to truncate the mailbox to its original length.

In the case of maildir delivery, the local daemon prepends an optional Delivered-To: header with the final envelope recipient address, prepends an X-Original-To: header with the recipient address as given to Postfix, and prepends a Return-Path: header with the envelope sender address.

## EXTERNAL COMMAND DELIVERY

```

```

The allow_mail_to_commands configuration parameter restricts delivery to external commands. The default setting (alias, forward) forbids command destinations in :include: files.

Optionally, the process working directory is changed to the path specified with command_execution_directory (Postfix 2.2 and later). Failure to change directory causes mail to be deferred.

The command_execution_directory parameter value is subject to interpolation of $user (recipient username), $home (recipient home directory), $shell (recipient shell), $recipient (complete recipient address), $extension (recipient address extension), $domain (recipient domain), $local (entire recipient address localpart) and $recipient_delimiter. The forms ${name?value} and ${name:value} expand conditionally to value when $name is (is not) defined. Characters that may have special meaning to the shell or file system are replaced by underscores. The list of acceptable characters is specified with the execution_directory_expansion_filter configuration parameter.

The command is executed directly where possible. Assistance by the shell (/bin/sh on UNIX systems) is used only when the command contains shell magic characters, or when the command invokes a shell built-in command.

A limited amount of command output (standard output and standard error) is captured for inclusion with non-delivery status reports. A command is forcibly terminated if it does not complete within command_time_limit seconds. Command exit status codes are expected to follow the conventions defined in <sysexits.h>. Exit status 0 means normal successful completion.

Postfix version 2.3 and later support RFC 3463-style enhanced status codes. If a command terminates with a non-zero exit status, and the command output begins with an enhanced status code, this status code takes precedence over the non-zero exit status.

A limited amount of message context is exported via environment variables. Characters that may have special meaning to the shell are replaced by underscores. The list of acceptable characters is specified with the command_expansion_filter configuration parameter.

SHELL

The recipient user's login shell.

HOME

The recipient user's home directory.

USER

The bare recipient name.

EXTENSION

The optional recipient address extension.

DOMAIN

The recipient address domain part.

LOGNAME

The bare recipient name.

LOCAL

The entire recipient address localpart (text to the left of the rightmost @ character).

ORIGINAL_RECIPIENT

The entire recipient address, before any address rewriting or aliasing (Postfix 2.5 and later).

RECIPIENT

The entire recipient address.

SENDER

The entire sender address.

Additional remote client information is made available via the following environment variables:

CLIENT_ADDRESS

Remote client network address. Available as of Postfix 2.2.

CLIENT_HELO

Remote client EHLO command parameter. Available as of Postfix 2.2.

CLIENT_HOSTNAME

Remote client hostname. Available as of Postfix 2.2.

CLIENT_PROTOCOL

Remote client protocol. Available as of Postfix 2.2.

SASL_METHOD

SASL authentication method specified in the remote client AUTH command. Available as of Postfix 2.2.

SASL_SENDER

SASL sender address specified in the remote client MAIL FROM command. Available as of Postfix 2.2.

SASL_USERNAME

SASL username specified in the remote client AUTH command. Available as of Postfix 2.2.

The PATH environment variable is always reset to a system-dependent default path, and environment variables whose names are blessed by the export_environment configuration parameter are exported unchanged.

The current working directory is the mail queue directory.

The local(8) daemon prepends a "From sender time_stamp" envelope header to each message, prepends an X-Original-To: header with the recipient address as given to Postfix, prepends an optional Delivered-To: header with the final recipient envelope address, prepends a Return-Path: header with the sender envelope address, and appends no empty line.

## EXTERNAL FILE DELIVERY

```

```

The delivery format depends on the destination filename syntax. The default is to use UNIX-style mailbox format. Specify a name ending in / for qmail-compatible maildir delivery.

The allow_mail_to_files configuration parameter restricts delivery to external files. The default setting (alias, forward) forbids file destinations in :include: files.

In the case of UNIX-style mailbox delivery, the local(8) daemon prepends a "From sender time_stamp" envelope header to each message, prepends an X-Original-To: header with the recipient address as given to Postfix, prepends an optional Delivered-To: header with the final recipient envelope address, prepends a > character to lines beginning with "From ", and appends an empty line. The envelope sender address is available in the Return-Path: header. When the destination is a regular file, it is locked for exclusive access while delivery is in progress. In case of problems, an attempt is made to truncate a regular file to its original length.

In the case of maildir delivery, the local daemon prepends an optional Delivered-To: header with the final envelope recipient address, and prepends an X-Original-To: header with the recipient address as given to Postfix. The envelope sender address is available in the Return-Path: header.

## ADDRESS EXTENSION

```

```

The optional recipient_delimiter configuration parameter specifies how to separate address extensions from local recipient names.

For example, with "recipient_delimiter = +", mail for name+foo is delivered to the alias name+foo or to the alias name, to the destinations listed in ~name/.forward+foo or in ~name/.forward, to the mailbox owned by the user name, or it is sent back as undeliverable.

## DELIVERY RIGHTS

```

```

Deliveries to external files and external commands are made with the rights of the receiving user on whose behalf the delivery is made. In the absence of a user context, the local(8) daemon uses the owner rights of the :include: file or alias database. When those files are owned by the superuser, delivery is made with the rights specified with the default_privs configuration parameter.

## STANDARDS

```
RFC 822 (ARPA Internet Text Messages)
RFC 3463 (Enhanced status codes)
```

## DIAGNOSTICS

Problems and transactions are logged to syslogd(8) or postlogd(8). Corrupted message files are marked so that the queue manager can move them to the corrupt queue afterwards.

Depending on the setting of the notify_classes parameter, the postmaster is notified of bounces and of other trouble.

## SECURITY

```

```

The local(8) delivery agent needs a dual personality 1) to access the private Postfix queue and IPC mechanisms, 2) to impersonate the recipient and deliver to recipient-specified files or commands. It is therefore security sensitive.

The local(8) delivery agent disallows regular expression substitution of $1 etc. in alias_maps, because that would open a security hole.

The local(8) delivery agent will silently ignore requests to use the proxymap(8) server within alias_maps. Instead it will open the table directly. Before Postfix version 2.2, the local(8) delivery agent will terminate with a fatal error.

## BUGS

For security reasons, the message delivery status of external commands or of external files is never checkpointed to file. As a result, the program may occasionally deliver more than once to a command or external file. Better safe than sorry.

Mutually-recursive aliases or ~/.forward files are not detected early. The resulting mail forwarding loop is broken by the use of the Delivered-To: message header.

## CONFIGURATION PARAMETERS

```

```

Changes to main.cf are picked up automatically, as local(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.

## COMPATIBILITY CONTROLS

```

```

biff (no)

Whether or not to use the local biff service.

expand_owner_alias (no)

When delivering to an alias "aliasname" that has an "owner-aliasname" companion alias, set the envelope sender address to the expansion of the "owner-aliasname" alias.

owner_request_special (yes)

Enable special treatment for owner-listname entries in the aliases(5) file, and don't split owner-listname and listname-request address localparts when the recipient_delimiter is set to "-".

sun_mailtool_compatibility (no)

Obsolete SUN mailtool compatibility feature.

Available in Postfix version 2.3 and later:

frozen_delivered_to (yes)

Update the local(8) delivery agent's idea of the Delivered-To: address (see prepend_delivered_header) only once, at the start of a delivery attempt; do not update the Delivered-To: address while expanding aliases or .forward files.

Available in Postfix version 2.5.3 and later:

strict_mailbox_ownership (yes)

Defer delivery when a mailbox file is not owned by its recipient.

reset_owner_alias (no)

Reset the local(8) delivery agent's idea of the owner-alias attribute, when delivering mail to a child alias that does not have its own owner alias.

Available in Postfix version 3.0 and later:

local_delivery_status_filter ($default_delivery_status_filter)

Optional filter for the local(8) delivery agent to change the status code or explanatory text of successful or unsuccessful deliveries.

## DELIVERY METHOD CONTROLS

```

```

The precedence of local(8) delivery methods from high to low is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, fallback_transport_maps, fallback_transport, and luser_relay.

alias_maps (see 'postconf -d' output)

The alias databases that are used for local(8) delivery.

forward_path (see 'postconf -d' output)

The local(8) delivery agent search list for finding a .forward file with user-specified delivery methods.

mailbox_transport_maps (empty)

Optional lookup tables with per-recipient message delivery transports to use for local(8) mailbox delivery, whether or not the recipients are found in the UNIX passwd database.

mailbox_transport (empty)

Optional message delivery transport that the local(8) delivery agent should use for mailbox delivery to all local recipients, whether or not they are found in the UNIX passwd database.

mailbox_command_maps (empty)

Optional lookup tables with per-recipient external commands to use for local(8) mailbox delivery.

mailbox_command (empty)

Optional external command that the local(8) delivery agent should use for mailbox delivery.

mailbox_unpriv_delivery (yes)

If enabled, then local(8) will not apply root privileges for mailbox delivery.

home_mailbox (empty)

Optional pathname of a mailbox file relative to a local(8) user's home directory.

mail_spool_directory (see 'postconf -d' output)

The directory where local(8) UNIX-style mailboxes are kept.

fallback_transport_maps (empty)

Optional lookup tables with per-recipient message delivery transports for recipients that the local(8) delivery agent could not find in the aliases(5) or UNIX password database.

fallback_transport (empty)

Optional message delivery transport that the local(8) delivery agent should use for names that are not found in the aliases(5) or UNIX password database.

luser_relay (empty)

Optional catch-all destination for unknown local(8) recipients.

Available in Postfix version 2.2 and later:

command_execution_directory (empty)

The local(8) delivery agent working directory for delivery to external command.

## MAILBOX LOCKING CONTROLS

```

```

deliver_lock_attempts (20)

The maximal number of attempts to acquire an exclusive lock on a mailbox file or bounce(8) logfile.

deliver_lock_delay (1s)

The time between attempts to acquire an exclusive lock on a mailbox file or bounce(8) logfile.

stale_lock_time (500s)

The time after which a stale exclusive mailbox lockfile is removed.

mailbox_delivery_lock (see 'postconf -d' output)

How to lock a UNIX-style local(8) mailbox before attempting delivery.

## RESOURCE AND RATE CONTROLS

```

```

command_time_limit (1000s)

Time limit for delivery to external commands.

duplicate_filter_limit (1000)

The maximal number of addresses remembered by the address duplicate filter for aliases(5) or virtual(5) alias expansion, or for showq(8) queue displays.

mailbox_size_limit (51200000)

The maximal size of any local(8) individual mailbox or maildir file, or zero (no limit).

Implemented in the qmgr(8) daemon:

local_destination_concurrency_limit (2)

The maximal number of parallel deliveries via the local mail delivery transport to the same recipient (when "local_destination_recipient_limit = 1") or the maximal number of parallel deliveries to the same local domain (when "local_destination_recipient_limit > 1").

local_destination_recipient_limit (1)

The maximal number of recipients per message delivery via the local mail delivery transport.

## SECURITY CONTROLS

```

```

allow_mail_to_commands (alias, forward)

Restrict local(8) mail delivery to external commands.

allow_mail_to_files (alias, forward)

Restrict local(8) mail delivery to external files.

command_expansion_filter (see 'postconf -d' output)

Restrict the characters that the local(8) delivery agent allows in $name expansions of $mailbox_command and $command_execution_directory.

default_privs (postman)

The default rights used by the local(8) delivery agent for delivery to external file or command.

forward_expansion_filter (see 'postconf -d' output)

Restrict the characters that the local(8) delivery agent allows in $name expansions of $forward_path.

Available in Postfix version 2.2 and later:

execution_directory_expansion_filter (see 'postconf -d' output)

Restrict the characters that the local(8) delivery agent allows in $name expansions of $command_execution_directory.

Available in Postfix version 2.5.3 and later:

strict_mailbox_ownership (yes)

Defer delivery when a mailbox file is not owned by its recipient.

## MISCELLANEOUS CONTROLS

```

```

config_directory (see 'postconf -d' output)

The default location of the Postfix main.cf and master.cf configuration files.

daemon_timeout (18000s)

How much time a Postfix daemon process may take to handle a request before it is terminated by a built-in watchdog timer.

delay_logging_resolution_limit (2)

The maximal number of digits after the decimal point when logging sub-second delay values.

export_environment (see 'postconf -d' output)

The list of environment variables that a Postfix process will export to non-Postfix processes.

ipc_timeout (3600s)

The time limit for sending or receiving information over an internal communication channel.

local_command_shell (empty)

Optional shell program for local(8) delivery to non-Postfix command.

max_idle (100s)

The maximum amount of time that an idle Postfix daemon process waits for an incoming connection before terminating voluntarily.

max_use (100)

The maximal number of incoming connections that a Postfix daemon process will service before terminating voluntarily.

prepend_delivered_header (command, file, forward)

The message delivery contexts where the Postfix local(8) delivery agent prepends a Delivered-To: message header with the address that the mail was delivered to.

process_id (read-only)

The process ID of a Postfix command or daemon process.

process_name (read-only)

The process name of a Postfix command or daemon process.

propagate_unmatched_extensions (canonical, virtual)

What address lookup tables copy an address extension from the lookup key to the lookup result.

queue_directory (see 'postconf -d' output)

The location of the Postfix top-level queue directory.

recipient_delimiter (empty)

The set of characters that can separate an email address localpart, user name, or a .forward file name from its extension.

require_home_directory (no)

Require that a local(8) recipient's home directory exists before mail delivery is attempted.

syslog_facility (mail)

The syslog facility of Postfix logging.

syslog_name (see 'postconf -d' output)

A prefix that is prepended to the process name in syslog records, so that, for example, "smtpd" becomes "prefix/smtpd".

Available in Postfix version 3.3 and later:

enable_original_recipient (yes)

Enable support for the original recipient address after an address is rewritten to a different address (for example with aliasing or with canonical mapping).

service_name (read-only)

The master.cf service name of a Postfix daemon process.

Available in Postfix 3.5 and later:

info_log_address_format (external)

The email address form that will be used in non-debug logging (info, warning, etc.).

## FILES

```
The following are examples; details differ between systems.
$HOME/.forward, per-user aliasing
/etc/aliases, system-wide alias database
/var/spool/mail, system mailboxes
```

## SEE ALSO

```
qmgr(8), queue manager
bounce(8), delivery status reports
newaliases(1), create/update alias database
postalias(1), create/update alias database
aliases(5), format of alias database
postconf(5), configuration parameters
master(5), generic daemon options
postlogd(8), Postfix logging
syslogd(8), system logging
```

## LICENSE

```

```

The Secure Mailer license must be distributed with this software.

## HISTORY

The Delivered-To: message header appears in the qmail system by Daniel Bernstein.

The maildir structure appears in the qmail system by Daniel Bernstein.

## AUTHOR(S)

```
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
```


master

package: postfix

title: master(8)

text:
# master(8)

## NAME
master - Postfix master process

## SYNOPSIS

```
master [-Dditvw] [-c config_dir] [-e exit_time]
```

## DESCRIPTION

The master(8) daemon is the resident process that runs Postfix daemons on demand: daemons to send or receive messages via the network, daemons to deliver mail locally, etc. These daemons are created on demand up to a configurable maximum number per service.

Postfix daemons terminate voluntarily, either after being idle for a configurable amount of time, or after having serviced a configurable number of requests. Exceptions to this rule are the resident queue manager, address verification server, and the TLS session cache and pseudo-random number server.

The behavior of the master(8) daemon is controlled by the master.cf configuration file, as described in master(5).

Options:

-c config_dir

Read the main.cf and master.cf configuration files in the named directory instead of the default configuration directory. This also overrides the configuration files for other Postfix daemon processes.

-D

After initialization, run a debugger on the master process. The debugging command is specified with the debugger_command in the main.cf global configuration file.

-d

Do not redirect stdin, stdout or stderr to /dev/null, and do not discard the controlling terminal. This must be used for debugging only.

-e exit_time

Terminate the master process after exit_time seconds. Child processes terminate at their convenience.

-i

Enable init mode: do not become a session or process group leader; and similar to -s, do not redirect stdout to /dev/null, so that "maillog_file = /dev/stdout" works. This mode is allowed only if the process ID equals 1. This feature is available in Postfix 3.3 and later.

-s

Do not redirect stdout to /dev/null, so that "maillog_file = /dev/stdout" works. This feature is available in Postfix 3.4 and later.

-t

Test mode. Return a zero exit status when the master.pid lock file does not exist or when that file is not locked. This is evidence that the master(8) daemon is not running.

-v

Enable verbose logging for debugging purposes. This option is passed on to child processes. Multiple -v options make the software increasingly verbose.

-w

Wait in a dummy foreground process, while the real master daemon initializes in a background process. The dummy foreground process returns a zero exit status only if the master daemon initialization is successful, and if it completes in a reasonable amount of time. This feature is available in Postfix 2.10 and later.

Signals:

SIGHUP

Upon receipt of a HUP signal (e.g., after "postfix reload"), the master process re-reads its configuration files. If a service has been removed from the master.cf file, its running processes are terminated immediately. Otherwise, running processes are allowed to terminate as soon as is convenient, so that changes in configuration settings affect only new service requests.

SIGTERM

Upon receipt of a TERM signal (e.g., after "postfix abort"), the master process passes the signal on to its child processes and terminates. This is useful for an emergency shutdown. Normally one would terminate only the master ("postfix stop") and allow running processes to finish what they are doing.

## DIAGNOSTICS

Problems are reported to syslogd(8) or postlogd(8). The exit status is non-zero in case of problems, including problems while initializing as a master daemon process in the background.

## ENVIRONMENT

```

```

MAIL_DEBUG

After initialization, start a debugger as specified with the debugger_command configuration parameter in the main.cf configuration file.

MAIL_CONFIG

Directory with Postfix configuration files.

## CONFIGURATION PARAMETERS

```

```

Unlike most Postfix daemon processes, the master(8) server does not automatically pick up changes to main.cf. Changes to master.cf are never picked up automatically. Use the "postfix reload" command after a configuration change.

## RESOURCE AND RATE CONTROLS

```

```

default_process_limit (100)

The default maximal number of Postfix child processes that provide a given service.

max_idle (100s)

The maximum amount of time that an idle Postfix daemon process waits for an incoming connection before terminating voluntarily.

max_use (100)

The maximal number of incoming connections that a Postfix daemon process will service before terminating voluntarily.

service_throttle_time (60s)

How long the Postfix master(8) waits before forking a server that appears to be malfunctioning.

Available in Postfix version 2.6 and later:

master_service_disable (empty)

Selectively disable master(8) listener ports by service type or by service name and type.

## MISCELLANEOUS CONTROLS

```

```

config_directory (see 'postconf -d' output)

The default location of the Postfix main.cf and master.cf configuration files.

daemon_directory (see 'postconf -d' output)

The directory with Postfix support programs and daemon programs.

debugger_command (empty)

The external command to execute when a Postfix daemon program is invoked with the -D option.

inet_interfaces (all)

The network interface addresses that this mail system receives mail on.

inet_protocols (any)

The Internet protocols Postfix will attempt to use when making or accepting connections.

import_environment (see 'postconf -d' output)

The list of environment parameters that a privileged Postfix process will import from a non-Postfix parent process, or name=value environment overrides.

mail_owner (postfix)

The UNIX system account that owns the Postfix queue and most Postfix daemon processes.

process_id (read-only)

The process ID of a Postfix command or daemon process.

process_name (read-only)

The process name of a Postfix command or daemon process.

queue_directory (see 'postconf -d' output)

The location of the Postfix top-level queue directory.

syslog_facility (mail)

The syslog facility of Postfix logging.

syslog_name (see 'postconf -d' output)

A prefix that is prepended to the process name in syslog records, so that, for example, "smtpd" becomes "prefix/smtpd".

Available in Postfix 3.3 and later:

service_name (read-only)

The master.cf service name of a Postfix daemon process.

Available in Postfix 3.6 and later:

known_tcp_ports (lmtp=24, smtp=25, smtps=submissions=465, submission=587)

Optional setting that avoids lookups in the services(5) database.

## FILES

```

```

To expand the directory names below into their actual values, use the command "postconf config_directory" etc.

```
$config_directory/main.cf, global configuration file.
$config_directory/master.cf, master server configuration file.
$queue_directory/pid/master.pid, master lock file.
$data_directory/master.lock, master lock file.
```

## SEE ALSO

```
qmgr(8), queue manager
verify(8), address verification
master(5), master.cf configuration file syntax
postconf(5), main.cf configuration file syntax
postlogd(8), Postfix logging
syslogd(8), system logging
```

## LICENSE

```

```

The Secure Mailer license must be distributed with this software.

## AUTHOR(S)

```
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
```


oqmgr

title: oqmgr(8)

text:
# oqmgr(8)

## NAME
oqmgr - old Postfix queue manager

## SYNOPSIS

```
oqmgr [generic Postfix daemon options]
```

## DESCRIPTION

The oqmgr(8) daemon awaits the arrival of incoming mail and arranges for its delivery via Postfix delivery processes. The actual mail routing strategy is delegated to the trivial-rewrite(8) daemon. This program expects to be run from the master(8) process manager.

Mail addressed to the local double-bounce address is logged and discarded. This stops potential loops caused by undeliverable bounce notifications.

## MAIL QUEUES

```

```

The oqmgr(8) daemon maintains the following queues:

incoming

Inbound mail from the network, or mail picked up by the local pickup(8) agent from the maildrop directory.

active

Messages that the queue manager has opened for delivery. Only a limited number of messages is allowed to enter the active queue (leaky bucket strategy, for a fixed delivery rate).

deferred

Mail that could not be delivered upon the first attempt. The queue manager implements exponential backoff by doubling the time between delivery attempts.

corrupt

Unreadable or damaged queue files are moved here for inspection.

hold

Messages that are kept "on hold" are kept here until someone sets them free.

## DELIVERY STATUS REPORTS

```

```

The oqmgr(8) daemon keeps an eye on per-message delivery status reports in the following directories. Each status report file has the same name as the corresponding message file:

bounce

Per-recipient status information about why mail is bounced. These files are maintained by the bounce(8) daemon.

defer

Per-recipient status information about why mail is delayed. These files are maintained by the defer(8) daemon.

trace

Per-recipient status information as requested with the Postfix "sendmail -v" or "sendmail -bv" command. These files are maintained by the trace(8) daemon.

The oqmgr(8) daemon is responsible for asking the bounce(8), defer(8) or trace(8) daemons to send delivery reports.

## STRATEGIES

```

```

The queue manager implements a variety of strategies for either opening queue files (input) or for message delivery (output).

leaky bucket

This strategy limits the number of messages in the active queue and prevents the queue manager from running out of memory under heavy load.

fairness

When the active queue has room, the queue manager takes one message from the incoming queue and one from the deferred queue. This prevents a large mail backlog from blocking the delivery of new mail.

slow start

This strategy eliminates "thundering herd" problems by slowly adjusting the number of parallel deliveries to the same destination.

round robin

The queue manager sorts delivery requests by destination. Round-robin selection prevents one destination from dominating deliveries to other destinations.

exponential backoff

Mail that cannot be delivered upon the first attempt is deferred. The time interval between delivery attempts is doubled after each attempt.

destination status cache

The queue manager avoids unnecessary delivery attempts by maintaining a short-term, in-memory list of unreachable destinations.

## TRIGGERS

```

```

On an idle system, the queue manager waits for the arrival of trigger events, or it waits for a timer to go off. A trigger is a one-byte message. Depending on the message received, the queue manager performs one of the following actions (the message is followed by the symbolic constant used internally by the software):

D (QMGR_REQ_SCAN_DEFERRED)

Start a deferred queue scan. If a deferred queue scan is already in progress, that scan will be restarted as soon as it finishes.

I (QMGR_REQ_SCAN_INCOMING)

Start an incoming queue scan. If an incoming queue scan is already in progress, that scan will be restarted as soon as it finishes.

A (QMGR_REQ_SCAN_ALL)

Ignore deferred queue file time stamps. The request affects the next deferred queue scan.

F (QMGR_REQ_FLUSH_DEAD)

Purge all information about dead transports and destinations.

W (TRIGGER_REQ_WAKEUP)

Wakeup call, This is used by the master server to instantiate servers that should not go away forever. The action is to start an incoming queue scan.

The oqmgr(8) daemon reads an entire buffer worth of triggers. Multiple identical trigger requests are collapsed into one, and trigger requests are sorted so that A and F precede D and I. Thus, in order to force a deferred queue run, one would request A F D; in order to notify the queue manager of the arrival of new mail one would request I.

## STANDARDS

```
RFC 3463 (Enhanced status codes)
RFC 3464 (Delivery status notifications)
```

## SECURITY

```

```

The oqmgr(8) daemon is not security sensitive. It reads single-character messages from untrusted local users, and thus may be susceptible to denial of service attacks. The oqmgr(8) daemon does not talk to the outside world, and it can be run at fixed low privilege in a chrooted environment.

## DIAGNOSTICS

Problems and transactions are logged to the syslogd(8) or postlogd(8) daemon. Corrupted message files are saved to the corrupt queue for further inspection.

Depending on the setting of the notify_classes parameter, the postmaster is notified of bounces and of other trouble.

## BUGS

A single queue manager process has to compete for disk access with multiple front-end processes such as cleanup(8). A sudden burst of inbound mail can negatively impact outbound delivery rates.

## CONFIGURATION PARAMETERS

```

```

Changes to main.cf are not picked up automatically, as oqmgr(8) is a persistent process. Use the command "postfix reload" after a configuration change.

The text below provides only a parameter summary. See postconf(5) for more details including examples.

In the text below, transport is the first field in a master.cf entry.

## COMPATIBILITY CONTROLS

```

```

Available before Postfix version 2.5:

allow_min_user (no)

Allow a sender or recipient address to have `-' as the first character.

Available with Postfix version 2.7 and later:

default_filter_nexthop (empty)

When a content_filter or FILTER request specifies no explicit next-hop destination, use $default_filter_nexthop instead; when that value is empty, use the domain in the recipient address.

## ACTIVE QUEUE CONTROLS

```

```

qmgr_clog_warn_time (300s)

The minimal delay between warnings that a specific destination is clogging up the Postfix active queue.

qmgr_message_active_limit (20000)

The maximal number of messages in the active queue.

qmgr_message_recipient_limit (20000)

The maximal number of recipients held in memory by the Postfix queue manager, and the maximal size of the short-term, in-memory "dead" destination status cache.

## DELIVERY CONCURRENCY CONTROLS

```

```

qmgr_fudge_factor (100)

Obsolete feature: the percentage of delivery resources that a busy mail system will use up for delivery of a large mailing list message.

initial_destination_concurrency (5)

The initial per-destination concurrency level for parallel delivery to the same destination.

default_destination_concurrency_limit (20)

The default maximal number of parallel deliveries to the same destination.

transport_destination_concurrency_limit ($default_destination_concurrency_limit)

A transport-specific override for the default_destination_concurrency_limit parameter value, where transport is the master.cf name of the message delivery transport.

Available in Postfix version 2.5 and later:

transport_initial_destination_concurrency ($initial_destination_concurrency)

A transport-specific override for the initial_destination_concurrency parameter value, where transport is the master.cf name of the message delivery transport.

default_destination_concurrency_failed_cohort_limit (1)

How many pseudo-cohorts must suffer connection or handshake failure before a specific destination is considered unavailable (and further delivery is suspended).

transport_destination_concurrency_failed_cohort_limit ($default_destination_concurrency_failed_cohort_limit)

A transport-specific override for the default_destination_concurrency_failed_cohort_limit parameter value, where transport is the master.cf name of the message delivery transport.

default_destination_concurrency_negative_feedback (1)

The per-destination amount of delivery concurrency negative feedback, after a delivery completes with a connection or handshake failure.

transport_destination_concurrency_negative_feedback ($default_destination_concurrency_negative_feedback)

A transport-specific override for the default_destination_concurrency_negative_feedback parameter value, where transport is the master.cf name of the message delivery transport.

default_destination_concurrency_positive_feedback (1)

The per-destination amount of delivery concurrency positive feedback, after a delivery completes without connection or handshake failure.

transport_destination_concurrency_positive_feedback ($default_destination_concurrency_positive_feedback)

A transport-specific override for the default_destination_concurrency_positive_feedback parameter value, where transport is the master.cf name of the message delivery transport.

destination_concurrency_feedback_debug (no)

Make the queue manager's feedback algorithm verbose for performance analysis purposes.

## RECIPIENT SCHEDULING CONTROLS

```

```

default_destination_recipient_limit (50)

The default maximal number of recipients per message delivery.

transport_destination_recipient_limit ($default_destination_recipient_limit)

A transport-specific override for the default_destination_recipient_limit parameter value, where transport is the master.cf name of the message delivery transport.

## OTHER RESOURCE AND RATE CONTROLS

```

```

minimal_backoff_time (300s)

The minimal time between attempts to deliver a deferred message; prior to Postfix 2.4 the default value was 1000s.

maximal_backoff_time (4000s)

The maximal time between attempts to deliver a deferred message.

maximal_queue_lifetime (5d)

Consider a message as undeliverable, when delivery fails with a temporary error, and the time in the queue has reached the maximal_queue_lifetime limit.

queue_run_delay (300s)

The time between deferred queue scans by the queue manager; prior to Postfix 2.4 the default value was 1000s.

transport_retry_time (60s)

The time between attempts by the Postfix queue manager to contact a malfunctioning message delivery transport.

Available in Postfix version 2.1 and later:

bounce_queue_lifetime (5d)

Consider a bounce message as undeliverable, when delivery fails with a temporary error, and the time in the queue has reached the bounce_queue_lifetime limit.

Available in Postfix version 2.5 and later:

default_destination_rate_delay (0s)

The default amount of delay that is inserted between individual message deliveries to the same destination and over the same message delivery transport.

transport_destination_rate_delay ($default_destination_rate_delay)

A transport-specific override for the default_destination_rate_delay parameter value, where transport is the master.cf name of the message delivery transport.

Available in Postfix version 3.1 and later:

default_transport_rate_delay (0s)

The default amount of delay that is inserted between individual message deliveries over the same message delivery transport, regardless of destination.

transport_transport_rate_delay ($default_transport_rate_delay)

A transport-specific override for the default_transport_rate_delay parameter value, where the initial transport in the parameter name is the master.cf name of the message delivery transport.

## SAFETY CONTROLS

```

```

qmgr_daemon_timeout (1000s)

How much time a Postfix queue manager process may take to handle a request before it is terminated by a built-in watchdog timer.

qmgr_ipc_timeout (60s)

The time limit for the queue manager to send or receive information over an internal communication channel.

Available in Postfix version 3.1 and later:

address_verify_pending_request_limit (see 'postconf -d' output)

A safety limit that prevents address verification requests from overwhelming the Postfix queue.

## MISCELLANEOUS CONTROLS

```

```

config_directory (see 'postconf -d' output)

The default location of the Postfix main.cf and master.cf configuration files.

defer_transports (empty)

The names of message delivery transports that should not deliver mail unless someone issues "sendmail -q" or equivalent.

delay_logging_resolution_limit (2)

The maximal number of digits after the decimal point when logging sub-second delay values.

helpful_warnings (yes)

Log warnings about problematic configuration settings, and provide helpful suggestions.

process_id (read-only)

The process ID of a Postfix command or daemon process.

process_name (read-only)

The process name of a Postfix command or daemon process.

queue_directory (see 'postconf -d' output)

The location of the Postfix top-level queue directory.

syslog_facility (mail)

The syslog facility of Postfix logging.

syslog_name (see 'postconf -d' output)

A prefix that is prepended to the process name in syslog records, so that, for example, "smtpd" becomes "prefix/smtpd".

Available in Postfix version 3.0 and later:

confirm_delay_cleared (no)

After sending a "your message is delayed" notification, inform the sender when the delay clears up.

Available in Postfix 3.3 and later:

service_name (read-only)

The master.cf service name of a Postfix daemon process.

Available in Postfix 3.5 and later:

info_log_address_format (external)

The email address form that will be used in non-debug logging (info, warning, etc.).

## FILES

```
/var/spool/postfix/incoming, incoming queue
/var/spool/postfix/active, active queue
/var/spool/postfix/deferred, deferred queue
/var/spool/postfix/bounce, non-delivery status
/var/spool/postfix/defer, non-delivery status
/var/spool/postfix/trace, delivery status
```

## SEE ALSO

```
trivial-rewrite(8), address routing
bounce(8), delivery status reports
postconf(5), configuration parameters
master(5), generic daemon options
master(8), process manager
postlogd(8), Postfix logging
syslogd(8), system logging
```

## README FILES

```

```

Use "postconf readme_directory" or "postconf html_directory" to locate this information.

```
QSHAPE_README, Postfix queue analysis
```

## LICENSE

```

```

The Secure Mailer license must be distributed with this software.

## AUTHOR(S)

```
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
```


pickup

title: pickup(8)

text:
# pickup(8)

## NAME
pickup - Postfix local mail pickup

## SYNOPSIS

```
pickup [generic Postfix daemon options]
```

## DESCRIPTION

The pickup(8) daemon waits for hints that new mail has been dropped into the maildrop directory, and feeds it into the cleanup(8) daemon. Ill-formatted files are deleted without notifying the originator. This program expects to be run from the master(8) process manager.

## STANDARDS

```

```

None. The pickup(8) daemon does not interact with the outside world.

## SECURITY

```

```

The pickup(8) daemon is moderately security sensitive. It runs with fixed low privilege and can run in a chrooted environment. However, the program reads files from potentially hostile users. The pickup(8) daemon opens no files for writing, is careful about what files it opens for reading, and does not actually touch any data that is sent to its public service endpoint.

## DIAGNOSTICS

Problems and transactions are logged to syslogd(8) or postlogd(8).

## BUGS

The pickup(8) daemon copies mail from file to the cleanup(8) daemon. It could avoid message copying overhead by sending a file descriptor instead of file data, but then the already complex cleanup(8) daemon would have to deal with unfiltered user data.

## CONFIGURATION PARAMETERS

```

```

As the pickup(8) daemon is a relatively long-running process, up to an hour may pass before a main.cf change takes effect. Use the command "postfix reload" command to speed up a change.

The text below provides only a parameter summary. See postconf(5) for more details including examples.

## CONTENT INSPECTION CONTROLS

```

```

content_filter (empty)

After the message is queued, send the entire message to the specified transport:destination.

receive_override_options (empty)

Enable or disable recipient validation, built-in content filtering, or address mapping.

## MISCELLANEOUS CONTROLS

```

```

config_directory (see 'postconf -d' output)

The default location of the Postfix main.cf and master.cf configuration files.

ipc_timeout (3600s)

The time limit for sending or receiving information over an internal communication channel.

line_length_limit (2048)

Upon input, long lines are chopped up into pieces of at most this length; upon delivery, long lines are reconstructed.

max_idle (100s)

The maximum amount of time that an idle Postfix daemon process waits for an incoming connection before terminating voluntarily.

max_use (100)

The maximal number of incoming connections that a Postfix daemon process will service before terminating voluntarily.

process_id (read-only)

The process ID of a Postfix command or daemon process.

process_name (read-only)

The process name of a Postfix command or daemon process.

queue_directory (see 'postconf -d' output)

The location of the Postfix top-level queue directory.

syslog_facility (mail)

The syslog facility of Postfix logging.

syslog_name (see 'postconf -d' output)

A prefix that is prepended to the process name in syslog records, so that, for example, "smtpd" becomes "prefix/smtpd".

Available in Postfix 3.3 and later:

service_name (read-only)

The master.cf service name of a Postfix daemon process.

Available in Postfix 3.5 and later:

info_log_address_format (external)

The email address form that will be used in non-debug logging (info, warning, etc.).

## SEE ALSO

```
cleanup(8), message canonicalization
sendmail(1), Sendmail-compatible interface
postdrop(1), mail posting agent
postconf(5), configuration parameters
master(5), generic daemon options
master(8), process manager
postlogd(8), Postfix logging
syslogd(8), system logging
```

## LICENSE

```

```

The Secure Mailer license must be distributed with this software.

## AUTHOR(S)

```
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
```


pipe

title: pipe(8)

text:
# pipe(8)

## NAME
pipe - Postfix delivery to external command

## SYNOPSIS

```
pipe [generic Postfix daemon options] command_attributes...
```

## DESCRIPTION

The pipe(8) daemon processes requests from the Postfix queue manager to deliver messages to external commands. This program expects to be run from the master(8) process manager.

Message attributes such as sender address, recipient address and next-hop host name can be specified as command-line macros that are expanded before the external command is executed.

The pipe(8) daemon updates queue files and marks recipients as finished, or it informs the queue manager that delivery should be tried again at a later time. Delivery status reports are sent to the bounce(8), defer(8) or trace(8) daemon as appropriate.

## SINGLE-RECIPIENT DELIVERY

```

```

Some destinations cannot handle more than one recipient per delivery request. Examples are pagers or fax machines. In addition, multi-recipient delivery is undesirable when prepending a Delivered-to: or X-Original-To: message header.

To prevent Postfix from sending multiple recipients per delivery request, specify

```
    transport_destination_recipient_limit = 1
```

in the Postfix main.cf file, where transport is the name in the first column of the Postfix master.cf entry for the pipe-based delivery transport.

## COMMAND ATTRIBUTE SYNTAX

```

```

The external command attributes are given in the master.cf file at the end of a service definition. The syntax is as follows:

chroot=pathname (optional)

Change the process root directory and working directory to the named directory. This happens before switching to the privileges specified with the user attribute, and before executing the optional directory=pathname directive. Delivery is deferred in case of failure. This feature is available as of Postfix 2.3.

directory=pathname (optional)

Change to the named directory before executing the external command. The directory must be accessible for the user specified with the user attribute (see below). The default working directory is $queue_directory. Delivery is deferred in case of failure. This feature is available as of Postfix 2.2.

eol=string (optional, default: \n)

The output record delimiter. Typically one would use either \r\n or \n. The usual C-style backslash escape sequences are recognized: \a \b \f \n \r \t \v \ddd (up to three octal digits) and \\.

flags=BDFORXhqu.> (optional)

Optional message processing flags. By default, a message is copied unchanged.

B

Append a blank line at the end of each message. This is required by some mail user agents that recognize "From " lines only when preceded by a blank line.

D

Prepend a "Delivered-To: recipient" message header with the envelope recipient address. Note: for this to work, the transport_destination_recipient_limit must be 1 (see SINGLE-RECIPIENT DELIVERY above for details). The D flag also enforces loop detection (Postfix 2.5 and later): if a message already contains a Delivered-To: header with the same recipient address, then the message is returned as undeliverable. The address comparison is case insensitive.

This feature is available as of Postfix 2.0.

F

Prepend a "From sender time_stamp" envelope header to the message content. This is expected by, for example, UUCP software.

O

Prepend an "X-Original-To: recipient" message header with the recipient address as given to Postfix. Note: for this to work, the transport_destination_recipient_limit must be 1 (see SINGLE-RECIPIENT DELIVERY above for details). This feature is available as of Postfix 2.0.

R

Prepend a Return-Path: message header with the envelope sender address.

X

Indicate that the external command performs final delivery. This flag affects the status reported in "success" DSN (delivery status notification) messages, and changes it from "relayed" into "delivered". This feature is available as of Postfix 2.5.

h

Fold the command-line $original_recipient and $recipient address domain part (text to the right of the right-most @ character) to lower case; fold the entire command-line $domain and $nexthop host or domain information to lower case. This is recommended for delivery via UUCP.

q

Quote white space and other special characters in the command-line $sender, $original_recipient and $recipient address localparts (text to the left of the right-most @ character), according to an 8-bit transparent version of RFC 822. This is recommended for delivery via UUCP or BSMTP. The result is compatible with the address parsing of command-line recipients by the Postfix sendmail(1) mail submission command.

The q flag affects only entire addresses, not the partial address information from the $user, $extension or $mailbox command-line macros.

u

Fold the command-line $original_recipient and $recipient address localpart (text to the left of the right-most @ character) to lower case. This is recommended for delivery via UUCP.

.

Prepend "." to lines starting with ".". This is needed by, for example, BSMTP software.

>

Prepend ">" to lines starting with "From ". This is expected by, for example, UUCP software.

null_sender=replacement (default: MAILER-DAEMON)

Replace the null sender address (typically used for delivery status notifications) with the specified text when expanding the $sender command-line macro, and when generating a From_ or Return-Path: message header. If the null sender replacement text is a non-empty string then it is affected by the q flag for address quoting in command-line arguments.

The null sender replacement text may be empty; this form is recommended for content filters that feed mail back into Postfix. The empty sender address is not affected by the q flag for address quoting in command-line arguments.

Caution: a null sender address is easily mis-parsed by naive software. For example, when the pipe(8) daemon executes a command such as:

```
    Wrong: command -f$sender -- $recipient
```

the command will mis-parse the -f option value when the sender address is a null string. For correct parsing, specify $sender as an argument by itself:

```
    Right: command -f $sender -- $recipient
```

This feature is available as of Postfix 2.3.

size=size_limit (optional)

Don't deliver messages that exceed this size limit (in bytes); return them to the sender instead.

user=username (required)

user=username:groupname

Execute the external command with the user ID and group ID of the specified username. The software refuses to execute commands with root privileges, or with the privileges of the mail system owner. If groupname is specified, the corresponding group ID is used instead of the group ID of username.

argv=command... (required)

The command to be executed. This must be specified as the last command attribute. The command is executed directly, i.e. without interpretation of shell meta characters by a shell command interpreter. Specify "{" and "}" around command arguments that contain whitespace (Postfix 3.0 and later). Whitespace after the opening "{" and before the closing "}" is ignored.

In the command argument vector, the following macros are recognized and replaced with corresponding information from the Postfix queue manager delivery request.

In addition to the form ${name}, the forms $name and the deprecated form $(name) are also recognized. Specify $$ where a single $ is wanted.

${client_address}

This macro expands to the remote client network address. This feature is available as of Postfix 2.2.

${client_helo}

This macro expands to the remote client HELO command parameter. This feature is available as of Postfix 2.2.

${client_hostname}

This macro expands to the remote client hostname. This feature is available as of Postfix 2.2.

${client_port}

This macro expands to the remote client TCP port number. This feature is available as of Postfix 2.5.

${client_protocol}

This macro expands to the remote client protocol. This feature is available as of Postfix 2.2.

${domain}

This macro expands to the domain portion of the recipient address. For example, with an address user+foo@domain the domain is domain. This information is modified by the h flag for case folding.

This feature is available as of Postfix 2.5.

${extension}

This macro expands to the extension part of a recipient address. For example, with an address user+foo@domain the extension is foo. A command-line argument that contains ${extension} expands into as many command-line arguments as there are recipients.

This information is modified by the u flag for case folding.

${mailbox}

This macro expands to the complete local part of a recipient address. For example, with an address user+foo@domain the mailbox is user+foo. A command-line argument that contains ${mailbox} expands to as many command-line arguments as there are recipients.

This information is modified by the u flag for case folding.

${nexthop}

This macro expands to the next-hop hostname. This information is modified by the h flag for case folding.

${original_recipient}

This macro expands to the complete recipient address before any address rewriting or aliasing. A command-line argument that contains ${original_recipient} expands to as many command-line arguments as there are recipients.

This information is modified by the hqu flags for quoting and case folding.

This feature is available as of Postfix 2.5.

${queue_id}

This macro expands to the queue id. This feature is available as of Postfix 2.11.

${recipient}

This macro expands to the complete recipient address. A command-line argument that contains ${recipient} expands to as many command-line arguments as there are recipients.

This information is modified by the hqu flags for quoting and case folding.

${sasl_method}

This macro expands to the name of the SASL authentication mechanism in the AUTH command when the Postfix SMTP server received the message. This feature is available as of Postfix 2.2.

${sasl_sender}

This macro expands to the SASL sender name (i.e. the original submitter as per RFC 4954) in the MAIL FROM command when the Postfix SMTP server received the message. This feature is available as of Postfix 2.2.

${sasl_username}

This macro expands to the SASL user name in the AUTH command when the Postfix SMTP server received the message. This feature is available as of Postfix 2.2.

${sender}

This macro expands to the envelope sender address. By default, the null sender address expands to MAILER-DAEMON; this can be changed with the null_sender attribute, as described above. This information is modified by the q flag for quoting.

${size}

This macro expands to Postfix's idea of the message size, which is an approximation of the size of the message as delivered.

${user}

This macro expands to the username part of a recipient address. For example, with an address user+foo@domain the username part is user. A command-line argument that contains ${user} expands into as many command-line arguments as there are recipients.

This information is modified by the u flag for case folding.

## STANDARDS

```
RFC 3463 (Enhanced status codes)
```

## DIAGNOSTICS

Command exit status codes are expected to follow the conventions defined in <sysexits.h>. Exit status 0 means normal successful completion.

In the case of a non-zero exit status, a limited amount of command output is logged, and reported in a delivery status notification. When the output begins with a 4.X.X or 5.X.X enhanced status code, the status code takes precedence over the non-zero exit status (Postfix version 2.3 and later).

After successful delivery (zero exit status) a limited amount of command output is logged, and reported in "success" delivery status notifications (Postfix 3.0 and later). This command output is not examined for the presence of an enhanced status code.

Problems and transactions are logged to syslogd(8) or postlogd(8). Corrupted message files are marked so that the queue manager can move them to the corrupt queue for further inspection.

## SECURITY

```

```

This program needs a dual personality 1) to access the private Postfix queue and IPC mechanisms, and 2) to execute external commands as the specified user. It is therefore security sensitive.

## CONFIGURATION PARAMETERS

```

```

Changes to main.cf are picked up automatically as pipe(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.

## RESOURCE AND RATE CONTROLS

```

```

In the text below, transport is the first field in a master.cf entry.

transport_time_limit ($command_time_limit)

A transport-specific override for the command_time_limit parameter value, where transport is the master.cf name of the message delivery transport.

Implemented in the qmgr(8) daemon:

transport_destination_concurrency_limit ($default_destination_concurrency_limit)

A transport-specific override for the default_destination_concurrency_limit parameter value, where transport is the master.cf name of the message delivery transport.

transport_destination_recipient_limit ($default_destination_recipient_limit)

A transport-specific override for the default_destination_recipient_limit parameter value, where transport is the master.cf name of the message delivery transport.

## MISCELLANEOUS CONTROLS

```

```

config_directory (see 'postconf -d' output)

The default location of the Postfix main.cf and master.cf configuration files.

daemon_timeout (18000s)

How much time a Postfix daemon process may take to handle a request before it is terminated by a built-in watchdog timer.

delay_logging_resolution_limit (2)

The maximal number of digits after the decimal point when logging sub-second delay values.

export_environment (see 'postconf -d' output)

The list of environment variables that a Postfix process will export to non-Postfix processes.

ipc_timeout (3600s)

The time limit for sending or receiving information over an internal communication channel.

mail_owner (postfix)

The UNIX system account that owns the Postfix queue and most Postfix daemon processes.

max_idle (100s)

The maximum amount of time that an idle Postfix daemon process waits for an incoming connection before terminating voluntarily.

max_use (100)

The maximal number of incoming connections that a Postfix daemon process will service before terminating voluntarily.

process_id (read-only)

The process ID of a Postfix command or daemon process.

process_name (read-only)

The process name of a Postfix command or daemon process.

queue_directory (see 'postconf -d' output)

The location of the Postfix top-level queue directory.

recipient_delimiter (empty)

The set of characters that can separate an email address localpart, user name, or a .forward file name from its extension.

syslog_facility (mail)

The syslog facility of Postfix logging.

syslog_name (see 'postconf -d' output)

A prefix that is prepended to the process name in syslog records, so that, for example, "smtpd" becomes "prefix/smtpd".

Available in Postfix version 3.0 and later:

pipe_delivery_status_filter ($default_delivery_status_filter)

Optional filter for the pipe(8) delivery agent to change the delivery status code or explanatory text of successful or unsuccessful deliveries.

Available in Postfix version 3.3 and later:

enable_original_recipient (yes)

Enable support for the original recipient address after an address is rewritten to a different address (for example with aliasing or with canonical mapping).

service_name (read-only)

The master.cf service name of a Postfix daemon process.

Available in Postfix 3.5 and later:

info_log_address_format (external)

The email address form that will be used in non-debug logging (info, warning, etc.).

## SEE ALSO

```
qmgr(8), queue manager
bounce(8), delivery status reports
postconf(5), configuration parameters
master(5), generic daemon options
master(8), process manager
postlogd(8), Postfix logging
syslogd(8), system logging
```

## LICENSE

```

```

The Secure Mailer license must be distributed with this software.

## AUTHOR(S)

```
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
```


postlogd

title: postlogd(8)

text:
# postlogd(8)

## NAME
postlogd - Postfix internal log server

## SYNOPSIS

```
postlogd [generic Postfix daemon options]
```

## DESCRIPTION

This program logs events on behalf of Postfix programs when the maillog configuration parameter specifies a non-empty value.

## BUGS

Non-daemon Postfix programs don't know that they should log to the internal logging service before they have processed command-line options and main.cf parameters. These programs still log earlier events to the syslog service.

If Postfix is down, the non-daemon programs postfix(1), postsuper(1), postmulti(1), and postlog(1), will log directly to $maillog_file. These programs expect to run with root privileges, for example during Postfix start-up, reload, or shutdown.

Other non-daemon Postfix programs will never write directly to $maillog_file (also, logging to stdout would interfere with the operation of some of these programs). These programs can log to postlogd(8) if they are run by the super-user, or if their executable file has set-gid permission. Do not set this permission on programs other than postdrop(1) and postqueue(1).

## CONFIGURATION PARAMETERS

```

```

Changes to main.cf are picked up automatically, as postlogd(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.

config_directory (see 'postconf -d' output)

The default location of the Postfix main.cf and master.cf configuration files.

maillog_file (empty)

The name of an optional logfile that is written by the Postfix postlogd(8) service.

process_id (read-only)

The process ID of a Postfix command or daemon process.

process_name (read-only)

The process name of a Postfix command or daemon process.

syslog_name (see 'postconf -d' output)

A prefix that is prepended to the process name in syslog records, so that, for example, "smtpd" becomes "prefix/smtpd".

service_name (read-only)

The master.cf service name of a Postfix daemon process.

postlogd_watchdog_timeout (10s)

How much time a postlogd(8) process may take to process a request before it is terminated by a built-in watchdog timer.

## SEE ALSO

```
postconf(5), configuration parameters
syslogd(8), system logging
```

## README_FILES

```

```

Use "postconf readme_directory" or "postconf html_directory" to locate this information.

```
MAILLOG_README, Postfix logging to file or stdout
```

## LICENSE

```

```

The Secure Mailer license must be distributed with this software.

## HISTORY

This service was introduced with Postfix version 3.4.

## AUTHOR(S)

```
Wietse Venema
Google, Inc.
111 8th Avenue
New York, NY 10011, USA
```


postscreen

title: postscreen(8)

text:
# postscreen(8)

## NAME
postscreen - Postfix zombie blocker

## SYNOPSIS

```
postscreen [generic Postfix daemon options]
```

## DESCRIPTION

The Postfix postscreen(8) server provides additional protection against mail server overload. One postscreen(8) process handles multiple inbound SMTP connections, and decides which clients may talk to a Postfix SMTP server process. By keeping spambots away, postscreen(8) leaves more SMTP server processes available for legitimate clients, and delays the onset of server overload conditions.

This program should not be used on SMTP ports that receive mail from end-user clients (MUAs). In a typical deployment, postscreen(8) handles the MX service on TCP port 25, and smtpd(8) receives mail from MUAs on the submission service (TCP port 587) which requires client authentication. Alternatively, a site could set up a dedicated, non-postscreen, "port 25" server that provides submission service and client authentication, but no MX service.

postscreen(8) maintains a temporary allowlist for clients that have passed a number of tests. When an SMTP client IP address is allowlisted, postscreen(8) hands off the connection immediately to a Postfix SMTP server process. This minimizes the overhead for legitimate mail.

By default, postscreen(8) logs statistics and hands off each connection to a Postfix SMTP server process, while excluding clients in mynetworks from all tests (primarily, to avoid problems with non-standard SMTP implementations in network appliances). This default mode blocks no clients, and is useful for non-destructive testing.

In a typical production setting, postscreen(8) is configured to reject mail from clients that fail one or more tests. postscreen(8) logs rejected mail with the client address, helo, sender and recipient information.

postscreen(8) is not an SMTP proxy; this is intentional. The purpose is to keep spambots away from Postfix SMTP server processes, while minimizing overhead for legitimate traffic.

## SECURITY

```

```

The postscreen(8) server is moderately security-sensitive. It talks to untrusted clients on the network. The process can be run chrooted at fixed low privilege.

## STANDARDS

```
RFC 821 (SMTP protocol)
RFC 1123 (Host requirements)
RFC 1652 (8bit-MIME transport)
RFC 1869 (SMTP service extensions)
RFC 1870 (Message Size Declaration)
RFC 1985 (ETRN command)
RFC 2034 (SMTP Enhanced Status Codes)
RFC 2821 (SMTP protocol)
Not: RFC 2920 (SMTP Pipelining)
RFC 3030 (CHUNKING without BINARYMIME)
RFC 3207 (STARTTLS command)
RFC 3461 (SMTP DSN Extension)
RFC 3463 (Enhanced Status Codes)
RFC 5321 (SMTP protocol, including multi-line 220 banners)
```

## DIAGNOSTICS

Problems and transactions are logged to syslogd(8) or postlogd(8).

## BUGS

The postscreen(8) built-in SMTP protocol engine currently does not announce support for AUTH, XCLIENT or XFORWARD. If you need to make these services available on port 25, then do not enable the optional "after 220 server greeting" tests.

The optional "after 220 server greeting" tests may result in unexpected delivery delays from senders that retry email delivery from a different IP address. Reason: after passing these tests a new client must disconnect, and reconnect from the same IP address before it can deliver mail. See POSTSCREEN_README, section "Tests after the 220 SMTP server greeting", for a discussion.

## CONFIGURATION PARAMETERS

```

```

Changes to main.cf are not picked up automatically, as postscreen(8) processes may run for several hours. Use the command "postfix reload" after a configuration change.

The text below provides only a parameter summary. See postconf(5) for more details including examples.

NOTE: Some postscreen(8) parameters implement stress-dependent behavior. This is supported only when the default parameter value is stress-dependent (that is, it looks like ${stress?{X}:{Y}}, or it is the $name of an smtpd parameter with a stress-dependent default). Other parameters always evaluate as if the stress parameter value is the empty string.

## COMPATIBILITY CONTROLS

```

```

postscreen_command_filter ($smtpd_command_filter)

A mechanism to transform commands from remote SMTP clients.

postscreen_discard_ehlo_keyword_address_maps ($smtpd_discard_ehlo_keyword_address_maps)

Lookup tables, indexed by the remote SMTP client address, with case insensitive lists of EHLO keywords (pipelining, starttls, auth, etc.) that the postscreen(8) server will not send in the EHLO response to a remote SMTP client.

postscreen_discard_ehlo_keywords ($smtpd_discard_ehlo_keywords)

A case insensitive list of EHLO keywords (pipelining, starttls, auth, etc.) that the postscreen(8) server will not send in the EHLO response to a remote SMTP client.

Available in Postfix version 3.1 and later:

dns_ncache_ttl_fix_enable (no)

Enable a workaround for future libc incompatibility.

Available in Postfix version 3.4 and later:

postscreen_reject_footer_maps ($smtpd_reject_footer_maps)

Optional lookup table for information that is appended after a 4XX or 5XX postscreen(8) server response.

Available in Postfix 3.6 and later:

respectful_logging (see 'postconf -d' output)

Avoid logging that implies white is better than black.

## TROUBLE SHOOTING CONTROLS

```

```

postscreen_expansion_filter (see 'postconf -d' output)

List of characters that are permitted in postscreen_reject_footer attribute expansions.

postscreen_reject_footer ($smtpd_reject_footer)

Optional information that is appended after a 4XX or 5XX postscreen(8) server response.

soft_bounce (no)

Safety net to keep mail queued that would otherwise be returned to the sender.

## BEFORE-POSTSCREEN PROXY AGENT

```

```

Available in Postfix version 2.10 and later:

postscreen_upstream_proxy_protocol (empty)

The name of the proxy protocol used by an optional before-postscreen proxy agent.

postscreen_upstream_proxy_timeout (5s)

The time limit for the proxy protocol specified with the postscreen_upstream_proxy_protocol parameter.

## PERMANENT ALLOW/DENYLIST TEST

```

```

This test is executed immediately after a remote SMTP client connects. If a client is permanently allowlisted, the client will be handed off immediately to a Postfix SMTP server process.

postscreen_access_list (permit_mynetworks)

Permanent allow/denylist for remote SMTP client IP addresses.

postscreen_blacklist_action (ignore)

Renamed to postscreen_denylist_action in Postfix 3.6.

## MAIL EXCHANGER POLICY TESTS

```

```

When postscreen(8) is configured to monitor all primary and backup MX addresses, it can refuse to allowlist clients that connect to a backup MX address only. For small sites, this requires configuring primary and backup MX addresses on the same MTA. Larger sites would have to share the postscreen(8) cache between primary and backup MTAs, which would introduce a common point of failure.

postscreen_whitelist_interfaces (static:all)

Renamed to postscreen_allowlist_interfaces in Postfix 3.6.

## BEFORE 220 GREETING TESTS

```

```

These tests are executed before the remote SMTP client receives the "220 servername" greeting. If no tests remain after the successful completion of this phase, the client will be handed off immediately to a Postfix SMTP server process.

dnsblog_service_name (dnsblog)

The name of the dnsblog(8) service entry in master.cf.

postscreen_dnsbl_action (ignore)

The action that postscreen(8) takes when a remote SMTP client's combined DNSBL score is equal to or greater than a threshold (as defined with the postscreen_dnsbl_sites and postscreen_dnsbl_threshold parameters).

postscreen_dnsbl_reply_map (empty)

A mapping from actual DNSBL domain name which includes a secret password, to the DNSBL domain name that postscreen will reply with when it rejects mail.

postscreen_dnsbl_sites (empty)

Optional list of DNS allow/denylist domains, filters and weight factors.

postscreen_dnsbl_threshold (1)

The inclusive lower bound for blocking a remote SMTP client, based on its combined DNSBL score as defined with the postscreen_dnsbl_sites parameter.

postscreen_greet_action (ignore)

The action that postscreen(8) takes when a remote SMTP client speaks before its turn within the time specified with the postscreen_greet_wait parameter.

postscreen_greet_banner ($smtpd_banner)

The text in the optional "220-text..." server response that postscreen(8) sends ahead of the real Postfix SMTP server's "220 text..." response, in an attempt to confuse bad SMTP clients so that they speak before their turn (pre-greet).

postscreen_greet_wait (normal: 6s, overload: 2s)

The amount of time that postscreen(8) will wait for an SMTP client to send a command before its turn, and for DNS blocklist lookup results to arrive (default: up to 2 seconds under stress, up to 6 seconds otherwise).

smtpd_service_name (smtpd)

The internal service that postscreen(8) hands off allowed connections to.

Available in Postfix version 2.11 and later:

postscreen_dnsbl_whitelist_threshold (0)

Renamed to postscreen_dnsbl_allowlist_threshold in Postfix 3.6.

Available in Postfix version 3.0 and later:

postscreen_dnsbl_timeout (10s)

The time limit for DNSBL or DNSWL lookups.

Available in Postfix version 3.6 and later:

postscreen_denylist_action (ignore)

The action that postscreen(8) takes when a remote SMTP client is permanently denylisted with the postscreen_access_list parameter.

postscreen_allowlist_interfaces (static:all)

A list of local postscreen(8) server IP addresses where a non-allowlisted remote SMTP client can obtain postscreen(8)'s temporary allowlist status.

postscreen_dnsbl_allowlist_threshold (0)

Allow a remote SMTP client to skip "before" and "after 220 greeting" protocol tests, based on its combined DNSBL score as defined with the postscreen_dnsbl_sites parameter.

## AFTER 220 GREETING TESTS

```

```

These tests are executed after the remote SMTP client receives the "220 servername" greeting. If a client passes all tests during this phase, it will receive a 4XX response to all RCPT TO commands. After the client reconnects, it will be allowed to talk directly to a Postfix SMTP server process.

postscreen_bare_newline_action (ignore)

The action that postscreen(8) takes when a remote SMTP client sends a bare newline character, that is, a newline not preceded by carriage return.

postscreen_bare_newline_enable (no)

Enable "bare newline" SMTP protocol tests in the postscreen(8) server.

postscreen_disable_vrfy_command ($disable_vrfy_command)

Disable the SMTP VRFY command in the postscreen(8) daemon.

postscreen_forbidden_commands ($smtpd_forbidden_commands)

List of commands that the postscreen(8) server considers in violation of the SMTP protocol.

postscreen_helo_required ($smtpd_helo_required)

Require that a remote SMTP client sends HELO or EHLO before commencing a MAIL transaction.

postscreen_non_smtp_command_action (drop)

The action that postscreen(8) takes when a remote SMTP client sends non-SMTP commands as specified with the postscreen_forbidden_commands parameter.

postscreen_non_smtp_command_enable (no)

Enable "non-SMTP command" tests in the postscreen(8) server.

postscreen_pipelining_action (enforce)

The action that postscreen(8) takes when a remote SMTP client sends multiple commands instead of sending one command and waiting for the server to respond.

postscreen_pipelining_enable (no)

Enable "pipelining" SMTP protocol tests in the postscreen(8) server.

## CACHE CONTROLS

```

```

postscreen_cache_cleanup_interval (12h)

The amount of time between postscreen(8) cache cleanup runs.

postscreen_cache_map (btree:$data_directory/postscreen_cache)

Persistent storage for the postscreen(8) server decisions.

postscreen_cache_retention_time (7d)

The amount of time that postscreen(8) will cache an expired temporary allowlist entry before it is removed.

postscreen_bare_newline_ttl (30d)

The amount of time that postscreen(8) will use the result from a successful "bare newline" SMTP protocol test.

postscreen_dnsbl_max_ttl (${postscreen_dnsbl_ttl?{$postscreen_dnsbl_ttl}:{1}}h)

The maximum amount of time that postscreen(8) will use the result from a successful DNS-based reputation test before a client IP address is required to pass that test again.

postscreen_dnsbl_min_ttl (60s)

The minimum amount of time that postscreen(8) will use the result from a successful DNS-based reputation test before a client IP address is required to pass that test again.

postscreen_greet_ttl (1d)

The amount of time that postscreen(8) will use the result from a successful PREGREET test.

postscreen_non_smtp_command_ttl (30d)

The amount of time that postscreen(8) will use the result from a successful "non_smtp_command" SMTP protocol test.

postscreen_pipelining_ttl (30d)

The amount of time that postscreen(8) will use the result from a successful "pipelining" SMTP protocol test.

## RESOURCE CONTROLS

```

```

line_length_limit (2048)

Upon input, long lines are chopped up into pieces of at most this length; upon delivery, long lines are reconstructed.

postscreen_client_connection_count_limit ($smtpd_client_connection_count_limit)

How many simultaneous connections any remote SMTP client is allowed to have with the postscreen(8) daemon.

postscreen_command_count_limit (20)

The limit on the total number of commands per SMTP session for postscreen(8)'s built-in SMTP protocol engine.

postscreen_command_time_limit (normal: 300s, overload: 10s)

The time limit to read an entire command line with postscreen(8)'s built-in SMTP protocol engine.

postscreen_post_queue_limit ($default_process_limit)

The number of clients that can be waiting for service from a real Postfix SMTP server process.

postscreen_pre_queue_limit ($default_process_limit)

The number of non-allowlisted clients that can be waiting for a decision whether they will receive service from a real Postfix SMTP server process.

postscreen_watchdog_timeout (10s)

How much time a postscreen(8) process may take to respond to a remote SMTP client command or to perform a cache operation before it is terminated by a built-in watchdog timer.

## STARTTLS CONTROLS

```

```

postscreen_tls_security_level ($smtpd_tls_security_level)

The SMTP TLS security level for the postscreen(8) server; when a non-empty value is specified, this overrides the obsolete parameters postscreen_use_tls and postscreen_enforce_tls.

tlsproxy_service_name (tlsproxy)

The name of the tlsproxy(8) service entry in master.cf.

## OBSOLETE STARTTLS SUPPORT CONTROLS

```

```

These parameters are supported for compatibility with smtpd(8) legacy parameters.

postscreen_use_tls ($smtpd_use_tls)

Opportunistic TLS: announce STARTTLS support to remote SMTP clients, but do not require that clients use TLS encryption.

postscreen_enforce_tls ($smtpd_enforce_tls)

Mandatory TLS: announce STARTTLS support to remote SMTP clients, and require that clients use TLS encryption.

## MISCELLANEOUS CONTROLS

```

```

config_directory (see 'postconf -d' output)

The default location of the Postfix main.cf and master.cf configuration files.

delay_logging_resolution_limit (2)

The maximal number of digits after the decimal point when logging sub-second delay values.

command_directory (see 'postconf -d' output)

The location of all postfix administrative commands.

max_idle (100s)

The maximum amount of time that an idle Postfix daemon process waits for an incoming connection before terminating voluntarily.

process_id (read-only)

The process ID of a Postfix command or daemon process.

process_name (read-only)

The process name of a Postfix command or daemon process.

syslog_facility (mail)

The syslog facility of Postfix logging.

syslog_name (see 'postconf -d' output)

A prefix that is prepended to the process name in syslog records, so that, for example, "smtpd" becomes "prefix/smtpd".

Available in Postfix 3.3 and later:

service_name (read-only)

The master.cf service name of a Postfix daemon process.

Available in Postfix 3.5 and later:

info_log_address_format (external)

The email address form that will be used in non-debug logging (info, warning, etc.).

## SEE ALSO

```
smtpd(8), Postfix SMTP server
tlsproxy(8), Postfix TLS proxy server
dnsblog(8), DNS allow/denylist logger
postlogd(8), Postfix logging
syslogd(8), system logging
```

## README FILES

```

```

Use "postconf readme_directory" or "postconf html_directory" to locate this information.

```
POSTSCREEN_README, Postfix Postscreen Howto
```

## LICENSE

```

```

The Secure Mailer license must be distributed with this software.

## HISTORY

This service was introduced with Postfix version 2.8.

Many ideas in postscreen(8) were explored in earlier work by Michael Tokarev, in OpenBSD spamd, and in MailChannels Traffic Control.

## AUTHOR(S)

```
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
```


proxymap

title: proxymap(8)

text:
# proxymap(8)

## NAME
proxymap - Postfix lookup table proxy server

## SYNOPSIS

```
proxymap [generic Postfix daemon options]
```

## DESCRIPTION

The proxymap(8) server provides read-only or read-write table lookup service to Postfix processes. These services are implemented with distinct service names: proxymap and proxywrite, respectively. The purpose of these services is:

- To overcome chroot restrictions. For example, a chrooted SMTP server needs access to the system passwd file in order to reject mail for non-existent local addresses, but it is not practical to maintain a copy of the passwd file in the chroot jail. The solution:

```
local_recipient_maps =

    proxy:unix:passwd.byname $alias_maps
```

- To consolidate the number of open lookup tables by sharing one open table among multiple processes. For example, making mysql connections from every Postfix daemon process results in "too many connections" errors. The solution:

```
virtual_alias_maps =

    proxy:mysql:/etc/postfix/virtual_alias.cf
```

The total number of connections is limited by the number of proxymap server processes.

- To provide single-updater functionality for lookup tables that do not reliably support multiple writers (i.e. all file-based tables).

The proxymap(8) server implements the following requests:

open maptype:mapname flags

Open the table with type maptype and name mapname, as controlled by flags. The reply includes the maptype dependent flags (to distinguish a fixed string table from a regular expression table).

lookup maptype:mapname flags key

Look up the data stored under the requested key. The reply is the request completion status code and the lookup result value. The maptype:mapname and flags are the same as with the open request.

update maptype:mapname flags key value

Update the data stored under the requested key. The reply is the request completion status code. The maptype:mapname and flags are the same as with the open request. To implement single-updater maps, specify a process limit of 1 in the master.cf file entry for the proxywrite service.

This request is supported in Postfix 2.5 and later.

delete maptype:mapname flags key

Delete the data stored under the requested key. The reply is the request completion status code. The maptype:mapname and flags are the same as with the open request. This request is supported in Postfix 2.5 and later.

sequence maptype:mapname flags function

Iterate over the specified database. The function is one of DICT_SEQ_FUN_FIRST or DICT_SEQ_FUN_NEXT. The reply is the request completion status code and a lookup key and result value, if found. This request is supported in Postfix 2.9 and later.

The request completion status is one of OK, RETRY, NOKEY (lookup failed because the key was not found), BAD (malformed request) or DENY (the table is not approved for proxy read or update access).

There is no close command, nor are tables implicitly closed when a client disconnects. The purpose is to share tables among multiple client processes.

## SERVER PROCESS MANAGEMENT

```

```

proxymap(8) servers run under control by the Postfix master(8) server. Each server can handle multiple simultaneous connections. When all servers are busy while a client connects, the master(8) creates a new proxymap(8) server process, provided that the process limit is not exceeded. Each server terminates after serving at least $max_use clients or after $max_idle seconds of idle time.

## SECURITY

```

```

The proxymap(8) server opens only tables that are approved via the proxy_read_maps or proxy_write_maps configuration parameters, does not talk to users, and can run at fixed low privilege, chrooted or not. However, running the proxymap server chrooted severely limits usability, because it can open only chrooted tables.

The proxymap(8) server is not a trusted daemon process, and must not be used to look up sensitive information such as UNIX user or group IDs, mailbox file/directory names or external commands.

In Postfix version 2.2 and later, the proxymap client recognizes requests to access a table for security-sensitive purposes, and opens the table directly. This allows the same main.cf setting to be used by sensitive and non-sensitive processes.

Postfix-writable data files should be stored under a dedicated directory that is writable only by the Postfix mail system, such as the Postfix-owned data_directory.

In particular, Postfix-writable files should never exist in root-owned directories. That would open up a particular type of security hole where ownership of a file or directory does not match the provider of its content.

## DIAGNOSTICS

Problems and transactions are logged to syslogd(8) or postlogd(8).

## BUGS

The proxymap(8) server provides service to multiple clients, and must therefore not be used for tables that have high-latency lookups.

The proxymap(8) read-write service does not explicitly close lookup tables (even if it did, this could not be relied on, because the process may be terminated between table updates). The read-write service should therefore not be used with tables that leave persistent storage in an inconsistent state between updates (for example, CDB). Tables that support "sync on update" should be safe (for example, Berkeley DB) as should tables that are implemented by a real DBMS.

## CONFIGURATION PARAMETERS

```

```

On busy mail systems a long time may pass before proxymap(8) relevant changes to main.cf are picked up. 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.

config_directory (see 'postconf -d' output)

The default location of the Postfix main.cf and master.cf configuration files.

data_directory (see 'postconf -d' output)

The directory with Postfix-writable data files (for example: caches, pseudo-random numbers).

daemon_timeout (18000s)

How much time a Postfix daemon process may take to handle a request before it is terminated by a built-in watchdog timer.

ipc_timeout (3600s)

The time limit for sending or receiving information over an internal communication channel.

max_idle (100s)

The maximum amount of time that an idle Postfix daemon process waits for an incoming connection before terminating voluntarily.

max_use (100)

The maximal number of incoming connections that a Postfix daemon process will service before terminating voluntarily.

process_id (read-only)

The process ID of a Postfix command or daemon process.

process_name (read-only)

The process name of a Postfix command or daemon process.

proxy_read_maps (see 'postconf -d' output)

The lookup tables that the proxymap(8) server is allowed to access for the read-only service.

Available in Postfix 2.5 and later:

data_directory (see 'postconf -d' output)

The directory with Postfix-writable data files (for example: caches, pseudo-random numbers).

proxy_write_maps (see 'postconf -d' output)

The lookup tables that the proxymap(8) server is allowed to access for the read-write service.

Available in Postfix 3.3 and later:

service_name (read-only)

The master.cf service name of a Postfix daemon process.

## SEE ALSO

```
postconf(5), configuration parameters
master(5), generic daemon options
```

## README FILES

```

```

Use "postconf readme_directory" or "postconf html_directory" to locate this information.

```
DATABASE_README, Postfix lookup table overview
```

## LICENSE

```

```

The Secure Mailer license must be distributed with this software.

## HISTORY

The proxymap service was introduced with Postfix 2.0.

## AUTHOR(S)

```
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
```