From e6fad12921326ac84cfc0438d746fd11c47d88b8 Mon Sep 17 00:00:00 2001
From: Wietse Venema
Postfix does not record the client's SASL authentication -information in message headers, and does not pass it on via SMTP -commands when forwarding mail, because it is no-one else's business -to know the client username and authentication method. People who -need to know can find the information in the local Postfix maillog -file. Some day, Postfix message headers will be configurable and -then one can record the SASL username without having to edit C -code.
-This document covers the following topics:
To report SASL login names in Received: message headers +(Postfix version 2.3 and later):
+ +++ ++/etc/postfix/main.cf: + smtpd_sasl_authenticated_header = yes ++
Note: the SASL login names will be shared with the entire world. +
+In /usr/local/lib/sasl/smtpd.conf (SASL version 1.5.5) or /usr/local/lib/sasl2/smtpd.conf (SASL version 2.1.1) you need to specify how the server should validate client passwords.
diff --git a/postfix/html/SMTPD_POLICY_README.html b/postfix/html/SMTPD_POLICY_README.html index 18d5bc225..df8f3ccd6 100644 --- a/postfix/html/SMTPD_POLICY_README.html +++ b/postfix/html/SMTPD_POLICY_README.html @@ -374,8 +374,9 @@ inet:127.0.0.1:9998".It is relatively safe to turn on greylisting for specific -domains that often appear in forged email. A list of frequently -forged MAIL FROM domains can be found at +domains that often appear in forged email. At some point +in cyberspace/time a list of frequently +forged MAIL FROM domains could be found at http://www.monkeys.com/anti-spam/filtering/sender-domain-validate.in.
diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index e3803a1d9..868399d67 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -8261,6 +8261,17 @@ See the SASL_README file for SASL configuration a + + ++- smtpd_sasl_authenticated_header +(default: no)
- + +
Report the SASL authenticated user name in the smtpd(8) Received +message header.
+ +This feature is available in Postfix 2.3 and later.
+ +- smtpd_sasl_exceptions_networks diff --git a/postfix/html/smtpd.8.html b/postfix/html/smtpd.8.html index 358c99562..2045e1a49 100644 --- a/postfix/html/smtpd.8.html +++ b/postfix/html/smtpd.8.html @@ -227,99 +227,105 @@ SMTPD(8) SMTPD(8) What SMTP clients Postfix will not offer AUTH sup- port to. + Available in Postfix version 2.3 and later: + + smtpd_sasl_authenticated_header (no) + Report the SASL authenticated user name in the + smtpd(8) Received message header. + STARTTLS SUPPORT CONTROLS - Detailed information about STARTTLS configuration may be + Detailed information about STARTTLS configuration may be found in the TLS_README document. smtpd_use_tls (no) - Opportunistic mode: announce STARTTLS support to - SMTP clients, but do not require that clients use + Opportunistic mode: announce STARTTLS support to + SMTP clients, but do not require that clients use TLS encryption. smtpd_enforce_tls (no) Enforcement mode: announce STARTTLS support to SMTP - clients, and require that clients use TLS encryp- + clients, and require that clients use TLS encryp- tion. smtpd_sasl_tls_security_options ($smtpd_sasl_secu- rity_options) - The SASL authentication security options that the - Postfix SMTP server uses for TLS encrypted SMTP + The SASL authentication security options that the + Postfix SMTP server uses for TLS encrypted SMTP sessions. smtpd_starttls_timeout (300s) - The time limit for Postfix SMTP server write and - read operations during TLS startup and shutdown + The time limit for Postfix SMTP server write and + read operations during TLS startup and shutdown handshake procedures. smtpd_tls_CAfile (empty) - The file with the certificate of the certification - authority (CA) that issued the Postfix SMTP server + The file with the certificate of the certification + authority (CA) that issued the Postfix SMTP server certificate. smtpd_tls_CAfile (empty) - The file with the certificate of the certification - authority (CA) that issued the Postfix SMTP server + The file with the certificate of the certification + authority (CA) that issued the Postfix SMTP server certificate. smtpd_tls_ask_ccert (no) - Ask a remote SMTP client for a client certificate. + Ask a remote SMTP client for a client certificate. smtpd_tls_auth_only (no) When TLS encryption is optional in the Postfix SMTP - server, do not announce or accept SASL authentica- + server, do not announce or accept SASL authentica- tion over unencrypted connections. smtpd_tls_ccert_verifydepth (5) - The verification depth for remote SMTP client cer- + The verification depth for remote SMTP client cer- tificates. smtpd_tls_cert_file (empty) - File with the Postfix SMTP server RSA certificate + File with the Postfix SMTP server RSA certificate in PEM format. smtpd_tls_cipherlist (empty) - Controls the Postfix SMTP server TLS cipher selec- + Controls the Postfix SMTP server TLS cipher selec- tion scheme. smtpd_tls_dcert_file (empty) - File with the Postfix SMTP server DSA certificate + File with the Postfix SMTP server DSA certificate in PEM format. smtpd_tls_dh1024_param_file (empty) - File with DH parameters that the Postfix SMTP - server should use with EDH ciphers. - - smtpd_tls_dh512_param_file (empty) File with DH parameters that the Postfix SMTP server should use with EDH ciphers. + smtpd_tls_dh512_param_file (empty) + File with DH parameters that the Postfix SMTP + server should use with EDH ciphers. + smtpd_tls_dkey_file ($smtpd_tls_dcert_file) - File with the Postfix SMTP server DSA private key + File with the Postfix SMTP server DSA private key in PEM format. smtpd_tls_key_file ($smtpd_tls_cert_file) - File with the Postfix SMTP server RSA private key + File with the Postfix SMTP server RSA private key in PEM format. smtpd_tls_loglevel (0) - Enable additional Postfix SMTP server logging of + Enable additional Postfix SMTP server logging of TLS activity. smtpd_tls_received_header (no) Request that the Postfix SMTP server produces Received: message headers that include information - about the protocol and cipher used, as well as the - client CommonName and client certificate issuer + about the protocol and cipher used, as well as the + client CommonName and client certificate issuer CommonName. smtpd_tls_req_ccert (no) - When TLS encryption is enforced, require a remote - SMTP client certificate in order to allow TLS con- + When TLS encryption is enforced, require a remote + SMTP client certificate in order to allow TLS con- nections to proceed. smtpd_tls_session_cache_database (empty) - Name of the file containing the optional Postfix + Name of the file containing the optional Postfix SMTP server TLS session cache. smtpd_tls_session_cache_timeout (3600s) @@ -327,70 +333,70 @@ SMTPD(8) SMTPD(8) sion cache information. smtpd_tls_wrappermode (no) - Run the Postfix SMTP server in the non-standard - "wrapper" mode, instead of using the STARTTLS com- + Run the Postfix SMTP server in the non-standard + "wrapper" mode, instead of using the STARTTLS com- mand. tls_daemon_random_bytes (32) - The number of pseudo-random bytes that an smtp(8) - or smtpd(8) process requests from the tlsmgr(8) - server in order to seed its internal pseudo random + The number of pseudo-random bytes that an smtp(8) + or smtpd(8) process requests from the tlsmgr(8) + server in order to seed its internal pseudo random number generator (PRNG). VERP SUPPORT CONTROLS - With VERP style delivery, each recipient of a message + With VERP style delivery, each recipient of a message receives a customized copy of the message with his/her own - recipient address encoded in the envelope sender address. + recipient address encoded in the envelope sender address. The VERP_README file describes configuration and operation - details of Postfix support for variable envelope return + details of Postfix support for variable envelope return path addresses. VERP style delivery is requested with the - SMTP XVERP command or with the "sendmail -V" command-line - option and is available in Postfix version 1.1 and later. + SMTP XVERP command or with the "sendmail -V" command-line + option and is available in Postfix version 1.1 and later. default_verp_delimiters (+=) The two default VERP delimiter characters. verp_delimiter_filter (-=+) - The characters Postfix accepts as VERP delimiter - characters on the Postfix sendmail(1) command line + The characters Postfix accepts as VERP delimiter + characters on the Postfix sendmail(1) command line and in SMTP commands. Available in Postfix version 1.1 and 2.0: authorized_verp_clients ($mynetworks) - What SMTP clients are allowed to specify the XVERP + What SMTP clients are allowed to specify the XVERP command. Available in Postfix version 2.1 and later: smtpd_authorized_verp_clients ($authorized_verp_clients) - What SMTP clients are allowed to specify the XVERP + What SMTP clients are allowed to specify the XVERP command. TROUBLE SHOOTING CONTROLS - The DEBUG_README document describes how to debug parts of - the Postfix mail system. The methods vary from making the - software log a lot of detail, to running some daemon pro- + The DEBUG_README document describes how to debug parts of + the Postfix mail system. The methods vary from making the + software log a lot of detail, to running some daemon pro- cesses under control of a call tracer or debugger. debug_peer_level (2) - The increment in verbose logging level when a - remote client or server matches a pattern in the + The increment in verbose logging level when a + remote client or server matches a pattern in the debug_peer_list parameter. debug_peer_list (empty) - Optional list of remote client or server hostname - or network address patterns that cause the verbose - logging level to increase by the amount specified + Optional list of remote client or server hostname + or network address patterns that cause the verbose + logging level to increase by the amount specified in $debug_peer_level. error_notice_recipient (postmaster) - The recipient of postmaster notifications about - mail delivery problems that are caused by policy, + The recipient of postmaster notifications about + mail delivery problems that are caused by policy, resource, software or protocol errors. notify_classes (resource, software) - The list of error classes that are reported to the + The list of error classes that are reported to the postmaster. soft_bounce (no) @@ -400,22 +406,22 @@ SMTPD(8) SMTPD(8) Available in Postfix version 2.1 and later: smtpd_authorized_xclient_hosts (empty) - What SMTP clients are allowed to use the XCLIENT + What SMTP clients are allowed to use the XCLIENT feature. KNOWN VERSUS UNKNOWN RECIPIENT CONTROLS - As of Postfix version 2.0, the SMTP server rejects mail - for unknown recipients. This prevents the mail queue from - clogging up with undeliverable MAILER-DAEMON messages. - Additional information on this topic is in the + As of Postfix version 2.0, the SMTP server rejects mail + for unknown recipients. This prevents the mail queue from + clogging up with undeliverable MAILER-DAEMON messages. + Additional information on this topic is in the LOCAL_RECIPIENT_README and ADDRESS_CLASS_README documents. show_user_unknown_table_name (yes) - Display the name of the recipient table in the + Display the name of the recipient table in the "User unknown" responses. canonical_maps (empty) - Optional address mapping lookup tables for message + Optional address mapping lookup tables for message headers and envelopes. recipient_canonical_maps (empty) @@ -426,7 +432,7 @@ SMTPD(8) SMTPD(8) mydestination ($myhostname, localhost.$mydomain, local- host) - The list of domains that are delivered via the + The list of domains that are delivered via the $local_transport mail delivery transport. inet_interfaces (all) @@ -435,188 +441,188 @@ SMTPD(8) SMTPD(8) proxy_interfaces (empty) The network interface addresses that this mail sys- - tem receives mail on by way of a proxy or network + tem receives mail on by way of a proxy or network address translation unit. inet_protocols (ipv4) - The Internet protocols Postfix will attempt to use + The Internet protocols Postfix will attempt to use when making or accepting connections. local_recipient_maps (proxy:unix:passwd.byname $alias_maps) - Lookup tables with all names or addresses of local - recipients: a recipient address is local when its - domain matches $mydestination, $inet_interfaces or + Lookup tables with all names or addresses of local + recipients: a recipient address is local when its + domain matches $mydestination, $inet_interfaces or $proxy_interfaces. unknown_local_recipient_reject_code (550) - The numerical Postfix SMTP server response code - when a recipient address is local, and - $local_recipient_maps specifies a list of lookup + The numerical Postfix SMTP server response code + when a recipient address is local, and + $local_recipient_maps specifies a list of lookup tables that does not match the recipient. - Parameters concerning known/unknown recipients of relay + Parameters concerning known/unknown recipients of relay destinations: relay_domains ($mydestination) - What destination domains (and subdomains thereof) + What destination domains (and subdomains thereof) this system will relay mail to. relay_recipient_maps (empty) - Optional lookup tables with all valid addresses in + Optional lookup tables with all valid addresses in the domains that match $relay_domains. unknown_relay_recipient_reject_code (550) The numerical Postfix SMTP server reply code when a - recipient address matches $relay_domains, and - relay_recipient_maps specifies a list of lookup + recipient address matches $relay_domains, and + relay_recipient_maps specifies a list of lookup tables that does not match the recipient address. - Parameters concerning known/unknown recipients in virtual + Parameters concerning known/unknown recipients in virtual alias domains: virtual_alias_domains ($virtual_alias_maps) Postfix is final destination for the specified list - of virtual alias domains, that is, domains for - which all addresses are aliased to addresses in + of virtual alias domains, that is, domains for + which all addresses are aliased to addresses in other local or remote domains. virtual_alias_maps ($virtual_maps) - Optional lookup tables that alias specific mail - addresses or domains to other local or remote + Optional lookup tables that alias specific mail + addresses or domains to other local or remote address. unknown_virtual_alias_reject_code (550) The SMTP server reply code when a recipient address - matches $virtual_alias_domains, and $vir- - tual_alias_maps specifies a list of lookup tables + matches $virtual_alias_domains, and $vir- + tual_alias_maps specifies a list of lookup tables that does not match the recipient address. - Parameters concerning known/unknown recipients in virtual + Parameters concerning known/unknown recipients in virtual mailbox domains: virtual_mailbox_domains ($virtual_mailbox_maps) Postfix is final destination for the specified list - of domains; mail is delivered via the $vir- + of domains; mail is delivered via the $vir- tual_transport mail delivery transport. virtual_mailbox_maps (empty) - Optional lookup tables with all valid addresses in + Optional lookup tables with all valid addresses in the domains that match $virtual_mailbox_domains. unknown_virtual_mailbox_reject_code (550) The SMTP server reply code when a recipient address - matches $virtual_mailbox_domains, and $vir- + matches $virtual_mailbox_domains, and $vir- tual_mailbox_maps specifies a list of lookup tables that does not match the recipient address. RESOURCE AND RATE CONTROLS - The following parameters limit resource usage by the SMTP + The following parameters limit resource usage by the SMTP server and/or control client request rates. line_length_limit (2048) - Upon input, long lines are chopped up into pieces - of at most this length; upon delivery, long lines + Upon input, long lines are chopped up into pieces + of at most this length; upon delivery, long lines are reconstructed. queue_minfree (0) - The minimal amount of free space in bytes in the + The minimal amount of free space in bytes in the queue file system that is needed to receive mail. message_size_limit (10240000) - The maximal size in bytes of a message, including + The maximal size in bytes of a message, including envelope information. smtpd_recipient_limit (1000) - The maximal number of recipients that the Postfix + The maximal number of recipients that the Postfix SMTP server accepts per message delivery request. smtpd_timeout (300s) - The time limit for sending a Postfix SMTP server - response and for receiving a remote SMTP client + The time limit for sending a Postfix SMTP server + response and for receiving a remote SMTP client request. smtpd_history_flush_threshold (100) - The maximal number of lines in the Postfix SMTP - server command history before it is flushed upon + The maximal number of lines in the Postfix SMTP + server command history before it is flushed upon receipt of EHLO, RSET, or end of DATA. The per SMTP client connection count and request rate lim- its are implemented in co-operation with the anvil(8) ser- - vice, and are available in Postfix version 2.2 and later. + vice, and are available in Postfix version 2.2 and later. smtpd_client_connection_count_limit (50) - How many simultaneous connections any client is + How many simultaneous connections any client is allowed to make to this service. smtpd_client_connection_rate_limit (0) The maximal number of connection attempts any - client is allowed to make to this service per time + client is allowed to make to this service per time unit. smtpd_client_message_rate_limit (0) - The maximal number of message delivery requests - that any client is allowed to make to this service + The maximal number of message delivery requests + that any client is allowed to make to this service per time unit, regardless of whether or not Postfix actually accepts those messages. smtpd_client_recipient_rate_limit (0) - The maximal number of recipient addresses that any - client is allowed to send to this service per time + The maximal number of recipient addresses that any + client is allowed to send to this service per time unit, regardless of whether or not Postfix actually accepts those recipients. smtpd_client_event_limit_exceptions ($mynetworks) - Clients that are excluded from connection count, + Clients that are excluded from connection count, connection rate, or SMTP request rate restrictions. TARPIT CONTROLS - When a remote SMTP client makes errors, the Postfix SMTP - server can insert delays before responding. This can help - to slow down run-away software. The behavior is con- - trolled by an error counter that counts the number of - errors within an SMTP session that a client makes without + When a remote SMTP client makes errors, the Postfix SMTP + server can insert delays before responding. This can help + to slow down run-away software. The behavior is con- + trolled by an error counter that counts the number of + errors within an SMTP session that a client makes without delivering mail. smtpd_error_sleep_time (1s) - With Postfix 2.1 and later: the SMTP server - response delay after a client has made more than - $smtpd_soft_error_limit errors, and fewer than - $smtpd_hard_error_limit errors, without delivering + With Postfix 2.1 and later: the SMTP server + response delay after a client has made more than + $smtpd_soft_error_limit errors, and fewer than + $smtpd_hard_error_limit errors, without delivering mail. smtpd_soft_error_limit (10) - The number of errors a remote SMTP client is - allowed to make without delivering mail before the + The number of errors a remote SMTP client is + allowed to make without delivering mail before the Postfix SMTP server slows down all its responses. smtpd_hard_error_limit (20) - The maximal number of errors a remote SMTP client + The maximal number of errors a remote SMTP client is allowed to make without delivering mail. smtpd_junk_command_limit (100) - The number of junk commands (NOOP, VRFY, ETRN or + The number of junk commands (NOOP, VRFY, ETRN or RSET) that a remote SMTP client can send before the - Postfix SMTP server starts to increment the error + Postfix SMTP server starts to increment the error counter with each junk command. Available in Postfix version 2.1 and later: smtpd_recipient_overshoot_limit (1000) - The number of recipients that a remote SMTP client - can send in excess of the limit specified with + The number of recipients that a remote SMTP client + can send in excess of the limit specified with $smtpd_recipient_limit, before the Postfix SMTP - server increments the per-session error count for + server increments the per-session error count for each excess recipient. ACCESS POLICY DELEGATION CONTROLS - As of version 2.1, Postfix can be configured to delegate - access policy decisions to an external server that runs - outside Postfix. See the file SMTPD_POLICY_README for + As of version 2.1, Postfix can be configured to delegate + access policy decisions to an external server that runs + outside Postfix. See the file SMTPD_POLICY_README for more information. smtpd_policy_service_max_idle (300s) - The time after which an idle SMTPD policy service + The time after which an idle SMTPD policy service connection is closed. smtpd_policy_service_max_ttl (1000s) @@ -624,161 +630,161 @@ SMTPD(8) SMTPD(8) connection is closed. smtpd_policy_service_timeout (100s) - The time limit for connecting to, writing to or + The time limit for connecting to, writing to or receiving from a delegated SMTPD policy server. ACCESS CONTROLS - The SMTPD_ACCESS_README document gives an introduction to + The SMTPD_ACCESS_README document gives an introduction to all the SMTP server access control features. smtpd_delay_reject (yes) - Wait until the RCPT TO command before evaluating + Wait until the RCPT TO command before evaluating $smtpd_client_restrictions, $smtpd_helo_restric- tions and $smtpd_sender_restrictions, or wait until - the ETRN command before evaluating + the ETRN command before evaluating $smtpd_client_restrictions and $smtpd_helo_restric- tions. - parent_domain_matches_subdomains (see 'postconf -d' out- + parent_domain_matches_subdomains (see 'postconf -d' out- put) What Postfix features match subdomains of "domain.tld" automatically, instead of requiring an explicit ".domain.tld" pattern. smtpd_client_restrictions (empty) - Optional SMTP server access restrictions in the + Optional SMTP server access restrictions in the context of a client SMTP connection request. smtpd_helo_required (no) Require that a remote SMTP client introduces itself - at the beginning of an SMTP session with the HELO + at the beginning of an SMTP session with the HELO or EHLO command. smtpd_helo_restrictions (empty) - Optional restrictions that the Postfix SMTP server + Optional restrictions that the Postfix SMTP server applies in the context of the SMTP HELO command. smtpd_sender_restrictions (empty) - Optional restrictions that the Postfix SMTP server + Optional restrictions that the Postfix SMTP server applies in the context of the MAIL FROM command. smtpd_recipient_restrictions (permit_mynetworks, reject_unauth_destination) The access restrictions that the Postfix SMTP - server applies in the context of the RCPT TO com- + server applies in the context of the RCPT TO com- mand. smtpd_etrn_restrictions (empty) - Optional SMTP server access restrictions in the + Optional SMTP server access restrictions in the context of a client ETRN request. allow_untrusted_routing (no) - Forward mail with sender-specified routing - (user[@%!]remote[@%!]site) from untrusted clients + Forward mail with sender-specified routing + (user[@%!]remote[@%!]site) from untrusted clients to destinations matching $relay_domains. smtpd_restriction_classes (empty) - User-defined aliases for groups of access restric- + User-defined aliases for groups of access restric- tions. smtpd_null_access_lookup_key (<>) - The lookup key to be used in SMTP access(5) tables + The lookup key to be used in SMTP access(5) tables instead of the null sender address. permit_mx_backup_networks (empty) Restrict the use of the permit_mx_backup SMTP - access feature to only domains whose primary MX + access feature to only domains whose primary MX hosts match the listed networks. Available in Postfix version 2.0 and later: smtpd_data_restrictions (empty) - Optional access restrictions that the Postfix SMTP + Optional access restrictions that the Postfix SMTP server applies in the context of the SMTP DATA com- mand. smtpd_expansion_filter (see 'postconf -d' output) - What characters are allowed in $name expansions of + What characters are allowed in $name expansions of RBL reply templates. Available in Postfix version 2.1 and later: smtpd_reject_unlisted_sender (no) - Request that the Postfix SMTP server rejects mail - from unknown sender addresses, even when no - explicit reject_unlisted_sender access restriction + Request that the Postfix SMTP server rejects mail + from unknown sender addresses, even when no + explicit reject_unlisted_sender access restriction is specified. smtpd_reject_unlisted_recipient (yes) - Request that the Postfix SMTP server rejects mail + Request that the Postfix SMTP server rejects mail for unknown recipient addresses, even when no - explicit reject_unlisted_recipient access restric- + explicit reject_unlisted_recipient access restric- tion is specified. Available in Postfix version 2.2 and later: smtpd_end_of_data_restrictions (empty) - Optional access restrictions that the Postfix SMTP - server applies in the context of the SMTP END-OF- + Optional access restrictions that the Postfix SMTP + server applies in the context of the SMTP END-OF- DATA command. SENDER AND RECIPIENT ADDRESS VERIFICATION CONTROLS - Postfix version 2.1 introduces sender and recipient - address verification. This feature is implemented by - sending probe email messages that are not actually deliv- - ered. This feature is requested via the reject_unveri- - fied_sender and reject_unverified_recipient access - restrictions. The status of verification probes is main- + Postfix version 2.1 introduces sender and recipient + address verification. This feature is implemented by + sending probe email messages that are not actually deliv- + ered. This feature is requested via the reject_unveri- + fied_sender and reject_unverified_recipient access + restrictions. The status of verification probes is main- tained by the verify(8) server. See the file ADDRESS_VER- - IFICATION_README for information about how to configure + IFICATION_README for information about how to configure and operate the Postfix sender/recipient address verifica- tion service. address_verify_poll_count (3) - How many times to query the verify(8) service for - the completion of an address verification request + How many times to query the verify(8) service for + the completion of an address verification request in progress. address_verify_poll_delay (3s) - The delay between queries for the completion of an + The delay between queries for the completion of an address verification request in progress. address_verify_sender (postmaster) - The sender address to use in address verification + The sender address to use in address verification probes. unverified_sender_reject_code (450) - The numerical Postfix SMTP server response code - when a recipient address is rejected by the + The numerical Postfix SMTP server response code + when a recipient address is rejected by the reject_unverified_sender restriction. unverified_recipient_reject_code (450) - The numerical Postfix SMTP server response when a + The numerical Postfix SMTP server response when a recipient address is rejected by the reject_unveri- fied_recipient restriction. ACCESS CONTROL RESPONSES - The following parameters control numerical SMTP reply + The following parameters control numerical SMTP reply codes and/or text responses. access_map_reject_code (554) - The numerical Postfix SMTP server response code - when a client is rejected by an access(5) map + The numerical Postfix SMTP server response code + when a client is rejected by an access(5) map restriction. defer_code (450) - The numerical Postfix SMTP server response code - when a remote SMTP client request is rejected by + The numerical Postfix SMTP server response code + when a remote SMTP client request is rejected by the "defer" restriction. invalid_hostname_reject_code (501) - The numerical Postfix SMTP server response code - when the client HELO or EHLO command parameter is - rejected by the reject_invalid_hostname restric- + The numerical Postfix SMTP server response code + when the client HELO or EHLO command parameter is + rejected by the reject_invalid_hostname restric- tion. maps_rbl_reject_code (554) - The numerical Postfix SMTP server response code + The numerical Postfix SMTP server response code when a remote SMTP client request is blocked by the reject_rbl_client, reject_rhsbl_client, reject_rhsbl_sender or reject_rhsbl_recipient @@ -786,47 +792,47 @@ SMTPD(8) SMTPD(8) non_fqdn_reject_code (504) The numerical Postfix SMTP server reply code when a - client request is rejected by the + client request is rejected by the reject_non_fqdn_hostname, reject_non_fqdn_sender or reject_non_fqdn_recipient restriction. reject_code (554) - The numerical Postfix SMTP server response code - when a remote SMTP client request is rejected by + The numerical Postfix SMTP server response code + when a remote SMTP client request is rejected by the "reject" restriction. relay_domains_reject_code (554) - The numerical Postfix SMTP server response code - when a client request is rejected by the + The numerical Postfix SMTP server response code + when a client request is rejected by the reject_unauth_destination recipient restriction. unknown_address_reject_code (450) - The numerical Postfix SMTP server response code - when a sender or recipient address is rejected by + The numerical Postfix SMTP server response code + when a sender or recipient address is rejected by the reject_unknown_sender_domain or reject_unknown_recipient_domain restriction. unknown_client_reject_code (450) - The numerical Postfix SMTP server response code - when a client without valid address <=> name map- - ping is rejected by the reject_unknown_client + The numerical Postfix SMTP server response code + when a client without valid address <=> name map- + ping is rejected by the reject_unknown_client restriction. unknown_hostname_reject_code (450) - The numerical Postfix SMTP server response code - when the hostname specified with the HELO or EHLO - command is rejected by the reject_unknown_hostname + The numerical Postfix SMTP server response code + when the hostname specified with the HELO or EHLO + command is rejected by the reject_unknown_hostname restriction. Available in Postfix version 2.0 and later: default_rbl_reply (see 'postconf -d' output) - The default SMTP server response template for a - request that is rejected by an RBL-based restric- + The default SMTP server response template for a + request that is rejected by an RBL-based restric- tion. multi_recipient_bounce_reject_code (550) - The numerical Postfix SMTP server response code + The numerical Postfix SMTP server response code when a remote SMTP client request is blocked by the reject_multi_recipient_bounce restriction. @@ -835,16 +841,16 @@ SMTPD(8) SMTPD(8) MISCELLANEOUS CONTROLS config_directory (see 'postconf -d' output) - The default location of the Postfix main.cf and + 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 + How much time a Postfix daemon process may take to + handle a request before it is terminated by a built-in watchdog timer. command_directory (see 'postconf -d' output) - The location of all postfix administrative com- + The location of all postfix administrative com- mands. double_bounce_sender (double-bounce) @@ -865,36 +871,36 @@ SMTPD(8) SMTPD(8) and most Postfix daemon processes. max_idle (100s) - The maximum amount of time that an idle Postfix - daemon process waits for the next service request + The maximum amount of time that an idle Postfix + daemon process waits for the next service request before exiting. max_use (100) - The maximal number of connection requests before a + The maximal number of connection requests before a Postfix daemon process terminates. myhostname (see 'postconf -d' output) The internet hostname of this mail system. mynetworks (see 'postconf -d' output) - The list of "trusted" SMTP clients that have more + The list of "trusted" SMTP clients that have more privileges than "strangers". myorigin ($myhostname) The domain name that locally-posted mail appears to - come from, and that locally posted mail is deliv- + come from, and that locally posted mail is deliv- ered to. process_id (read-only) - The process ID of a Postfix command or daemon + The process ID of a Postfix command or daemon process. process_name (read-only) - The process name of a Postfix command or daemon + The process name of a Postfix command or daemon process. queue_directory (see 'postconf -d' output) - The location of the Postfix top-level queue direc- + The location of the Postfix top-level queue direc- tory. recipient_delimiter (empty) @@ -902,22 +908,22 @@ SMTPD(8) SMTPD(8) sions (user+foo). smtpd_banner ($myhostname ESMTP $mail_name) - The text that follows the 220 status code in the + The text that follows the 220 status code in the SMTP greeting banner. syslog_facility (mail) The syslog facility of Postfix logging. syslog_name (postfix) - The mail system name that is prepended to the - process name in syslog records, so that "smtpd" + The mail system name that is prepended to the + process name in syslog records, so that "smtpd" becomes, for example, "postfix/smtpd". Available in Postfix version 2.2 and later: smtpd_forbidden_commands (CONNECT, GET, POST) - List of commands that causes the Postfix SMTP - server to immediately terminate the session with a + List of commands that causes the Postfix SMTP + server to immediately terminate the session with a 221 code. SEE ALSO @@ -946,7 +952,7 @@ SMTPD(8) SMTPD(8) XFORWARD_README, Postfix XFORWARD extension LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index 73a89278e..c6b33c764 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -4719,6 +4719,11 @@ specify "smtpd_delay_reject = yes" (which is the default) and use: .ft R .PP See the SASL_README file for SASL configuration and operation details. +.SH smtpd_sasl_authenticated_header (default: no) +Report the SASL authenticated user name in the \fBsmtpd\fR(8) Received +message header. +.PP +This feature is available in Postfix 2.3 and later. .SH smtpd_sasl_exceptions_networks (default: empty) What SMTP clients Postfix will not offer AUTH support to. .PP diff --git a/postfix/man/man8/smtpd.8 b/postfix/man/man8/smtpd.8 index 335f81622..d662f2155 100644 --- a/postfix/man/man8/smtpd.8 +++ b/postfix/man/man8/smtpd.8 @@ -215,6 +215,11 @@ Optional lookup table with the SASL login names that own sender Available in Postfix version 2.1 and later: .IP "\fBsmtpd_sasl_exceptions_networks (empty)\fR" What SMTP clients Postfix will not offer AUTH support to. +.PP +Available in Postfix version 2.3 and later: +.IP "\fBsmtpd_sasl_authenticated_header (no)\fR" +Report the SASL authenticated user name in the \fBsmtpd\fR(8) Received +message header. .SH "STARTTLS SUPPORT CONTROLS" .na .nf diff --git a/postfix/mantools/postlink b/postfix/mantools/postlink index bb4aba220..35822ea4a 100755 --- a/postfix/mantools/postlink +++ b/postfix/mantools/postlink @@ -400,6 +400,7 @@ while (<>) { s;\bsmtpd_restriction_classes\b;$&;g; s;\bsmtpd_sasl_application_name\b;$&;g; s;\bsmtpd_sasl_auth_enable\b;$&;g; + s;\bsmtpd_sasl_authenticated_header\b;$&;g; s;\bsmtpd_sasl_exceptions_networks\b;$&;g; s;\bsmtpd_sasl_local_domain\b;$&;g; s;\bsmtpd_sasl_secu[-]*\n* *[
]*rity_options\b;$&;g; diff --git a/postfix/proto/SASL_README.html b/postfix/proto/SASL_README.html index fd807bf43..4c9c64055 100644 --- a/postfix/proto/SASL_README.html +++ b/postfix/proto/SASL_README.html @@ -37,15 +37,6 @@ authentication method, and sender address to the maillog file, and optionally grants mail access via the permit_sasl_authenticated UCE restriction. - Postfix does not record the client's SASL authentication -information in message headers, and does not pass it on via SMTP -commands when forwarding mail, because it is no-one else's business -to know the client username and authentication method. People who -need to know can find the information in the local Postfix maillog -file. Some day, Postfix message headers will be configurable and -then one can record the SASL username without having to edit C -code.
-This document covers the following topics:
@@ -191,6 +182,19 @@ SMTP server
To report SASL login names in Received: message headers +(Postfix version 2.3 and later):
+ +++ ++/etc/postfix/main.cf: + smtpd_sasl_authenticated_header = yes ++
Note: the SASL login names will be shared with the entire world. +
+In /usr/local/lib/sasl/smtpd.conf (SASL version 1.5.5) or /usr/local/lib/sasl2/smtpd.conf (SASL version 2.1.1) you need to specify how the server should validate client passwords.
diff --git a/postfix/proto/SMTPD_POLICY_README.html b/postfix/proto/SMTPD_POLICY_README.html index dade4b8fc..84e25c79c 100644 --- a/postfix/proto/SMTPD_POLICY_README.html +++ b/postfix/proto/SMTPD_POLICY_README.html @@ -374,8 +374,9 @@ inet:127.0.0.1:9998".It is relatively safe to turn on greylisting for specific -domains that often appear in forged email. A list of frequently -forged MAIL FROM domains can be found at +domains that often appear in forged email. At some point +in cyberspace/time a list of frequently +forged MAIL FROM domains could be found at http://www.monkeys.com/anti-spam/filtering/sender-domain-validate.in.
diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index a715bea4b..281fd98ec 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -5168,6 +5168,13 @@ specify "smtpd_delay_reject = yes" (which is the default) and use: See the SASL_README file for SASL configuration and operation details. +%PARAM smtpd_sasl_authenticated_header no + +Report the SASL authenticated user name in the smtpd(8) Received +message header.
+ +This feature is available in Postfix 2.3 and later.
+ %PARAM smtpd_sasl_exceptions_networksdiff --git a/postfix/proto/postconf.spec b/postfix/proto/postconf.spec deleted file mode 100644 index 87c59b108..000000000 --- a/postfix/proto/postconf.spec +++ /dev/null @@ -1,461 +0,0 @@ -%CLASS install -%PARAM command_directory -%PARAM config_directory -%PARAM daemon_directory -%PARAM default_database_type -%PARAM mail_owner -%PARAM mail_spool_directory -%PARAM mailq_path -%PARAM manpage_directory -%PARAM newaliases_path -%PARAM process_id_directory -%PARAM queue_directory -%PARAM readme_directory -%PARAM sample_directory -%PARAM sendmail_path -%PARAM setgid_group - -%CLASS postfix -%PARAM mail_release_date -%PARAM mail_version - -%CLASS plumbing -%PARAM address_verify_service_name -%PARAM bounce_service_name -%PARAM cleanup_service_name -%PARAM defer_service_name -%PARAM error_service_name -%PARAM flush_service_name -%PARAM pickup_service_name -%PARAM queue_service_name -%PARAM rewrite_service_name -%PARAM showq_service_name -%PARAM trace_service_name - -%CLASS security -%PARAM allow_min_user -%PARAM alternate_config_directories -%PARAM authorized_flush_users -%PARAM authorized_mailq_users -%PARAM authorized_submit_users -%PARAM default_privs -%PARAM import_environment -%PARAM proxy_read_maps - -%CLASS local-security -%PARAM allow_mail_to_commands -%PARAM allow_mail_to_files -%PARAM command_expansion_filter -%PARAM local_command_shell - -%CLASS address-verification -%PARAM address_verify_sender -%PARAM address_verify_service_name - -%CLASS address-verification-caching -%PARAM address_verify_map -%PARAM address_verify_negative_cache -%PARAM address_verify_negative_expire_time -%PARAM address_verify_negative_refresh_time -%PARAM address_verify_positive_expire_time -%PARAM address_verify_positive_refresh_time - -%CLASS address-verification-routing -%PARAM address_verify_default_transport -%PARAM address_verify_local_transport -%PARAM address_verify_relay_transport -%PARAM address_verify_relayhost -%PARAM address_verify_transport_maps -%PARAM address_verify_virtual_transport - -%CLASS smtpd-address-verification -%PARAM address_verify_poll_count -%PARAM address_verify_poll_delay -%PARAM unverified_recipient_reject_code -%PARAM unverified_sender_reject_code - -%class compatibility -%PARAM undisclosed_recipients_header -%PARAM allow_min_user -%PARAM backwards_bounce_logfile_compatibility - -%CLASS local-compatibility -%PARAM sun_mailtool_compatibility -%PARAM allow_mail_to_commands -%PARAM allow_mail_to_files -%PARAM biff - -%CLASS smtpd-compatibility -%PARAM broken_sasl_auth_clients -%PARAM disable_vrfy_command -%PARAM smtpd_helo_required -%PARAM smtpd_noop_commands -%PARAM smtpd_sasl_exceptions_networks -%PARAM strict_rfc821_envelopes - -%CLASS smtp-compatibility -%PARAM ignore_mx_lookup_error -%PARAM smtp_always_send_ehlo -%PARAM smtp_defer_if_no_mx_address_found -%PARAM smtp_host_lookup -%PARAM smtp_line_length_limit -%PARAM smtp_never_send_ehlo -%PARAM smtp_pix_workaround_delay_time -%PARAM smtp_pix_workaround_threshold_time -%PARAM smtp_quote_rfc821_envelope -%PARAM smtp_skip_4xx_greeting -%PARAM smtp_skip_5xx_greeting -%PARAM smtp_skip_quit_response - -%CLASS lmtp-compatibility -%PARAM lmtp_skip_quit_response - -%CLASS mime-compatibility -%PARAM strict_8bitmime -%PARAM strict_8bitmime_body -%PARAM strict_mime_encoding_domain -%PARAM strict_7bit_headers - -%CLASS resource-control -%PARAM application_event_drain_time -%PARAM berkeley_db_create_buffer_size -%PARAM berkeley_db_read_buffer_size -%PARAM bounce_size_limit -%PARAM command_time_limit -%PARAM daemon_timeout -%PARAM default_process_limit -%PARAM delay_warning_time -%PARAM deliver_lock_attempts -%PARAM deliver_lock_delay -%PARAM duplicate_filter_limit -%PARAM fork_attempts -%PARAM fork_delay -%PARAM header_address_token_limit -%PARAM header_size_limit -%PARAM hopcount_limit -%PARAM in_flow_delay -%PARAM ipc_idle -%PARAM ipc_timeout -%PARAM ipc_ttl -%PARAM line_length_limit -%PARAM max_idle -%PARAM max_use -%PARAM message_size_limit -%PARAM queue_file_attribute_count_limit -%PARAM service_throttle_time -%PARAM stale_lock_time -%PARAM transport_retry_time -%PARAM trigger_timeout - -%CLASS smtpd-resource-control -%PARAM client_event_status_update_time -%PARAM client_rate_time_unit -%PARAM queue_minfree -%PARAM smtpd_client_connection_count_limit -%PARAM smtpd_client_connection_limit_exceptions -%PARAM smtpd_client_connection_rate_limit -%PARAM smtpd_history_flush_threshold -%PARAM smtpd_junk_command_limit -%PARAM smtpd_recipient_limit -%PARAM smtpd_timeout - -%CLASS smtp-resource-control -%PARAM smtp_connect_timeout -%PARAM smtp_data_done_timeout -%PARAM smtp_data_init_timeout -%PARAM smtp_data_xfer_timeout -%PARAM smtp_destination_concurrency_limit -%PARAM smtp_destination_recipient_limit -%PARAM smtp_helo_timeout -%PARAM smtp_mail_timeout -%PARAM smtp_mx_address_limit -%PARAM smtp_mx_session_limit -%PARAM smtp_quit_timeout -%PARAM smtp_rcpt_timeout -%PARAM smtp_rset_timeout -%PARAM smtp_xforward_timeout - -%CLASS lmtp-resource-control -%PARAM lmtp_cache_connection -%PARAM lmtp_connect_timeout -%PARAM lmtp_data_done_timeout -%PARAM lmtp_data_init_timeout -%PARAM lmtp_data_xfer_timeout -%PARAM lmtp_lhlo_timeout -%PARAM lmtp_mail_timeout -%PARAM lmtp_quit_timeout -%PARAM lmtp_rcpt_timeout -%PARAM lmtp_rset_timeout -%PARAM lmtp_xforward_timeout - -%CLASS mime-resource-control -%PARAM mime_boundary_length_limit -%PARAM mime_nesting_limit - -%CLASS local-resource-control -%PARAM local_destination_concurrency_limit -%PARAM local_destination_recipient_limit - -%CLASS smtpd-tarpit -%PARAM smtpd_error_sleep_time -%PARAM smtpd_hard_error_limit -%PARAM smtpd_soft_error_limit - -%CLASS content-filter -%PARAM lmtp_send_xforward_command -%PARAM receive_override_options -%PARAM smtp_send_xforward_command -%PARAM smtpd_authorized_xforward_hosts - -%CLASS built-in-filter -%PARAM body_checks -%PARAM body_checks_size_limit -%PARAM header_checks -%PARAM mime_header_checks -%PARAM nested_header_checks - -%CLASS after-queue-filter -%PARAM content_filter - -%CLASS smtpd-proxy-filter -%PARAM smtpd_proxy_ehlo -%PARAM smtpd_proxy_filter -%PARAM smtpd_proxy_timeout - -%CLASS smtp -%PARAM best_mx_transport -%PARAM disable_dns_lookups -%PARAM fallback_relay -%PARAM smtp_bind_address -%PARAM smtp_helo_name -%PARAM smtp_randomize_addresses - -%CLASS basic-config -%PARAM alias_maps -%PARAM inet_interfaces -%PARAM mydestination -%PARAM mydomain -%PARAM myhostname -%PARAM mynetworks -%PARAM mynetworks_style -%PARAM myorigin -%PARAM proxy_interfaces - -%CLASS smtpd-policy -%PARAM smtpd_policy_service_max_idle -%PARAM smtpd_policy_service_max_ttl -%PARAM smtpd_policy_service_timeout - -%CLASS smtpd-access -%PARAM allow_untrusted_routing -%PARAM maps_rbl_domains -%PARAM parent_domain_matches_subdomains -%PARAM permit_mx_backup_networks -%PARAM smtpd_client_restrictions -%PARAM smtpd_data_restrictions -%PARAM smtpd_delay_reject -%PARAM smtpd_etrn_restrictions -%PARAM smtpd_expansion_filter -%PARAM smtpd_helo_restrictions -%PARAM smtpd_null_access_lookup_key -%PARAM smtpd_recipient_restrictions -%PARAM smtpd_reject_unlisted_recipient -%PARAM smtpd_reject_unlisted_sender -%PARAM smtpd_restriction_classes -%PARAM smtpd_sender_restrictions - -%CLASS smtpd-reply-code -%PARAM access_map_reject_code -%PARAM default_rbl_reply -%PARAM defer_code -%PARAM invalid_hostname_reject_code -%PARAM maps_rbl_reject_code -%PARAM multi_recipient_bounce_reject_code -%PARAM non_fqdn_reject_code -%PARAM rbl_reply_maps -%PARAM reject_code -%PARAM relay_domains_reject_code -%PARAM unknown_address_reject_code -%PARAM unknown_client_reject_code -%PARAM unknown_hostname_reject_code -%PARAM unknown_local_recipient_reject_code -%PARAM unknown_relay_recipient_reject_code -%PARAM unknown_virtual_alias_reject_code -%PARAM unknown_virtual_mailbox_reject_code -%PARAM unverified_recipient_reject_code -%PARAM unverified_sender_reject_code - -%CLASS smtpd-sasl -%PARAM smtpd_sasl_application_name -%PARAM smtpd_sasl_auth_enable -%PARAM smtpd_sasl_local_domain -%PARAM smtpd_sasl_security_options -%PARAM smtpd_sender_login_maps - -%CLASS smtp-sasl -%PARAM smtp_sasl_auth_enable -%PARAM smtp_sasl_password_maps -%PARAM smtp_sasl_security_options -%PARAM smtp_sasl_mechanism_filter - -%CLASS lmtp-sasl -%PARAM lmtp_sasl_auth_enable -%PARAM lmtp_sasl_password_maps -%PARAM lmtp_sasl_security_options - -%CLASS smtpd-unknown-recipients -%PARAM local_recipient_maps -%PARAM relay_recipient_maps -%PARAM virtual_alias_maps -%PARAM virtual_mailbox_maps - -%CLASS trouble-shooting -%PARAM 2bounce_notice_recipient -%PARAM bounce_notice_recipient -%PARAM debug_peer_level -%PARAM debug_peer_list -%PARAM debugger_command -%PARAM delay_notice_recipient -%PARAM dont_remove -%PARAM double_bounce_sender -%PARAM error_notice_recipient -%PARAM fault_injection_code -%PARAM helpful_warnings -%PARAM notify_classes -%PARAM show_user_unknown_table_name -%PARAM smtpd_authorized_xclient_hosts -%PARAM soft_bounce - -%CLASS mime -%PARAM disable_mime_input_processing -%PARAM disable_mime_output_conversion - -%CLASS verp -%PARAM default_verp_delimiters -%PARAM disable_verp_bounces -%PARAM smtpd_authorized_verp_clients -%PARAM verp_delimiter_filter - -%CLASS lmtp -%PARAM lmtp_tcp_port - -%CLASS other -%PARAM command_directory -%PARAM process_name -%PARAM process_id -%PARAM smtpd_banner -%PARAM mail_name - -%CLASS scheduler -%PARAM bounce_queue_lifetime -%PARAM default_delivery_slot_cost -%PARAM default_delivery_slot_discount -%PARAM default_delivery_slot_loan -%PARAM default_destination_concurrency_limit -%PARAM default_destination_recipient_limit -%PARAM default_extra_recipient_limit -%PARAM default_minimum_delivery_slots -%PARAM default_recipient_limit -%PARAM defer_transports -%PARAM initial_destination_concurrency -%PARAM maximal_backoff_time -%PARAM maximal_queue_lifetime -%PARAM minimal_backoff_time -%PARAM qmgr_clog_warn_time -%PARAM qmgr_fudge_factor -%PARAM qmgr_message_active_limit -%PARAM qmgr_message_recipient_limit -%PARAM qmgr_message_recipient_minimum -%PARAM queue_run_delay -%PARAM queue_service_name - -%CLASS qmqpd -%PARAM qmqpd_authorized_clients -%PARAM qmqpd_error_delay -%PARAM qmqpd_timeout - -%CLASS logging -%PARAM syslog_facility -%PARAM syslog_name -%PARAM debug_peer_list -%PARAM debug_peer_level - -%CLASS etrn -%PARAM fast_flush_domains -%PARAM fast_flush_purge_time -%PARAM fast_flush_refresh_time -%PARAM flush_service_name - -%CLASS local -%PARAM alias_database -%PARAM alias_maps -%PARAM export_environment -%PARAM fallback_transport -%PARAM forward_expansion_filter -%PARAM forward_path -%PARAM home_mailbox -%PARAM local_transport -%PARAM luser_relay -%PARAM mailbox_command -%PARAM mailbox_command_maps -%PARAM mailbox_delivery_lock -%PARAM mailbox_size_limit -%PARAM mailbox_transport -%PARAM prepend_delivered_header -%PARAM require_home_directory - -%CLASS address-manipulation -%PARAM allow_percent_hack -%PARAM always_bcc -%PARAM append_at_myorigin -%PARAM append_dot_mydomain -%PARAM canonical_maps -%PARAM cleanup_service_name -%PARAM default_transport -%PARAM default_transport -%PARAM empty_address_recipient -%PARAM enable_original_recipient -%PARAM expand_owner_alias -%PARAM masquerade_classes -%PARAM masquerade_domains -%PARAM masquerade_exceptions -%PARAM owner_request_special -%PARAM propagate_unmatched_extensions -%PARAM recipient_bcc_maps -%PARAM recipient_canonical_maps -%PARAM recipient_delimiter -%PARAM relay_domains -%PARAM relay_transport -%PARAM relayhost -%PARAM relocated_maps -%PARAM resolve_dequoted_address -%PARAM rewrite_service_name -%PARAM sender_based_routing -%PARAM sender_bcc_maps -%PARAM sender_canonical_maps -%PARAM swap_bangpath -%PARAM transport_maps -%PARAM virtual_alias_expansion_limit -%PARAM virtual_alias_maps -%PARAM virtual_alias_recursion_limit - -%CLASS queue-hashing -%PARAM hash_queue_depth -%PARAM hash_queue_names - -%CLASS virtual-mailbox -%PARAM virtual_gid_maps -%PARAM virtual_mailbox_base -%PARAM virtual_mailbox_domains -%PARAM virtual_mailbox_limit -%PARAM virtual_mailbox_lock -%PARAM virtual_mailbox_maps -%PARAM virtual_minimum_uid -%PARAM virtual_transport -%PARAM virtual_uid_maps - -%CLASS virtual-alias-domain -%PARAM virtual_alias_domains -%PARAM virtual_alias_expansion_limit -%PARAM virtual_alias_maps -%PARAM virtual_alias_recursion_limit diff --git a/postfix/src/global/log_adhoc.c b/postfix/src/global/log_adhoc.c index f422b128a..fd0609f02 100644 --- a/postfix/src/global/log_adhoc.c +++ b/postfix/src/global/log_adhoc.c @@ -120,10 +120,10 @@ void vlog_adhoc(const char *id, const char *orig_rcpt, vstring_vsprintf(why, fmt, ap); if (orig_rcpt && *orig_rcpt && strcasecmp(recipient, orig_rcpt) != 0) - msg_info("%s: to=<%s>, orig_to=<%s>, relay=%s, delay=%d, dsn=%s status=%s (%s)", + msg_info("%s: to=<%s>, orig_to=<%s>, relay=%s, delay=%d, dsn=%s, status=%s (%s)", id, recipient, orig_rcpt, relay, delay, detail, status, vstring_str(why)); else - msg_info("%s: to=<%s>, relay=%s, delay=%d, dsn=%s status=%s (%s)", + msg_info("%s: to=<%s>, relay=%s, delay=%d, dsn=%s, status=%s (%s)", id, recipient, relay, delay, detail, status, vstring_str(why)); vstring_free(why); } diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index ebce57eaa..9cd1a9900 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -1177,6 +1177,10 @@ extern int var_smtp_tls_scache_timeout; #define DEF_SMTPD_SASL_ENABLE 0 extern bool var_smtpd_sasl_enable; +#define VAR_SMTPD_SASL_AUTH_HDR "smtpd_sasl_authenticated_header" +#define DEF_SMTPD_SASL_AUTH_HDR 0 +extern bool var_smtpd_sasl_auth_hdr; + #define VAR_SMTPD_SASL_OPTS "smtpd_sasl_security_options" #define DEF_SMTPD_SASL_OPTS "noanonymous" extern char *var_smtpd_sasl_opts; diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 66f9a453b..f2dea7da0 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change the patchlevel and the release date. Snapshots change the * release date only. */ -#define MAIL_RELEASE_DATE "20050402" +#define MAIL_RELEASE_DATE "20050404" #define MAIL_VERSION_NUMBER "2.3" #define VAR_MAIL_VERSION "mail_version" diff --git a/postfix/src/lmtp/lmtp_sasl_glue.c b/postfix/src/lmtp/lmtp_sasl_glue.c index 05bcc7d92..d2a790f0d 100644 --- a/postfix/src/lmtp/lmtp_sasl_glue.c +++ b/postfix/src/lmtp/lmtp_sasl_glue.c @@ -292,6 +292,27 @@ int lmtp_sasl_passwd_lookup(LMTP_STATE *state) void lmtp_sasl_initialize(void) { +#if SASL_VERSION_MAJOR >= 2 && (SASL_VERSION_MINOR >= 2 \ + || (SASL_VERSION_MINOR == 1 && SASL_VERSION_STEP >= 19)) + int sasl_major; + int sasl_minor; + int sasl_step; + + /* + * DLL hell guard. + */ + sasl_version_info((const char **) 0, (const char **) 0, + &sasl_major, &sasl_minor, + &sasl_step, (int *) 0); + if (sasl_major != SASL_VERSION_MAJOR + || sasl_minor != SASL_VERSION_MINOR + || sasl_step != SASL_VERSION_STEP) + msg_fatal("incorrect SASL library version. " + "Postfix was built for version %d.%d.%d, " + "but the run-time library version is %d.%d.%d", + SASL_VERSION_MAJOR, SASL_VERSION_MINOR, SASL_VERSION_STEP, + sasl_major, sasl_minor, sasl_step); +#endif /* * Global callbacks. These have no per-session context. diff --git a/postfix/src/smtp/smtp_sasl_glue.c b/postfix/src/smtp/smtp_sasl_glue.c index 735c2a456..e9303db82 100644 --- a/postfix/src/smtp/smtp_sasl_glue.c +++ b/postfix/src/smtp/smtp_sasl_glue.c @@ -321,6 +321,27 @@ int smtp_sasl_passwd_lookup(SMTP_SESSION *session) void smtp_sasl_initialize(void) { +#if SASL_VERSION_MAJOR >= 2 && (SASL_VERSION_MINOR >= 2 \ + || (SASL_VERSION_MINOR == 1 && SASL_VERSION_STEP >= 19)) + int sasl_major; + int sasl_minor; + int sasl_step; + + /* + * DLL hell guard. + */ + sasl_version_info((const char **) 0, (const char **) 0, + &sasl_major, &sasl_minor, + &sasl_step, (int *) 0); + if (sasl_major != SASL_VERSION_MAJOR + || sasl_minor != SASL_VERSION_MINOR + || sasl_step != SASL_VERSION_STEP) + msg_fatal("incorrect SASL library version. " + "Postfix was built for version %d.%d.%d, " + "but the run-time library version is %d.%d.%d", + SASL_VERSION_MAJOR, SASL_VERSION_MINOR, SASL_VERSION_STEP, + sasl_major, sasl_minor, sasl_step); +#endif /* * Global callbacks. These have no per-session context. @@ -352,7 +373,7 @@ void smtp_sasl_initialize(void) * Initialize optional supported mechanism matchlist */ if (*var_smtp_sasl_mechs) - smtp_sasl_mechs = string_list_init(MATCH_FLAG_NONE, + smtp_sasl_mechs = string_list_init(MATCH_FLAG_NONE, var_smtp_sasl_mechs); } diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index fb021129e..5c68e4b0b 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -187,6 +187,11 @@ /* Available in Postfix version 2.1 and later: /* .IP "\fBsmtpd_sasl_exceptions_networks (empty)\fR" /* What SMTP clients Postfix will not offer AUTH support to. +/* .PP +/* Available in Postfix version 2.3 and later: +/* .IP "\fBsmtpd_sasl_authenticated_header (no)\fR" +/* Report the SASL authenticated user name in the \fBsmtpd\fR(8) Received +/* message header. /* STARTTLS SUPPORT CONTROLS /* .ad /* .fi @@ -856,6 +861,7 @@ bool var_allow_untrust_route; int var_smtpd_junk_cmd_limit; int var_smtpd_rcpt_overlim; bool var_smtpd_sasl_enable; +bool var_smtpd_sasl_auth_hdr; char *var_smtpd_sasl_opts; char *var_smtpd_sasl_appname; char *var_smtpd_sasl_realm; @@ -1824,11 +1830,9 @@ static void rcpt_reset(SMTPD_STATE *state) state->rcpt_overshoot = 0; } -#ifdef USE_TLS +/* comment_sanitize - clesn up comment string */ -/* CN_sanitize - make sure, the CN-string is well behaved */ - -static void CN_sanitize(VSTRING *CNstring) +static void comment_sanitize(VSTRING *comment_string) { unsigned char *cp; int ch; @@ -1836,12 +1840,13 @@ static void CN_sanitize(VSTRING *CNstring) /* * Postfix Received: headers can be configured to include a comment with - * the CN (CommonName) of the peer and its issuer. To avoid problems with - * RFC 822 etc. syntax, we limit the CN information to printable ASCII - * text, and neutralize characters that affect comment parsing: the - * backslash and unbalanced parentheses. + * the CN (CommonName) of the peer and its issuer, or the login name of a + * SASL authenticated user. To avoid problems with RFC 822 etc. syntax, + * we limit this information to printable ASCII text, and neutralize + * characters that affect comment parsing: the backslash and unbalanced + * parentheses. */ - for (pc = 0, cp = (unsigned char *) STR(CNstring); (ch = *cp) != 0; cp++) { + for (pc = 0, cp = (unsigned char *) STR(comment_string); (ch = *cp) != 0; cp++) { if (!ISASCII(ch) || !ISPRINT(ch) || ch == '\\') { *cp = '?'; } else if (ch == '(') { @@ -1854,11 +1859,9 @@ static void CN_sanitize(VSTRING *CNstring) } } while (pc-- > 0) - VSTRING_ADDCH(CNstring, ')'); + VSTRING_ADDCH(comment_string, ')'); } -#endif - /* data_cmd - process DATA command */ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv) @@ -1882,6 +1885,10 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv) VSTRING *peer_CN; VSTRING *issuer_CN; +#endif +#ifdef USE_SASL_AUTH + VSTRING *username; + #endif /* @@ -1965,6 +1972,9 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv) "Received: from %s (%s [%s])", state->helo_name ? state->helo_name : state->name, state->name, state->rfc_addr); + +#define VSTRING_STRDUP(s) vstring_strcpy(vstring_alloc(strlen(s) + 1), (s)) + #ifdef USE_TLS if (var_smtpd_tls_received_header && state->tls_context) { out_fprintf(out_stream, REC_TYPE_NORM, @@ -1972,14 +1982,11 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv) state->tls_info.protocol, state->tls_info.cipher_name, state->tls_info.cipher_usebits, state->tls_info.cipher_algbits); - -#define VSTRING_STRDUP(s) vstring_strcpy(vstring_alloc(strlen(s) + 1), (s)) - if (state->tls_info.peer_CN) { peer_CN = VSTRING_STRDUP(state->tls_info.peer_CN); - CN_sanitize(peer_CN); + comment_sanitize(peer_CN); issuer_CN = VSTRING_STRDUP(state->tls_info.issuer_CN); - CN_sanitize(issuer_CN); + comment_sanitize(issuer_CN); if (state->tls_info.peer_verified) out_fprintf(out_stream, REC_TYPE_NORM, "\t(Client CN \"%s\", Issuer \"%s\" (verified OK))", @@ -1997,6 +2004,15 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv) out_fprintf(out_stream, REC_TYPE_NORM, "\t(No client certificate requested)"); } +#endif +#ifdef USE_SASL_AUTH + if (var_smtpd_sasl_auth_hdr && state->sasl_username) { + username = VSTRING_STRDUP(state->sasl_username); + comment_sanitize(username); + out_fprintf(out_stream, REC_TYPE_NORM, + "\t(Authenticated sender: %s)", STR(username)); + vstring_free(username); + } #endif if (state->rcpt_count == 1 && state->recipient) { out_fprintf(out_stream, REC_TYPE_NORM, @@ -3399,6 +3415,7 @@ int main(int argc, char **argv) VAR_DISABLE_VRFY_CMD, DEF_DISABLE_VRFY_CMD, &var_disable_vrfy_cmd, VAR_ALLOW_UNTRUST_ROUTE, DEF_ALLOW_UNTRUST_ROUTE, &var_allow_untrust_route, VAR_SMTPD_SASL_ENABLE, DEF_SMTPD_SASL_ENABLE, &var_smtpd_sasl_enable, + VAR_SMTPD_SASL_AUTH_HDR, DEF_SMTPD_SASL_AUTH_HDR, &var_smtpd_sasl_auth_hdr, VAR_BROKEN_AUTH_CLNTS, DEF_BROKEN_AUTH_CLNTS, &var_broken_auth_clients, VAR_SHOW_UNK_RCPT_TABLE, DEF_SHOW_UNK_RCPT_TABLE, &var_show_unk_rcpt_table, VAR_SMTPD_REJ_UNL_FROM, DEF_SMTPD_REJ_UNL_FROM, &var_smtpd_rej_unl_from, diff --git a/postfix/src/smtpd/smtpd_sasl_glue.c b/postfix/src/smtpd/smtpd_sasl_glue.c index 74ac5e5bf..f89777d90 100644 --- a/postfix/src/smtpd/smtpd_sasl_glue.c +++ b/postfix/src/smtpd/smtpd_sasl_glue.c @@ -208,6 +208,27 @@ static NAME_MASK smtpd_sasl_mask[] = { void smtpd_sasl_initialize(void) { +#if SASL_VERSION_MAJOR >= 2 && (SASL_VERSION_MINOR >= 2 \ + || (SASL_VERSION_MINOR == 1 && SASL_VERSION_STEP >= 19)) + int sasl_major; + int sasl_minor; + int sasl_step; + + /* + * DLL hell guard. + */ + sasl_version_info((const char **) 0, (const char **) 0, + &sasl_major, &sasl_minor, + &sasl_step, (int *) 0); + if (sasl_major != SASL_VERSION_MAJOR + || sasl_minor != SASL_VERSION_MINOR + || sasl_step != SASL_VERSION_STEP) + msg_fatal("incorrect SASL library version. " + "Postfix was built for version %d.%d.%d, " + "but the run-time library version is %d.%d.%d", + SASL_VERSION_MAJOR, SASL_VERSION_MINOR, SASL_VERSION_STEP, + sasl_major, sasl_minor, sasl_step); +#endif /* * Initialize the library: load SASL plug-in routines, etc. diff --git a/postfix/src/tls/tls_scache.c b/postfix/src/tls/tls_scache.c index f8a314db4..e9e172497 100644 --- a/postfix/src/tls/tls_scache.c +++ b/postfix/src/tls/tls_scache.c @@ -144,9 +144,6 @@ /* * Session cache entry format. - * - * XXX The session cache version number is not needed because we truncate the - * database when it is opened. */ typedef struct { time_t timestamp; /* time when saved */ @@ -221,8 +218,7 @@ static int tls_scache_decode(TLS_SCACHE *cp, const char *cache_id, } /* - * Disassemble the TLS session cache entry and enforce version number - * restrictions. + * Disassemble the TLS session cache entry. * * No early returns or we have a memory leak. */ @@ -289,7 +285,7 @@ int tls_scache_lookup(TLS_SCACHE *cp, const char *cache_id, return (0); /* - * Decode entry and verify version information. + * Decode entry and delete if expired or malformed. */ if (tls_scache_decode(cp, cache_id, hex_data, strlen(hex_data), session) == 0) {