diff --git a/postfix/HISTORY b/postfix/HISTORY index b2f54c9f6..005c7eacb 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -2745,6 +2745,16 @@ Apologies for any names omitted. = canonical, virtual, alias, forward, include" to restore previous behavior. - Feature: command_expansion_filter and forward_expansion_filter - configuration parameters that control what characters may - appear in $name expansions of mailbox_command and forward_path. + Feature: forward_expansion_filter configuration parameter + that controls what characters may appear in $name expansions + of forward_path. + +19990509 + + Feature: command_expansion_filter to control what characters + may appearin message attributes that are exported via + environment variables. + + Cleanup: SMTPD reject messages are more informative, and + more complete sender/recipient information is logged for + the local sysadmin. diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 3c0413232..00f110894 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -1,4 +1,4 @@ -Incompatible changes with snapshot-19990504: +Incompatible changes with snapshot-19990509: =========================================== - The Postfix local delivery agent no longer automatically propagates @@ -6,39 +6,41 @@ the address extension to aliases/include/forward addresses. Specify "propagate_unmatched_extensions = canonical, virtual, alias, forward, include" to restore the old behavior. -- The luser_relay syntax has changed. You can specify one address, -and it is subjected to $user, etc. expansions. See conf/main.cf. - -- The mailbox_command parameter is now subjected to $name expansion -(see below). This means that you can no longer use shell variables -in mailbox_command, or that you have to use $$ instead of $. +- The luser_relay syntax has changed. You can specify one address; +it is subjected to $user, etc. expansions. See conf/main.cf. - File system reorganization: daemon executables are in the libexec subdirectory, command executables in the bin subdirectory. The INSTALL instructions now recommend installing daemons and commands into separate directories. -Major changes with snapshot-19990504: +Major changes with snapshot-19990509: ===================================== In addition to several little bugfixes, none related to security, lots of internal code cleanup, lots of new functionality, and lots of Solaris workarounds. +- New USER, EXTENSION and DOMAIN environment variables for delivery +to command by the local delivery agent. As you might expect, the +information is censored. The list of acceptable characters is +specified with the command_expansion_filter configuration parameter. +Unacceptable characters are replaced by underscores. + - Specify "forward_path = /var/forward/$user" to avoid looking up .forward files in user home directories. The default value is $home/.forward$recipient_delimiter$extension, $home/.forward. Initial code by Philip A. Prindeville, Mirapoint, Inc., USA. -- Conditional $name expansion in forward_path, mailbox_command, -and luser_relay. Available names are: $user (bare user name) $shell -(user login shell), $home (user home directory), $recipient -(everything to the left of @), $extension (optional address -extension), $domain (everything to the right of @), and -$recipient_delimiter. A simple $name expands as usual. ${name?value} -expands to value when $name is defined. ${name:value} expands to -value when $name is not defined. With ${name?value} and ${name:value}, -the value is subject to another iteration of $name expansion. +- Conditional $name expansion in forward_path and luser_relay. +Available names are: $user (bare user name) $shell (user login +shell), $home (user home directory), $recipient (everything to the +left of @), $extension (optional address extension), $domain +(everything to the right of @), and $recipient_delimiter. A simple +$name expands as usual. ${name?value} expands to value when $name +is defined. ${name:value} expands to value when $name is not +defined. With ${name?value} and ${name:value}, the value is subject +to another iteration of $name expansion. - POSIX regular expression support, enabled by default on 4.4BSD, LINUX, HP-UX, and Solaris 2.5 and later. See conf/sample-regexp.cf. diff --git a/postfix/conf/main.cf.default b/postfix/conf/main.cf.default index 102876586..c0a62a28e 100644 --- a/postfix/conf/main.cf.default +++ b/postfix/conf/main.cf.default @@ -63,7 +63,7 @@ luser_relay = mail_name = Postfix mail_owner = postfix mail_spool_directory = /var/mail -mail_version = Snapshot-19990508 +mail_version = Snapshot-19990509 mailbox_command = mailbox_transport = maps_rbl_domains = rbl.maps.vix.com diff --git a/postfix/global/mail_params.h b/postfix/global/mail_params.h index a6650583d..a51fc0e17 100644 --- a/postfix/global/mail_params.h +++ b/postfix/global/mail_params.h @@ -340,13 +340,13 @@ extern char *var_rcpt_delim; #define DEF_CMD_EXP_FILTER "1234567890!@%-_=+:,./\ abcdefghijklmnopqrstuvwxyz\ ABCDEFGHIJKLMNOPQRSTUVWXYZ" -extern char *var_cmd_exp_filter;; +extern char *var_cmd_exp_filter; #define VAR_FWD_EXP_FILTER "forward_expansion_filter" #define DEF_FWD_EXP_FILTER "1234567890!@%-_=+:,./\ abcdefghijklmnopqrstuvwxyz\ ABCDEFGHIJKLMNOPQRSTUVWXYZ" -extern char *var_fwd_exp_filter;; +extern char *var_fwd_exp_filter; #define VAR_RCPT_FDELIM "recipient_feature_delimiter" #define DEF_RCPT_FDELIM "" diff --git a/postfix/global/mail_version.h b/postfix/global/mail_version.h index 540f9a01f..f52bb08cb 100644 --- a/postfix/global/mail_version.h +++ b/postfix/global/mail_version.h @@ -15,7 +15,7 @@ * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" -#define DEF_MAIL_VERSION "Snapshot-19990508" +#define DEF_MAIL_VERSION "Snapshot-19990509" extern char *var_mail_version; /* LICENSE diff --git a/postfix/html/faq.html b/postfix/html/faq.html index aabe60783..9070ba017 100644 --- a/postfix/html/faq.html +++ b/postfix/html/faq.html @@ -395,9 +395,41 @@ and /usr/lib/Mail.rc). With mailing lists, Delivered-To: can get in the way when the list exploder uses a "secret" alias that should not be shown -in outbound mail. In order to tackle this, look up the FEATURE -CONTROL section in the documentation of the local delivery agent. +in outbound mail. The recommended solution is to use a regular +expression-based filter at the SMTP port: + +
+ +
+ +
+ +POSIX regular expression support (regexp) is enabled by default on +modern UNIX systems. Perl-compatible regular expression support +(pcre) is optional; see the PCRE_README file in the top-level +Postfix source directory.
diff --git a/postfix/html/goals.html b/postfix/html/goals.html index 1b8436d52..5dbe2000a 100644 --- a/postfix/html/goals.html +++ b/postfix/html/goals.html @@ -76,8 +76,9 @@ is no direct path from the network to the security-sensitive local delivery programs - an intruder has to break through several other programs first. Postfix does not even trust the contents of its own queue files, or the contents of its own IPC messages. Postfix -avoids placing sender-provided information into shell environment -variables. Last but not least, no Postfix program is set-uid. +filters sender-provided information before exporting it via +environment variables. Last but not least, no Postfix program is +set-uid. diff --git a/postfix/html/local.8.html b/postfix/html/local.8.html index 099d80630..99a318052 100644 --- a/postfix/html/local.8.html +++ b/postfix/html/local.8.html @@ -111,20 +111,20 @@ LOCAL(8) LOCAL(8) ter. The command executes with the privileges of the recipient user (exception: in case of delivery as root, the command executes with the privileges of - default_privs). The command is subject to interpolation - of $user (recipient username), $home (recipient home - directory), $shell (recipient shell), $recipient (complete - recipient address), $extension (recipient address exten- - sion), $domain (recipient domain), mailbox (entire recipi- - ent address localpart) and $recipient_delimiter. The forms - ${name?value} and ${name:value} expand conditionally to - value when $name is (is not) defined. In the result of - name expansion, characters that have special meaning to - the shell are replaced by underscores. The list of legal - characters is specified with the command_expansion_filter - configuration parameter. + default_privs). - Mailbox delivery can be delegated to alternative message + Mailbox delivery can be delegated to alternative message + transports specified in the master.cf file. The mail- + box_transport configuration parameter specifies a 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 parameter specifies a + message transport for recipients that are not found in the + UNIX passwd database. + + In the case of UNIX-style mailbox delivery, the local dae- + mon prepends a "From sender time_stamp" envelope header to + each message, prepends a Delivered-To: header with the @@ -137,60 +137,60 @@ LOCAL(8) LOCAL(8) LOCAL(8) LOCAL(8) - transports specified in the master.cf file. The mail- - box_transport configuration parameter specifies a 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 parameter specifies a - message transport for recipients that are not found in the - UNIX passwd database. - - In the case of UNIX-style mailbox delivery, the local dae- - mon prepends a "From sender time_stamp" envelope header to - each message, prepends a Delivered-To: header with the 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 + 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 a Delivered-To: header with the envelope recipient address - and prepends a Return-Path: header with the envelope + 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 set- - ting (alias, forward) forbids command destinations in + The allow_mail_to_commands configuration parameter + restricts delivery to external commands. The default set- + ting (alias, forward) forbids command destinations in :include: files. - The command is executed directly where possible. Assis- - tance by the shell (/bin/sh on UNIX systems) is used only - when the command contains shell magic characters, or when + The command is executed directly where possible. Assis- + tance 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-deliv- - ery 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 con- + A limited amount of command output (standard output and + standard error) is captured for inclusion with non-deliv- + ery 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 con- ventions defined in <sysexits.h>. - When mail is delivered on behalf of a user, the HOME, LOG- - NAME, and SHELL environment variables are set accordingly. + A limited amount of message context is exported via envi- + ronment variables. Characters that may have special mean- + ing to the shell are replaced by underscores. The list of + acceptable characters is specified with the command_expan- + sion_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. + The PATH environment variable is always reset to a system- dependent default path, and the TZ (time zone) environment variable is always passed on without change. - The current working directory is the mail queue directory. - - The local daemon prepends a "From sender time_stamp" enve- - lope header to each message, prepends a Delivered-To: - header with the recipient envelope address, prepends a - Return-Path: header with the sender envelope address, and - appends an empty line. @@ -203,60 +203,60 @@ LOCAL(8) LOCAL(8) LOCAL(8) LOCAL(8) + The current working directory is the mail queue directory. + + The local daemon prepends a "From sender time_stamp" enve- + lope header to each message, prepends a Delivered-To: + header with the recipient envelope address, prepends a + Return-Path: header with the sender envelope address, and + appends an empty line. + EXTERNAL FILE DELIVERY - The allow_mail_to_files configuration parameter restricts - delivery to external files. The default setting (alias, - forward) forbids file destinations in :include: files. + The allow_mail_to_files configuration parameter restricts + delivery to external files. The default setting (alias, + forward) forbids file destinations in :include: files. Specify a pathname ending in / for qmail-compatible maildir delivery. The local daemon prepends a "From sender time_stamp" enve- - lope header to each message, prepends a Delivered-To: - header with the 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 regu- + lope header to each message, prepends a Delivered-To: + header with the 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 regu- lar 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 - a Delivered-To: header with the envelope recipient - address. The envelope sender address is available in the + a Delivered-To: header with the envelope recipient + address. 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 + 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/.for- + 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/.for- ward+foo or in ~name/.forward, to the mailbox owned by the user name, or it is sent back as undeliverable. - In all cases the local daemon prepends a `Delivered-To: + In all cases the local daemon prepends a `Delivered-To: name+foo' header line. DELIVERY RIGHTS - Deliveries to external files and external commands are + 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 daemon uses the owner rights of the :include: + the delivery is made. In the absence of a user context, + the local 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) -DIAGNOSTICS - Problems and transactions are logged to syslogd(8). Cor- - rupted 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, @@ -269,24 +269,33 @@ LOCAL(8) LOCAL(8) LOCAL(8) LOCAL(8) - the postmaster is notified of bounces and of other trou- +STANDARDS + RFC 822 (ARPA Internet Text Messages) + +DIAGNOSTICS + Problems and transactions are logged to syslogd(8). Cor- + rupted 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 trou- ble. BUGS - For security reasons, the message delivery status of - external commands or of external files is never check- + For security reasons, the message delivery status of + external commands or of external files is never check- pointed to file. As a result, the program may occasionally deliver more than once to a command or external file. Bet- ter safe than sorry. - Mutually-recursive aliases or ~/.forward files are not - detected early. The resulting mail forwarding loop is + 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 - The following main.cf parameters are especially relevant - to this program. See the Postfix main.cf file for syntax - details and for default values. Use the postfix reload + The following main.cf parameters are especially relevant + to this program. See the Postfix main.cf file for syntax + details and for default values. Use the postfix reload command after a configuration change. Miscellaneous @@ -298,10 +307,10 @@ LOCAL(8) LOCAL(8) ject to $name expansion. local_command_shell - Shell to use for external command execution (for - example, /some/where/smrsh -c). When a shell is + Shell to use for external command execution (for + example, /some/where/smrsh -c). When a shell is specified, it is invoked even when the command con- - tains no shell built-in commands or meta charac- + tains no shell built-in commands or meta charac- ters. owner_request_special @@ -314,15 +323,6 @@ LOCAL(8) LOCAL(8) Mailbox delivery fallback_transport Message transport for recipients that are not found - in the UNIX passwd database. This parameter over- - rides luser_relay. - - home_mailbox - Pathname of a mailbox relative to a user's home - directory. Specify a path ending in / for maildir- - style delivery. - - @@ -335,35 +335,43 @@ LOCAL(8) LOCAL(8) LOCAL(8) LOCAL(8) + in the UNIX passwd database. This parameter over- + rides luser_relay. + + home_mailbox + Pathname of a mailbox relative to a user's home + directory. Specify a path ending in / for maildir- + style delivery. + luser_relay - Destination (@domain or address) for non-existent - users. The address is subjected to $name expan- + Destination (@domain or address) for non-existent + users. The address is subjected to $name expan- sion. mail_spool_directory - Directory with UNIX-style mailboxes. The default + Directory with UNIX-style mailboxes. The default pathname is system dependent. mailbox_command - External command to use for mailbox delivery. The + External command to use for mailbox delivery. The command executes with the recipient privileges - (exception: root). The string is subject to $name + (exception: root). The string is subject to $name expansions. mailbox_transport - Message transport to use for mailbox delivery to + Message transport to use for mailbox delivery to all local recipients, whether or not they are found - in the UNIX passwd database. This parameter over- - rides all other configuration parameters that con- + in the UNIX passwd database. This parameter over- + rides all other configuration parameters that con- trol mailbox delivery, including luser_relay. Locking controls deliver_lock_attempts - Limit the number of attempts to acquire an exclu- + Limit the number of attempts to acquire an exclu- sive lock on a mailbox or external file. deliver_lock_delay - Time in seconds between successive attempts to + Time in seconds between successive attempts to acquire an exclusive lock. stale_lock_time @@ -371,25 +379,17 @@ LOCAL(8) LOCAL(8) Resource controls command_time_limit - Limit the amount of time for delivery to external + Limit the amount of time for delivery to external command. duplicate_filter_limit - Limit the size of the duplicate filter for results + Limit the size of the duplicate filter for results from alias etc. expansion. line_length_limit - Limit the amount of memory used for processing a + Limit the amount of memory used for processing a partial input line. - local_destination_concurrency_limit - Limit the number of parallel deliveries to the same - user. The default limit is taken from the - default_destination_concurrency_limit parameter. - - local_destination_recipient_limit - Limit the number of recipients per message - 6 @@ -401,37 +401,44 @@ LOCAL(8) LOCAL(8) LOCAL(8) LOCAL(8) - delivery. The default limit is taken from the + local_destination_concurrency_limit + Limit the number of parallel deliveries to the same + user. The default limit is taken from the + default_destination_concurrency_limit parameter. + + local_destination_recipient_limit + Limit the number of recipients per message deliv- + ery. The default limit is taken from the default_destination_recipient_limit parameter. Security controls allow_mail_to_commands - Restrict the usage of mail delivery to external + Restrict the usage of mail delivery to external command. allow_mail_to_files - Restrict the usage of mail delivery to external + Restrict the usage of mail delivery to external file. command_expansion_filter - What characters are allowed to appear in $name - expansions of mailbox_command. Illegal characters + What characters are allowed to appear in $name + expansions of mailbox_command. Illegal characters are replaced by underscores. default_privs - Default rights for delivery to external file or + Default rights for delivery to external file or command. forward_expansion_filter - What characters are allowed to appear in $name - expansions of forward_path. Illegal characters are + What characters are allowed to appear in $name + expansions of forward_path. Illegal characters are replaced by underscores. HISTORY - The Delivered-To: header appears in the qmail system by + The Delivered-To: header appears in the qmail system by Daniel Bernstein. - The maildir structure appears in the qmail system by + The maildir structure appears in the qmail system by Daniel Bernstein. SEE ALSO @@ -442,12 +449,24 @@ LOCAL(8) LOCAL(8) qmgr(8) queue manager LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) Wietse Venema IBM T.J. Watson Research + + + + 7 + + + + + +LOCAL(8) LOCAL(8) + + P.O. Box 704 Yorktown Heights, NY 10598, USA @@ -458,7 +477,54 @@ LOCAL(8) LOCAL(8) - 7 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 8