Local delivery

Local delivery is what Postfix does when it reaches the end of all of its list of mappings and access controls, and still finds that the message is allowed and destined for a user on the local machine (i.e., a mapping could potentially send the message elsewhere for final delivery, so all mappings as well as various access checks are performed before reaching this stage). This page configures a number of options relating to how Postfix handles the delivery of mail for local users (Figure 10-5).

click to expand
Figure 10-5: Local Delivery

Name of the transport for local deliveries

This configures the name of the transport that will be used for delivery to destination that match the $mydestination or $inet_interfaces variables. This can be a simple mailbox drop handled by the Postfix local delivery agent, or any appropriate delivery command. This option correlates to the local_transport directive and defaults to the defined transport type named local.

Shell to use for delivery to external command

If a command shell is required to communicate properly with your chosen local delivery transport, this option selects the shell that will be used. By default no shell is used, and the transport command will be executed directly. However, if the command contains shell meta-characters or shell built-in commands they will be passed to /bin/sh or whatever shell you configure here. A popular choice for this is smrsh, or Sendmail's Restricted Shell, which is included in recent Sendmail distributions. smrsh allows for more precise control over what commands users can execute from their .forward files. This option corresponds to the local_command_shell and defaults to /bin/sh.

Search list for forward

This is a comma-separated list of possible locations for user forward files. Postfix will try each entry in the list until a forward file is found or until all have been checked and no match is found. The forward file allows users to configure delivery options for themselves, including delivery-time processing by a program like procmail, as well as forwarding of messages to a different server. A number of variable expansions are performed on the entries. The expansions are currently:

Forward Search Path Variable Expansions

Entries in forward files can make use of the following variables:

$user

The username of the recipient.

$shell

The shell of the recipient.

$home

Recipient's home directory.

$recipient

The full recipient address.

$extensions

Recipient address extensions. This is a separate part of the email address, separated by the Separator between user names and address extensions defined on the General Options page.

$domain

The recipient's domain name.

$local

The entire local part of the recipient address. $recipient_delimiter The separation delimiter for the recipient.

Valid mail delivery to external commands

This parameter restricts mail delivery to only those commands specified here. The default is to disallow delivery to commands specified in :include: files and allow execution of commands in alias and forward files. This option correlates to the allow_mail_to_command directive.

Valid mail delivery to external files

This option restricts mail delivery to external files. The default is to disallow delivery to files specified in :include: but to allow delivery to files specified in aliases and forward files. This option correlates to the allow_mail_to_files directive.

Default rights of the local delivery agent

This option configures the privileges that the delivery agent will have for delivery to a file or a command. This option should never be a privileged user or the Postfix owner. This option corresponds to the default_privs directive and defaults to nobody.

Pathname of user mailbox file

When delivering mail locally, Postfix will drop mail in the directory configured here or in its default mail spool directory. If you wish to use the maildir format for mail storage, this value can be appended with a trailing slash. For example, to store mail in the user's home directory in the Maildir subdirectory, the value would be Maildir/. This option correlates to the home_mailbox directive and usually defaults to some location under /var/spool/mail or /var/spool/postfix.

Destination address for unknown recipients

If a message is received for a recipient that does not exist, the message is normally bounced. However, it is possible to instead have the message delivered to an alternate address. This option corresponds to the luser_relay directive. Variable expansions matching those discussed for the Search list for forward are also valid for this directive.

Spool directory

This option specifies the directory where UNIX-style mailboxes are stored. Defaults vary depending on OS variant and version, but a common choice is /var/ spool/mail. This option correlates to the mail_spool_directory option.

External command to use instead of mailbox delivery

This option defines a command to use for delivery instead of delivering straight to the user's mailbox. The command will be run as the recipient of the message with appropriate HOME, SHELL, and LOGNAME environment variables set. This option is commonly used to set up system-wide usage of procmail. Beware that if you use a command to deliver mail to all users, you must configure an alias for root, as the command will be executed with the permissions of the $default_user. This option correlates to the mailbox_command directive and is disabled by default.

Optional actual transport to use

This option configures the message transport to use for all local users, whether they are in the UNIX passwd database or not. If provided, the value will override all other forms of local delivery, including Destination address for unknown recipients. This option corresponds to the mailbox_transport directive and is disabled by default. This option may be useful in some environments, for example, to delegate all delivery to an agent like the cyrus IMAPD.

Optional transport for unknown recipients

If a user cannot be found in the UNIX passwd database, and no alias matches the name, the message will ordinarily be bounced or handled via the Destination address for unknown recipients option. However, if you would like unknown users to be handled by a separate transport method, this option overrides the Destination address for unknown recipients option above. This option correlates to the fallback_transport directive and is disabled by default.

Max number of parallel deliveries to the same local recipient

This option limits the number of simultaneous deliveries to a single local recipient. If .forward files are allowed for users, a user may run a time-consuming command or shell script, leading to overload caused by several such processes being started up at once. This option correlates to the local_destination_concurrency_limit directive, and the default is 2. A low value is recommended for this option, unless it is certain that no complex .forward files will be in use.

Max number of recipients per local message delivery

This option configures the maximum number of recipients per local message delivery. This option correlates to the local_destination_recipient_limit and is set to the value of Max number of recipients per message delivery by default.

Prepend a Delivered-To: when . . .

This parameter determines when Postfix should insert a Delivered-to: message header. By default Postfix inserts this header when forwarding mail and when delivering to a file. The defaults are recommended, and it is generally preferable not to disable insertion into forwarded mail. This option corresponds to the prepend_delivered_header directive.



The Book of Webmin... or How I Learned to Stop Worrying and Love UNIX
The Book of Webmin: Or How I Learned to Stop Worrying and Love UNIX
ISBN: 1886411921
EAN: 2147483647
Year: 2006
Pages: 142
Authors: Joe Cooper

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net