From: Wietse Z Venema Date: Wed, 29 Apr 2026 05:00:00 +0000 (-0500) Subject: postfix-3.12-20260429 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a5744630d0cf07931c3a67a6de76b6060d5c848;p=thirdparty%2Fpostfix.git postfix-3.12-20260429 --- diff --git a/postfix/.indent.pro b/postfix/.indent.pro index ff511fea1..9ece20998 100644 --- a/postfix/.indent.pro +++ b/postfix/.indent.pro @@ -442,6 +442,7 @@ -TXSASL_SERVER_CREATE_ARGS -TXSASL_SERVER_IMPL -TXSASL_SERVER_IMPL_INFO +-TYANA_POLICY -Taddrinfo -Tbind_props -Tbson_iter_t diff --git a/postfix/HISTORY b/postfix/HISTORY index 0af1781db..c302bc772 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -31014,6 +31014,40 @@ Apologies for any names omitted. value in the configuration parameter dictionary. File: global/mail_params.c. +20260426 + + Portability: support for recent FreeBSD, NetBSD and OpenBSD + versions. Brad Smith. Files: makedefs, util/sys_defs.h. + + Future proofing: eliminate duplicate makedefs sections for + similar OS versions, and reduce OS version toil. Major OS + versions still need to be blessed in . File: + makedefs. + +20260428 + + Feature: per-peer TLS logging support, configurable with + smtp_tls_loglevel_maps, smtpd_tls_loglevel_maps, and + postscreen_tls_loglevel_maps. This adds two arguments to + each tls_client_start() and tls_server_start() call. Files: + mantools/postlink, proto/postconf.proto, global/mail_params.h, + global/yana_policy.c, global/yana_policy.h, + global/yana_policy_test.c postscreen/postscreen.c, + postscreen/postscreen.h, postscreen/postscreen_starttls.c, + postscreen/postscreen_state.c, postscreen/postscreen_tls_conf.c, + posttls-finger/posttls-finger.c, smtp/smtp.c, smtp/smtp.h, + smtp/smtp_proto.c, smtpd/smtpd.c, tls/tls_client.c, tls/tls.h, + tls/tls_misc.c, tls/tls_proxy_client_start_proto.[hc], + tls/tls_proxy_server_start_proto.[hc], tls/tls_server.c. + + Next up is replacing a large number of "[%s]:%s" format strings + in postscreen code. + +20240629 + + Testing: portability. Files: postscreen/postscreen_dnsbl_test.c, + testing/mock_myaddrinfo_test.c. + TODO Reorganize PTEST_LIB, PMOCK_LIB, TESTLIB, TESTLIBS, etc. diff --git a/postfix/html/lmtp.8.html b/postfix/html/lmtp.8.html index a0bebb0e3..04e8ed84a 100644 --- a/postfix/html/lmtp.8.html +++ b/postfix/html/lmtp.8.html @@ -788,41 +788,47 @@ SMTP(8) SMTP(8) Enable logging of TLS feature information in delivery status logging. + Available in Postfix version 3.12 and later: + + smtp_tls_loglevel_maps (empty) + Optional TLS loglevel override that depends on the remote peer + host name or IP address. + OBSOLETE TLS CONTROLS - The following configuration parameters exist for compatibility with - Postfix versions before 2.3. Support for these will be removed in a + The following configuration parameters exist for compatibility with + Postfix versions before 2.3. Support for these will be removed in a future release. smtp_use_tls (no) - Opportunistic mode: use TLS when a remote SMTP server announces + Opportunistic mode: use TLS when a remote SMTP server announces STARTTLS support, otherwise send the mail in the clear. smtp_enforce_tls (no) - Enforcement mode: require that remote SMTP servers use TLS + Enforcement mode: require that remote SMTP servers use TLS encryption, and never send mail in the clear. smtp_tls_enforce_peername (yes) - With mandatory TLS encryption, require that the remote SMTP - server hostname matches the information in the remote SMTP + With mandatory TLS encryption, require that the remote SMTP + server hostname matches the information in the remote SMTP server certificate. smtp_tls_per_site (empty) - Optional lookup tables with the Postfix SMTP client TLS usage - policy by next-hop destination and by remote SMTP server host- + Optional lookup tables with the Postfix SMTP client TLS usage + policy by next-hop destination and by remote SMTP server host- name. smtp_tls_cipherlist (empty) - Obsolete Postfix < 2.3 control for the Postfix SMTP client TLS + Obsolete Postfix < 2.3 control for the Postfix SMTP client TLS cipher list. RESOURCE AND RATE CONTROLS smtp_connect_timeout (30s) - The Postfix SMTP client time limit for completing a TCP connec- + The Postfix SMTP client time limit for completing a TCP connec- tion, or zero (use the operating system built-in time limit). smtp_helo_timeout (300s) - The Postfix SMTP client time limit for sending the HELO or EHLO - command, and for receiving the initial remote SMTP server + The Postfix SMTP client time limit for sending the HELO or EHLO + command, and for receiving the initial remote SMTP server response. lmtp_lhlo_timeout (300s) @@ -834,19 +840,19 @@ SMTP(8) SMTP(8) mand, and for receiving the remote SMTP server response. smtp_mail_timeout (300s) - The Postfix SMTP client time limit for sending the MAIL FROM + The Postfix SMTP client time limit for sending the MAIL FROM command, and for receiving the remote SMTP server response. smtp_rcpt_timeout (300s) - The Postfix SMTP client time limit for sending the SMTP RCPT TO + The Postfix SMTP client time limit for sending the SMTP RCPT TO command, and for receiving the remote SMTP server response. smtp_data_init_timeout (120s) - The Postfix SMTP client time limit for sending the SMTP DATA + The Postfix SMTP client time limit for sending the SMTP DATA command, and for receiving the remote SMTP server response. smtp_data_xfer_timeout (180s) - The Postfix SMTP client time limit for sending the SMTP message + The Postfix SMTP client time limit for sending the SMTP message content. smtp_data_done_timeout (600s) @@ -860,13 +866,13 @@ SMTP(8) SMTP(8) Available in Postfix version 2.1 and later: smtp_mx_address_limit (5) - The maximal number of MX (mail exchanger) IP addresses that can - result from Postfix SMTP client mail exchanger lookups, or zero + The maximal number of MX (mail exchanger) IP addresses that can + result from Postfix SMTP client mail exchanger lookups, or zero (no limit). smtp_mx_session_limit (2) - The maximal number of SMTP sessions per delivery request before - the Postfix SMTP client gives up or delivers to a fall-back + The maximal number of SMTP sessions per delivery request before + the Postfix SMTP client gives up or delivers to a fall-back relay host, or zero (no limit). smtp_rset_timeout (20s) @@ -876,17 +882,17 @@ SMTP(8) SMTP(8) Available in Postfix version 2.2 and earlier: lmtp_cache_connection (yes) - Keep Postfix LMTP client connections open for up to $max_idle + Keep Postfix LMTP client connections open for up to $max_idle seconds. Available in Postfix version 2.2 and later: smtp_connection_cache_destinations (empty) - Permanently enable SMTP connection caching for the specified + Permanently enable SMTP connection caching for the specified destinations. smtp_connection_cache_on_demand (yes) - Temporarily enable SMTP connection caching while a destination + Temporarily enable SMTP connection caching while a destination has a high volume of mail in the active queue. smtp_connection_reuse_time_limit (300s) @@ -900,23 +906,23 @@ SMTP(8) SMTP(8) Available in Postfix version 2.3 and later: connection_cache_protocol_timeout (5s) - Time limit for connection cache connect, send or receive opera- + Time limit for connection cache connect, send or receive opera- tions. Available in Postfix version 2.9 - 3.6: smtp_per_record_deadline (no) - Change the behavior of the smtp_*_timeout time limits, from a - time limit per read or write system call, to a time limit to - send or receive a complete record (an SMTP command line, SMTP - response line, SMTP message content line, or TLS protocol mes- + Change the behavior of the smtp_*_timeout time limits, from a + time limit per read or write system call, to a time limit to + send or receive a complete record (an SMTP command line, SMTP + response line, SMTP message content line, or TLS protocol mes- sage). Available in Postfix version 2.11 and later: smtp_connection_reuse_count_limit (0) - When SMTP connection caching is enabled, the number of times - that an SMTP session may be reused before it is closed, or zero + When SMTP connection caching is enabled, the number of times + that an SMTP session may be reused before it is closed, or zero (no limit). Available in Postfix version 3.4 and later: @@ -927,13 +933,13 @@ SMTP(8) SMTP(8) Available in Postfix version 3.7 and later: smtp_per_request_deadline (no) - Change the behavior of the smtp_*_timeout time limits, from a - time limit per plaintext or TLS read or write call, to a com- - bined time limit for sending a complete SMTP request and for + Change the behavior of the smtp_*_timeout time limits, from a + time limit per plaintext or TLS read or write call, to a com- + bined time limit for sending a complete SMTP request and for receiving a complete SMTP response. smtp_min_data_rate (500) - The minimum plaintext data transfer rate in bytes/second for + The minimum plaintext data transfer rate in bytes/second for DATA requests, when deadlines are enabled with smtp_per_request_deadline. @@ -941,54 +947,54 @@ SMTP(8) SMTP(8) transport_destination_concurrency_limit ($default_destination_concur- rency_limit) - A transport-specific override for the default_destination_con- + A transport-specific override for the default_destination_con- currency_limit parameter value, where transport is the master.cf name of the message delivery transport. transport_destination_recipient_limit ($default_destination_recipi- ent_limit) A transport-specific override for the default_destination_recip- - ient_limit parameter value, where transport is the master.cf + ient_limit parameter value, where transport is the master.cf name of the message delivery transport. SMTPUTF8 CONTROLS Preliminary SMTPUTF8 support is introduced with Postfix 3.0. smtputf8_enable (yes) - Enable preliminary SMTPUTF8 support for the protocols described + Enable preliminary SMTPUTF8 support for the protocols described in RFC 6531, RFC 6532, and RFC 6533. smtputf8_autodetect_classes (sendmail, verify) - Detect that a message requires SMTPUTF8 support for the speci- + Detect that a message requires SMTPUTF8 support for the speci- fied mail origin classes. Available in Postfix version 3.2 and later: enable_idna2003_compatibility (no) - Enable 'transitional' compatibility between IDNA2003 and - IDNA2008, when converting UTF-8 domain names to/from the ASCII + Enable 'transitional' compatibility between IDNA2003 and + IDNA2008, when converting UTF-8 domain names to/from the ASCII form that is used for DNS lookups. TROUBLE SHOOTING CONTROLS debug_peer_level (2) - The increment in verbose logging level when a nexthop destina- - tion, remote client or server name or network address matches a + The increment in verbose logging level when a nexthop destina- + tion, remote client or server name or network address matches a pattern given with the debug_peer_list parameter. debug_peer_list (empty) - Optional list of nexthop destination, remote client or server - name or network address patterns that, if matched, cause the - verbose logging level to increase by the amount specified in + Optional list of nexthop destination, remote client or server + name or network address patterns that, if matched, 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 + The recipient of postmaster notifications about mail delivery problems that are caused by policy, resource, software or proto- col errors. internal_mail_filter_classes (empty) - What categories of Postfix-generated mail are subject to - before-queue content inspection by non_smtpd_milters, + What categories of Postfix-generated mail are subject to + before-queue content inspection by non_smtpd_milters, header_checks and body_checks. notify_classes (resource, software) @@ -996,46 +1002,46 @@ SMTP(8) SMTP(8) MISCELLANEOUS CONTROLS best_mx_transport (empty) - Where the Postfix SMTP client should deliver mail when it + Where the Postfix SMTP client should deliver mail when it detects a "mail loops back to myself" error condition. config_directory (see 'postconf -d' output) - The default location of the Postfix main.cf and master.cf con- + The default location of the Postfix main.cf and master.cf con- figuration files. daemon_timeout (18000s) - How much time a Postfix daemon process may take to handle a + How much time a Postfix daemon process may take to handle a request before it is terminated by a built-in watchdog timer. delay_logging_resolution_limit (2) - The maximal number of digits after the decimal point when log- + The maximal number of digits after the decimal point when log- ging delay values. disable_dns_lookups (no) Disable DNS lookups in the Postfix SMTP and LMTP clients. inet_interfaces (all) - The local network interface addresses that this mail system + The local network interface addresses that this mail system receives mail on. inet_protocols (see 'postconf -d' output) - The Internet protocols Postfix will attempt to use when making + The Internet protocols Postfix will attempt to use when making or accepting connections. ipc_timeout (3600s) - The time limit for sending or receiving information over an + The time limit for sending or receiving information over an internal communication channel. lmtp_assume_final (no) - When a remote LMTP server announces no DSN support, assume that - the server performs final delivery, and send "delivered" deliv- + When a remote LMTP server announces no DSN support, assume that + the server performs final delivery, and send "delivered" deliv- ery status notifications instead of "relayed". lmtp_tcp_port (24) The default TCP port that the Postfix LMTP client connects to. max_idle (100s) - The maximum amount of time that an idle Postfix daemon process + The maximum amount of time that an idle Postfix daemon process waits for an incoming connection before terminating voluntarily. max_use (100) @@ -1049,21 +1055,21 @@ SMTP(8) SMTP(8) The process name of a Postfix command or daemon process. proxy_interfaces (empty) - The remote network interface addresses that this mail system - receives mail on by way of a proxy or network address transla- + The remote network interface addresses that this mail system + receives mail on by way of a proxy or network address transla- tion unit. smtp_address_preference (any) The address type ("ipv6", "ipv4" or "any") that the Postfix SMTP - client will try first, when a destination has IPv6 and IPv4 + client will try first, when a destination has IPv6 and IPv4 addresses with equal MX preference. smtp_bind_address (empty) - An optional numerical network address that the Postfix SMTP + An optional numerical network address that the Postfix SMTP client should bind to when making an IPv4 connection. smtp_bind_address6 (empty) - An optional numerical network address that the Postfix SMTP + An optional numerical network address that the Postfix SMTP client should bind to when making an IPv6 connection. smtp_helo_name ($myhostname) @@ -1083,7 +1089,7 @@ SMTP(8) SMTP(8) The syslog facility of Postfix logging. syslog_name (see 'postconf -d' output) - A prefix that is prepended to the process name in syslog + A prefix that is prepended to the process name in syslog records, so that, for example, "smtpd" becomes "prefix/smtpd". Available with Postfix 2.2 and earlier: @@ -1095,14 +1101,14 @@ SMTP(8) SMTP(8) Available with Postfix 2.3 and later: smtp_fallback_relay ($fallback_relay) - Optional list of relay destinations that will be used when an - SMTP destination is not found, or when delivery fails due to a + Optional list of relay destinations that will be used when an + SMTP destination is not found, or when delivery fails due to a non-permanent error. Available with Postfix 3.0 and later: smtp_address_verify_target (rcpt) - In the context of email address verification, the SMTP protocol + In the context of email address verification, the SMTP protocol stage that determines whether an email address is deliverable. Available with Postfix 3.1 and later: @@ -1124,7 +1130,7 @@ SMTP(8) SMTP(8) Available in Postfix 3.7 and later: smtp_bind_address_enforce (no) - Defer delivery when the Postfix SMTP client cannot apply the + Defer delivery when the Postfix SMTP client cannot apply the smtp_bind_address or smtp_bind_address6 setting. SEE ALSO diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index 71b2b9e06..b3cf3373c 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -5974,6 +5974,16 @@ configuration parameter. See there for details.

This feature is available in Postfix 2.3 and later.

+ + +
lmtp_tls_loglevel_maps +(default: $smtp_tls_loglevel_maps)
+ +

The lmtp(8) equivalent of smtp_tls_loglevel_maps.

+ +

This feature is available in Postfix 3.12 and later.

+ +
lmtp_tls_mandatory_ciphers @@ -9827,6 +9837,18 @@ further details.

This feature is available in Postfix 3.12 and later.

+ + +
postscreen_tls_loglevel_maps +(default: $smtpd_tls_loglevel_maps)
+ +

Optional TLS loglevel override that depends on the remote peer +host name or IP address. See smtp_tls_loglevel_maps for a detailed +description. + +

This feature is available in Postfix 3.12 and later.

+ +
postscreen_tls_mandatory_ciphers @@ -14986,6 +15008,83 @@ problems. Use of loglevel 4 is strongly discouraged.

This feature is available in Postfix 2.2 and later.

+ + +
smtp_tls_loglevel_maps +(default: empty)
+ +

Optional TLS loglevel override that depends on the remote peer +host name or IP address. The text below also covers smtpd_tls_loglevel_maps +and postscreen_tls_loglevel_maps.

+ +

Specify zero or more lookup tables separated by comma or +whitespace. The table syntax is as follows:

+ +

    + +
  • On the left-hand side, specify a domain name, IPv4 or IPv6 +network address, or a substring pattern as described below. An +internationalized domain name MUST be in A-label form (xn--mumble). +An IPv4 address MUST be in dotted-quad form; an IPv6 address MUST +be in compressed form (text::text). Do not enclose any of these +inputs with "[" and "]".

    + +
  • On the right-hand side, specify a valid TLS loglevel value, +or "DUNNO" for a "quick exit" as described below.

    + +
+ +

The over-all search strategy is as follows:

+ +
    + +
  • Look up the peer name in all specified lookup tables, and +stop at the first match. If no match was found, this may be followed +by substring lookups as described below. Note: peer name lookup is +not applicable for postscreen(8) because that service does not have +the remote SMTP client name.

    + +
  • If no peer name match is found, look up the peer IP address +in all specified lookup tables, and stop at the first match. If no +match was found, this may be followed by substring lookups as +described below.

    + +
  • If any lookup result returns "DUNNO", terminate the search +and pretend that no name match and no address match were found. +

    + +
+ +

This feature may generate substring queries for a fixed-string +lookup table (examples: hash:, lmdb:, pgsql:). Substring queries +do not happen with regexp:, pcre:, and cidr: tables.

+ +
    + +
  • By default, after all table queries with a full domain +name (example: "mail.example.com") produce "not found", the next +queries will use the parent domains with '.' prepended (examples: +".example.com" and ".com") until a match is found or until all +substrings have been tried.

    + +
  • To generate domain name substring queries without the +leading '.' (examples: "example.com" and "com"), specify the +applicable configuration parameter name ("smtpd_tls_policy_maps", +"smtp_tls_policy_maps", or "postscreen_tls_policy_maps") in the +parent_domain_matches_subdomains parameter value.

    + +
  • After all table queries with a full IP address produce +"not found", the next queries will use subnetworks, by repeatedly +removing the last ".text" component from a dotted-quad IPv4 address, +or the last ":text" component from a compressed-form IPv6 address, +until a match is found or until all subnetworks have been tried. +

    + +
+ +

This feature is available in Postfix 3.12 and later.

+ +
smtp_tls_mandatory_ciphers @@ -20504,6 +20603,18 @@ of problems. Use of loglevel 4 is strongly discouraged.

This feature is available in Postfix 2.2 and later.

+ + +
smtpd_tls_loglevel_maps +(default: empty)
+ +

Optional TLS loglevel override that depends on the remote peer +host name or IP address. See smtp_tls_loglevel_maps for a detailed +description. + +

This feature is available in Postfix 3.12 and later.

+ +
smtpd_tls_mandatory_ciphers diff --git a/postfix/html/postscreen.8.html b/postfix/html/postscreen.8.html index cbb409a56..1f603e910 100644 --- a/postfix/html/postscreen.8.html +++ b/postfix/html/postscreen.8.html @@ -455,6 +455,10 @@ POSTSCREEN(8) POSTSCREEN(8) postscreen_tls_loglevel ($smtpd_tls_loglevel) The postscreen(8) equivalent of smtpd_tls_loglevel. + postscreen_tls_loglevel_maps ($smtpd_tls_loglevel_maps) + Optional TLS loglevel override that depends on the remote peer + host name or IP address. + postscreen_tls_mandatory_ciphers ($smtpd_tls_mandatory_ciphers) The postscreen(8) equivalent of smtpd_tls_mandatory_ciphers. @@ -473,11 +477,11 @@ POSTSCREEN(8) POSTSCREEN(8) The postscreen(8) equivalent of smtpd_tls_req_ccert. OBSOLETE STARTTLS SUPPORT CONTROLS - These parameters are supported for compatibility with smtpd(8) legacy + These parameters are supported for compatibility with smtpd(8) legacy parameters. postscreen_use_tls ($smtpd_use_tls) - Opportunistic TLS: announce STARTTLS support to remote SMTP + Opportunistic TLS: announce STARTTLS support to remote SMTP clients, but do not require that clients use TLS encryption. postscreen_enforce_tls ($smtpd_enforce_tls) @@ -486,18 +490,18 @@ POSTSCREEN(8) POSTSCREEN(8) MISCELLANEOUS CONTROLS config_directory (see 'postconf -d' output) - The default location of the Postfix main.cf and master.cf con- + The default location of the Postfix main.cf and master.cf con- figuration files. delay_logging_resolution_limit (2) - The maximal number of digits after the decimal point when log- + The maximal number of digits after the decimal point when log- ging delay values. command_directory (see 'postconf -d' output) The location of all postfix administrative commands. max_idle (100s) - The maximum amount of time that an idle Postfix daemon process + The maximum amount of time that an idle Postfix daemon process waits for an incoming connection before terminating voluntarily. process_id (read-only) @@ -510,7 +514,7 @@ POSTSCREEN(8) POSTSCREEN(8) The syslog facility of Postfix logging. syslog_name (see 'postconf -d' output) - A prefix that is prepended to the process name in syslog + A prefix that is prepended to the process name in syslog records, so that, for example, "smtpd" becomes "prefix/smtpd". Available in Postfix 3.3 and later: @@ -521,7 +525,7 @@ POSTSCREEN(8) POSTSCREEN(8) Available in Postfix 3.5 and later: info_log_address_format (external) - The email address form that will be used in non-debug logging + The email address form that will be used in non-debug logging (info, warning, etc.). SEE ALSO @@ -540,7 +544,7 @@ POSTSCREEN(8) POSTSCREEN(8) HISTORY This service was introduced with Postfix version 2.8. - Many ideas in postscreen(8) were explored in earlier work by Michael + Many ideas in postscreen(8) were explored in earlier work by Michael Tokarev, in OpenBSD spamd, and in MailChannels Traffic Control. AUTHOR(S) diff --git a/postfix/html/smtp.8.html b/postfix/html/smtp.8.html index a0bebb0e3..04e8ed84a 100644 --- a/postfix/html/smtp.8.html +++ b/postfix/html/smtp.8.html @@ -788,41 +788,47 @@ SMTP(8) SMTP(8) Enable logging of TLS feature information in delivery status logging. + Available in Postfix version 3.12 and later: + + smtp_tls_loglevel_maps (empty) + Optional TLS loglevel override that depends on the remote peer + host name or IP address. + OBSOLETE TLS CONTROLS - The following configuration parameters exist for compatibility with - Postfix versions before 2.3. Support for these will be removed in a + The following configuration parameters exist for compatibility with + Postfix versions before 2.3. Support for these will be removed in a future release. smtp_use_tls (no) - Opportunistic mode: use TLS when a remote SMTP server announces + Opportunistic mode: use TLS when a remote SMTP server announces STARTTLS support, otherwise send the mail in the clear. smtp_enforce_tls (no) - Enforcement mode: require that remote SMTP servers use TLS + Enforcement mode: require that remote SMTP servers use TLS encryption, and never send mail in the clear. smtp_tls_enforce_peername (yes) - With mandatory TLS encryption, require that the remote SMTP - server hostname matches the information in the remote SMTP + With mandatory TLS encryption, require that the remote SMTP + server hostname matches the information in the remote SMTP server certificate. smtp_tls_per_site (empty) - Optional lookup tables with the Postfix SMTP client TLS usage - policy by next-hop destination and by remote SMTP server host- + Optional lookup tables with the Postfix SMTP client TLS usage + policy by next-hop destination and by remote SMTP server host- name. smtp_tls_cipherlist (empty) - Obsolete Postfix < 2.3 control for the Postfix SMTP client TLS + Obsolete Postfix < 2.3 control for the Postfix SMTP client TLS cipher list. RESOURCE AND RATE CONTROLS smtp_connect_timeout (30s) - The Postfix SMTP client time limit for completing a TCP connec- + The Postfix SMTP client time limit for completing a TCP connec- tion, or zero (use the operating system built-in time limit). smtp_helo_timeout (300s) - The Postfix SMTP client time limit for sending the HELO or EHLO - command, and for receiving the initial remote SMTP server + The Postfix SMTP client time limit for sending the HELO or EHLO + command, and for receiving the initial remote SMTP server response. lmtp_lhlo_timeout (300s) @@ -834,19 +840,19 @@ SMTP(8) SMTP(8) mand, and for receiving the remote SMTP server response. smtp_mail_timeout (300s) - The Postfix SMTP client time limit for sending the MAIL FROM + The Postfix SMTP client time limit for sending the MAIL FROM command, and for receiving the remote SMTP server response. smtp_rcpt_timeout (300s) - The Postfix SMTP client time limit for sending the SMTP RCPT TO + The Postfix SMTP client time limit for sending the SMTP RCPT TO command, and for receiving the remote SMTP server response. smtp_data_init_timeout (120s) - The Postfix SMTP client time limit for sending the SMTP DATA + The Postfix SMTP client time limit for sending the SMTP DATA command, and for receiving the remote SMTP server response. smtp_data_xfer_timeout (180s) - The Postfix SMTP client time limit for sending the SMTP message + The Postfix SMTP client time limit for sending the SMTP message content. smtp_data_done_timeout (600s) @@ -860,13 +866,13 @@ SMTP(8) SMTP(8) Available in Postfix version 2.1 and later: smtp_mx_address_limit (5) - The maximal number of MX (mail exchanger) IP addresses that can - result from Postfix SMTP client mail exchanger lookups, or zero + The maximal number of MX (mail exchanger) IP addresses that can + result from Postfix SMTP client mail exchanger lookups, or zero (no limit). smtp_mx_session_limit (2) - The maximal number of SMTP sessions per delivery request before - the Postfix SMTP client gives up or delivers to a fall-back + The maximal number of SMTP sessions per delivery request before + the Postfix SMTP client gives up or delivers to a fall-back relay host, or zero (no limit). smtp_rset_timeout (20s) @@ -876,17 +882,17 @@ SMTP(8) SMTP(8) Available in Postfix version 2.2 and earlier: lmtp_cache_connection (yes) - Keep Postfix LMTP client connections open for up to $max_idle + Keep Postfix LMTP client connections open for up to $max_idle seconds. Available in Postfix version 2.2 and later: smtp_connection_cache_destinations (empty) - Permanently enable SMTP connection caching for the specified + Permanently enable SMTP connection caching for the specified destinations. smtp_connection_cache_on_demand (yes) - Temporarily enable SMTP connection caching while a destination + Temporarily enable SMTP connection caching while a destination has a high volume of mail in the active queue. smtp_connection_reuse_time_limit (300s) @@ -900,23 +906,23 @@ SMTP(8) SMTP(8) Available in Postfix version 2.3 and later: connection_cache_protocol_timeout (5s) - Time limit for connection cache connect, send or receive opera- + Time limit for connection cache connect, send or receive opera- tions. Available in Postfix version 2.9 - 3.6: smtp_per_record_deadline (no) - Change the behavior of the smtp_*_timeout time limits, from a - time limit per read or write system call, to a time limit to - send or receive a complete record (an SMTP command line, SMTP - response line, SMTP message content line, or TLS protocol mes- + Change the behavior of the smtp_*_timeout time limits, from a + time limit per read or write system call, to a time limit to + send or receive a complete record (an SMTP command line, SMTP + response line, SMTP message content line, or TLS protocol mes- sage). Available in Postfix version 2.11 and later: smtp_connection_reuse_count_limit (0) - When SMTP connection caching is enabled, the number of times - that an SMTP session may be reused before it is closed, or zero + When SMTP connection caching is enabled, the number of times + that an SMTP session may be reused before it is closed, or zero (no limit). Available in Postfix version 3.4 and later: @@ -927,13 +933,13 @@ SMTP(8) SMTP(8) Available in Postfix version 3.7 and later: smtp_per_request_deadline (no) - Change the behavior of the smtp_*_timeout time limits, from a - time limit per plaintext or TLS read or write call, to a com- - bined time limit for sending a complete SMTP request and for + Change the behavior of the smtp_*_timeout time limits, from a + time limit per plaintext or TLS read or write call, to a com- + bined time limit for sending a complete SMTP request and for receiving a complete SMTP response. smtp_min_data_rate (500) - The minimum plaintext data transfer rate in bytes/second for + The minimum plaintext data transfer rate in bytes/second for DATA requests, when deadlines are enabled with smtp_per_request_deadline. @@ -941,54 +947,54 @@ SMTP(8) SMTP(8) transport_destination_concurrency_limit ($default_destination_concur- rency_limit) - A transport-specific override for the default_destination_con- + A transport-specific override for the default_destination_con- currency_limit parameter value, where transport is the master.cf name of the message delivery transport. transport_destination_recipient_limit ($default_destination_recipi- ent_limit) A transport-specific override for the default_destination_recip- - ient_limit parameter value, where transport is the master.cf + ient_limit parameter value, where transport is the master.cf name of the message delivery transport. SMTPUTF8 CONTROLS Preliminary SMTPUTF8 support is introduced with Postfix 3.0. smtputf8_enable (yes) - Enable preliminary SMTPUTF8 support for the protocols described + Enable preliminary SMTPUTF8 support for the protocols described in RFC 6531, RFC 6532, and RFC 6533. smtputf8_autodetect_classes (sendmail, verify) - Detect that a message requires SMTPUTF8 support for the speci- + Detect that a message requires SMTPUTF8 support for the speci- fied mail origin classes. Available in Postfix version 3.2 and later: enable_idna2003_compatibility (no) - Enable 'transitional' compatibility between IDNA2003 and - IDNA2008, when converting UTF-8 domain names to/from the ASCII + Enable 'transitional' compatibility between IDNA2003 and + IDNA2008, when converting UTF-8 domain names to/from the ASCII form that is used for DNS lookups. TROUBLE SHOOTING CONTROLS debug_peer_level (2) - The increment in verbose logging level when a nexthop destina- - tion, remote client or server name or network address matches a + The increment in verbose logging level when a nexthop destina- + tion, remote client or server name or network address matches a pattern given with the debug_peer_list parameter. debug_peer_list (empty) - Optional list of nexthop destination, remote client or server - name or network address patterns that, if matched, cause the - verbose logging level to increase by the amount specified in + Optional list of nexthop destination, remote client or server + name or network address patterns that, if matched, 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 + The recipient of postmaster notifications about mail delivery problems that are caused by policy, resource, software or proto- col errors. internal_mail_filter_classes (empty) - What categories of Postfix-generated mail are subject to - before-queue content inspection by non_smtpd_milters, + What categories of Postfix-generated mail are subject to + before-queue content inspection by non_smtpd_milters, header_checks and body_checks. notify_classes (resource, software) @@ -996,46 +1002,46 @@ SMTP(8) SMTP(8) MISCELLANEOUS CONTROLS best_mx_transport (empty) - Where the Postfix SMTP client should deliver mail when it + Where the Postfix SMTP client should deliver mail when it detects a "mail loops back to myself" error condition. config_directory (see 'postconf -d' output) - The default location of the Postfix main.cf and master.cf con- + The default location of the Postfix main.cf and master.cf con- figuration files. daemon_timeout (18000s) - How much time a Postfix daemon process may take to handle a + How much time a Postfix daemon process may take to handle a request before it is terminated by a built-in watchdog timer. delay_logging_resolution_limit (2) - The maximal number of digits after the decimal point when log- + The maximal number of digits after the decimal point when log- ging delay values. disable_dns_lookups (no) Disable DNS lookups in the Postfix SMTP and LMTP clients. inet_interfaces (all) - The local network interface addresses that this mail system + The local network interface addresses that this mail system receives mail on. inet_protocols (see 'postconf -d' output) - The Internet protocols Postfix will attempt to use when making + The Internet protocols Postfix will attempt to use when making or accepting connections. ipc_timeout (3600s) - The time limit for sending or receiving information over an + The time limit for sending or receiving information over an internal communication channel. lmtp_assume_final (no) - When a remote LMTP server announces no DSN support, assume that - the server performs final delivery, and send "delivered" deliv- + When a remote LMTP server announces no DSN support, assume that + the server performs final delivery, and send "delivered" deliv- ery status notifications instead of "relayed". lmtp_tcp_port (24) The default TCP port that the Postfix LMTP client connects to. max_idle (100s) - The maximum amount of time that an idle Postfix daemon process + The maximum amount of time that an idle Postfix daemon process waits for an incoming connection before terminating voluntarily. max_use (100) @@ -1049,21 +1055,21 @@ SMTP(8) SMTP(8) The process name of a Postfix command or daemon process. proxy_interfaces (empty) - The remote network interface addresses that this mail system - receives mail on by way of a proxy or network address transla- + The remote network interface addresses that this mail system + receives mail on by way of a proxy or network address transla- tion unit. smtp_address_preference (any) The address type ("ipv6", "ipv4" or "any") that the Postfix SMTP - client will try first, when a destination has IPv6 and IPv4 + client will try first, when a destination has IPv6 and IPv4 addresses with equal MX preference. smtp_bind_address (empty) - An optional numerical network address that the Postfix SMTP + An optional numerical network address that the Postfix SMTP client should bind to when making an IPv4 connection. smtp_bind_address6 (empty) - An optional numerical network address that the Postfix SMTP + An optional numerical network address that the Postfix SMTP client should bind to when making an IPv6 connection. smtp_helo_name ($myhostname) @@ -1083,7 +1089,7 @@ SMTP(8) SMTP(8) The syslog facility of Postfix logging. syslog_name (see 'postconf -d' output) - A prefix that is prepended to the process name in syslog + A prefix that is prepended to the process name in syslog records, so that, for example, "smtpd" becomes "prefix/smtpd". Available with Postfix 2.2 and earlier: @@ -1095,14 +1101,14 @@ SMTP(8) SMTP(8) Available with Postfix 2.3 and later: smtp_fallback_relay ($fallback_relay) - Optional list of relay destinations that will be used when an - SMTP destination is not found, or when delivery fails due to a + Optional list of relay destinations that will be used when an + SMTP destination is not found, or when delivery fails due to a non-permanent error. Available with Postfix 3.0 and later: smtp_address_verify_target (rcpt) - In the context of email address verification, the SMTP protocol + In the context of email address verification, the SMTP protocol stage that determines whether an email address is deliverable. Available with Postfix 3.1 and later: @@ -1124,7 +1130,7 @@ SMTP(8) SMTP(8) Available in Postfix 3.7 and later: smtp_bind_address_enforce (no) - Defer delivery when the Postfix SMTP client cannot apply the + Defer delivery when the Postfix SMTP client cannot apply the smtp_bind_address or smtp_bind_address6 setting. SEE ALSO diff --git a/postfix/html/smtpd.8.html b/postfix/html/smtpd.8.html index b05167646..75800d0e9 100644 --- a/postfix/html/smtpd.8.html +++ b/postfix/html/smtpd.8.html @@ -672,109 +672,115 @@ SMTPD(8) SMTPD(8) (EKU) lists only serverAuth and not clientAuth as valid TLS client certificates. + Available in Postfix version 3.12 and later: + + smtpd_tls_loglevel_maps (empty) + Optional TLS loglevel override that depends on the remote peer + host name or IP address. + OBSOLETE TLS CONTROLS - The following configuration parameters exist for compatibility with - Postfix versions before 2.3. Support for these will be removed in a + The following configuration parameters exist for compatibility with + Postfix versions before 2.3. Support for these will be removed in a future release. smtpd_use_tls (no) - Opportunistic TLS: announce STARTTLS support to remote SMTP + Opportunistic TLS: announce STARTTLS support to remote SMTP clients, but do not require that clients use TLS encryption. smtpd_enforce_tls (no) Mandatory TLS: announce STARTTLS support to remote SMTP clients, - and reject all plaintext commands except HELO, EHLO, XCLIENT, + and reject all plaintext commands except HELO, EHLO, XCLIENT, STARTTLS, NOOP, QUIT, and (Postfix >= 3.9) HELP. smtpd_tls_cipherlist (empty) - Obsolete Postfix < 2.3 control for the Postfix SMTP server TLS + Obsolete Postfix < 2.3 control for the Postfix SMTP server TLS cipher list. SMTPUTF8 CONTROLS Preliminary SMTPUTF8 support is introduced with Postfix 3.0. smtputf8_enable (yes) - Enable preliminary SMTPUTF8 support for the protocols described + Enable preliminary SMTPUTF8 support for the protocols described in RFC 6531, RFC 6532, and RFC 6533. strict_smtputf8 (no) Enable stricter enforcement of the SMTPUTF8 protocol. smtputf8_autodetect_classes (sendmail, verify) - Detect that a message requires SMTPUTF8 support for the speci- + Detect that a message requires SMTPUTF8 support for the speci- fied mail origin classes. Available in Postfix version 3.2 and later: enable_idna2003_compatibility (no) - Enable 'transitional' compatibility between IDNA2003 and - IDNA2008, when converting UTF-8 domain names to/from the ASCII + Enable 'transitional' compatibility between IDNA2003 and + IDNA2008, when converting UTF-8 domain names to/from the ASCII form that is used for DNS lookups. VERP SUPPORT CONTROLS - With VERP style delivery, each recipient of a message receives a cus- - tomized copy of the message with his/her own recipient address encoded + With VERP style delivery, each recipient of a message receives a cus- + tomized copy of the message with his/her own recipient address encoded in the envelope sender address. The VERP_README file describes config- - uration and operation 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 + uration and operation 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. default_verp_delimiters (+=) The two default VERP delimiter characters. verp_delimiter_filter (-=+) - The characters Postfix accepts as VERP delimiter characters on + 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 remote SMTP clients are allowed to specify the XVERP com- + What remote SMTP clients are allowed to specify the XVERP com- mand. Available in Postfix version 2.1 and later: smtpd_authorized_verp_clients ($authorized_verp_clients) - What remote SMTP clients are allowed to specify the XVERP com- + What remote SMTP clients are allowed to specify the XVERP com- mand. 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 + 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 processes under control of a call tracer or debugger. debug_peer_level (2) - The increment in verbose logging level when a nexthop destina- - tion, remote client or server name or network address matches a + The increment in verbose logging level when a nexthop destina- + tion, remote client or server name or network address matches a pattern given with the debug_peer_list parameter. debug_peer_list (empty) - Optional list of nexthop destination, remote client or server - name or network address patterns that, if matched, cause the - verbose logging level to increase by the amount specified in + Optional list of nexthop destination, remote client or server + name or network address patterns that, if matched, 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 + The recipient of postmaster notifications about mail delivery problems that are caused by policy, resource, software or proto- col errors. internal_mail_filter_classes (empty) - What categories of Postfix-generated mail are subject to - before-queue content inspection by non_smtpd_milters, + What categories of Postfix-generated mail are subject to + before-queue content inspection by non_smtpd_milters, header_checks and body_checks. notify_classes (resource, software) The list of error classes that are reported to the postmaster. smtpd_reject_footer (empty) - Optional information that is appended after each Postfix SMTP + Optional information that is appended after each Postfix SMTP server 4XX or 5XX response. soft_bounce (no) - Safety net to keep mail queued that would otherwise be returned + Safety net to keep mail queued that would otherwise be returned to the sender. Available in Postfix version 2.1 and later: @@ -785,49 +791,49 @@ SMTPD(8) SMTPD(8) Available in Postfix version 2.10 and later: smtpd_log_access_permit_actions (empty) - Enable logging of the named "permit" actions in SMTP server - access lists (by default, the SMTP server logs "reject" actions + Enable logging of the named "permit" actions in SMTP server + access lists (by default, the SMTP server logs "reject" actions but not "permit" actions). KNOWN VERSUS UNKNOWN RECIPIENT CONTROLS - As of Postfix version 2.0, the SMTP server rejects mail for unknown + As of Postfix version 2.0, the SMTP server rejects mail for unknown recipients. This prevents the mail queue from clogging up with undeliv- - erable MAILER-DAEMON messages. Additional information on this topic is + erable 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 "User unknown" + Display the name of the recipient table in the "User unknown" responses. canonical_maps (empty) - Optional address mapping lookup tables for message headers and + Optional address mapping lookup tables for message headers and envelopes. recipient_canonical_maps (empty) - Optional address mapping lookup tables for envelope and header + Optional address mapping lookup tables for envelope and header recipient addresses. sender_canonical_maps (empty) - Optional address mapping lookup tables for envelope and header + Optional address mapping lookup tables for envelope and header sender addresses. Parameters concerning known/unknown local recipients: mydestination ($myhostname, localhost.$mydomain, localhost) - The list of domains that are delivered via the $local_transport + The list of domains that are delivered via the $local_transport mail delivery transport. inet_interfaces (all) - The local network interface addresses that this mail system + The local network interface addresses that this mail system receives mail on. proxy_interfaces (empty) - The remote network interface addresses that this mail system - receives mail on by way of a proxy or network address transla- + The remote network interface addresses that this mail system + receives mail on by way of a proxy or network address transla- tion unit. inet_protocols (see 'postconf -d' output) - The Internet protocols Postfix will attempt to use when making + The Internet protocols Postfix will attempt to use when making or accepting connections. local_recipient_maps (proxy:unix:passwd.byname $alias_maps) @@ -836,61 +842,61 @@ SMTPD(8) SMTPD(8) 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 + 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 destinations: relay_domains (Postfix >= 3.0: empty, Postfix < 3.0: $mydestination) - What destination domains (and subdomains thereof) this system + What destination domains (and subdomains thereof) this system will relay mail to. relay_recipient_maps (empty) - Optional lookup tables with all valid addresses in the domains + 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 speci- - fies a list of lookup tables that does not match the recipient + The numerical Postfix SMTP server reply code when a recipient + address matches $relay_domains, and relay_recipient_maps speci- + fies a list of lookup tables that does not match the recipient address. - Parameters concerning known/unknown recipients in virtual alias + Parameters concerning known/unknown recipients in virtual alias domains: virtual_alias_domains ($virtual_alias_maps) - Postfix is the final destination for the specified list of vir- + Postfix is the final destination for the specified list of vir- tual 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 are often searched with a full email - address (including domain) and that apply to all recipients: - local(8), virtual, and remote; this is unlike alias_maps that - are only searched with an email address localpart (no domain) + address (including domain) and that apply to all recipients: + local(8), virtual, and remote; this is unlike alias_maps that + are only searched with an email address localpart (no domain) and that apply only to local(8) recipients. unknown_virtual_alias_reject_code (550) - The Postfix SMTP server reply code when a recipient address - matches $virtual_alias_domains, and $virtual_alias_maps speci- - fies a list of lookup tables that does not match the recipient + The Postfix SMTP server reply code when a recipient address + matches $virtual_alias_domains, and $virtual_alias_maps speci- + fies a list of lookup tables that does not match the recipient address. Parameters concerning known/unknown recipients in virtual mailbox domains: virtual_mailbox_domains ($virtual_mailbox_maps) - Postfix is the final destination for the specified list of - domains; mail is delivered via the $virtual_transport mail + Postfix is the final destination for the specified list of + domains; mail is delivered via the $virtual_transport mail delivery transport. virtual_mailbox_maps (empty) - Optional lookup tables with all valid addresses in the domains + Optional lookup tables with all valid addresses in the domains that match $virtual_mailbox_domains. unknown_virtual_mailbox_reject_code (550) - The Postfix SMTP server reply code when a recipient address - matches $virtual_mailbox_domains, and $virtual_mailbox_maps + The Postfix SMTP server reply code when a recipient address + matches $virtual_mailbox_domains, and $virtual_mailbox_maps specifies a list of lookup tables that does not match the recip- ient address. @@ -899,7 +905,7 @@ SMTPD(8) SMTPD(8) control client request rates. line_length_limit (2048) - Upon input, long lines are chopped up into pieces of at most + Upon input, long lines are chopped up into pieces of at most this length; upon delivery, long lines are reconstructed. queue_minfree (0) @@ -907,62 +913,62 @@ SMTPD(8) SMTPD(8) tem that is needed to receive mail. message_size_limit (10240000) - The maximal size in bytes of a message, including envelope + The maximal size in bytes of a message, including envelope information. smtpd_recipient_limit (1000) - The maximal number of recipients that the Postfix SMTP server + The maximal number of recipients that the Postfix SMTP server accepts per message delivery request. smtpd_timeout (normal: 300s, overload: 10s) - When the Postfix SMTP server wants to send an SMTP server - response, how long the Postfix SMTP server will wait for an - underlying network write operation to complete; and when the - Postfix SMTP server Postfix wants to receive an SMTP client - request, how long the Postfix SMTP server will wait for an + When the Postfix SMTP server wants to send an SMTP server + response, how long the Postfix SMTP server will wait for an + underlying network write operation to complete; and when the + Postfix SMTP server Postfix wants to receive an SMTP client + request, how long the Postfix SMTP server will wait for an underlying network read operation to complete. smtpd_history_flush_threshold (100) - The maximal number of lines in the Postfix SMTP server command - history before it is flushed upon receipt of EHLO, RSET, or end + 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. Available in Postfix version 2.3 and later: smtpd_peername_lookup (yes) - Attempt to look up the remote SMTP client hostname, and verify + Attempt to look up the remote SMTP client hostname, and verify that the name matches the client IP address. The per SMTP client connection count and request rate limits are imple- - mented in co-operation with the anvil(8) service, and are available in + mented in co-operation with the anvil(8) service, and are available in Postfix version 2.2 and later. smtpd_client_connection_count_limit (50) - How many simultaneous connections any client is allowed to make + 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 + The maximal number of connection attempts any 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 per time unit, regardless of + 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 unit, regardless of + 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 smtpd_client_*_count/rate_limit + Clients that are excluded from smtpd_client_*_count/rate_limit restrictions. Available in Postfix version 2.3 and later: smtpd_client_new_tls_session_rate_limit (0) - The maximal number of new (i.e., uncached) TLS sessions that a + The maximal number of new (i.e., uncached) TLS sessions that a remote SMTP client is allowed to negotiate with this service per time unit. @@ -970,29 +976,29 @@ SMTPD(8) SMTPD(8) smtpd_per_record_deadline (normal: no, overload: yes) Change the behavior of the smtpd_timeout and smtpd_start- - tls_timeout time limits, from a time limit per read or write - system call, to a time limit to send or receive a complete - record (an SMTP command line, SMTP response line, SMTP message + tls_timeout time limits, from a time limit per read or write + system call, to a time limit to send or receive a complete + record (an SMTP command line, SMTP response line, SMTP message content line, or TLS protocol message). Available in Postfix version 3.1 and later: smtpd_client_auth_rate_limit (0) - The maximal number of AUTH commands that any client is allowed - to send to this service per time unit, regardless of whether or + The maximal number of AUTH commands that any client is allowed + to send to this service per time unit, regardless of whether or not Postfix actually accepts those commands. Available in Postfix version 3.7 and later: smtpd_per_request_deadline (normal: no, overload: yes) Change the behavior of the smtpd_timeout and smtpd_start- - tls_timeout time limits, from a time limit per plaintext or TLS - read or write call, to a combined time limit for receiving a - complete SMTP request and for sending a complete SMTP response. + tls_timeout time limits, from a time limit per plaintext or TLS + read or write call, to a combined time limit for receiving a + complete SMTP request and for sending a complete SMTP response. smtpd_min_data_rate (500) - The minimum plaintext data transfer rate in bytes/second for - DATA and BDAT requests, when deadlines are enabled with + The minimum plaintext data transfer rate in bytes/second for + DATA and BDAT requests, when deadlines are enabled with smtpd_per_request_deadline. header_from_format (standard) @@ -1001,27 +1007,27 @@ SMTPD(8) SMTPD(8) Available in Postfix version 3.8 and later: smtpd_client_ipv4_prefix_length (32) - Aggregate smtpd_client_*_count and smtpd_client_*_rate statis- + Aggregate smtpd_client_*_count and smtpd_client_*_rate statis- tics by IPv4 network blocks with the specified network prefix. smtpd_client_ipv6_prefix_length (84) - Aggregate smtpd_client_*_count and smtpd_client_*_rate statis- + Aggregate smtpd_client_*_count and smtpd_client_*_rate statis- tics by IPv6 network blocks with the specified network prefix. Available in Postfix 3.9, 3.8.1, 3.7.6, 3.6.10, 3.5.20 and later: smtpd_forbid_unauth_pipelining (Postfix >= 3.9: yes) - Disconnect remote SMTP clients that violate RFC 2920 (or 5321) + Disconnect remote SMTP clients that violate RFC 2920 (or 5321) command pipelining constraints. Available in Postfix 3.9, 3.8.4, 3.7.9, 3.6.13, 3.5.23 and later: smtpd_forbid_bare_newline (Postfix >= 3.9: normalize) - Reject or restrict input lines from an SMTP client that end in + Reject or restrict input lines from an SMTP client that end in <LF> instead of the standard <CR><LF>. smtpd_forbid_bare_newline_exclusions ($mynetworks) - Exclude the specified clients from smtpd_forbid_bare_newline + Exclude the specified clients from smtpd_forbid_bare_newline enforcement. Available in Postfix 3.9, 3.8.5, 3.7.10, 3.6.14, 3.5.24 and later: @@ -1031,55 +1037,55 @@ SMTPD(8) SMTPD(8) request with "smtpd_forbid_bare_newline = reject". 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 controlled by an error counter that counts + 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 controlled 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 version 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 + With Postfix version 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 Postfix SMTP server slows + 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 (normal: 20, overload: 1) - The maximal number of errors a remote SMTP client is allowed to + The maximal number of errors a remote SMTP client is allowed to make without delivering mail. smtpd_junk_command_limit (normal: 100, overload: 1) - The number of junk commands (NOOP, VRFY, ETRN or RSET) that a - remote SMTP client can send before the Postfix SMTP server + 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 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 + 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 + before the Postfix SMTP 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 + 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 connection is + The time after which an idle SMTPD policy service connection is closed. smtpd_policy_service_max_ttl (1000s) - The time after which an active SMTPD policy service connection + The time after which an active SMTPD policy service connection is closed. smtpd_policy_service_timeout (100s) - The time limit for connecting to, writing to, or receiving from + The time limit for connecting to, writing to, or receiving from a delegated SMTPD policy server. Available in Postfix version 3.0 and later: @@ -1089,81 +1095,81 @@ SMTPD(8) SMTPD(8) The default action when an SMTPD policy service request fails. smtpd_policy_service_request_limit (0) - The maximal number of requests per SMTPD policy service connec- + The maximal number of requests per SMTPD policy service connec- tion, or zero (no limit). smtpd_policy_service_try_limit (2) - The maximal number of attempts to send an SMTPD policy service + The maximal number of attempts to send an SMTPD policy service request before giving up. smtpd_policy_service_retry_delay (1s) - The delay between attempts to resend a failed SMTPD policy ser- + The delay between attempts to resend a failed SMTPD policy ser- vice request. Available in Postfix version 3.1 and later: smtpd_policy_service_policy_context (empty) - Optional information that the Postfix SMTP server specifies in - the "policy_context" attribute of a policy service request - (originally, to share the same service endpoint among multiple + Optional information that the Postfix SMTP server specifies in + the "policy_context" attribute of a policy service request + (originally, to share the same service endpoint among multiple check_policy_service clients). ACCESS CONTROLS - The SMTPD_ACCESS_README document gives an introduction to all the SMTP + 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_restrictions and $smtpd_sender_restrictions, or wait until the ETRN command - before evaluating $smtpd_client_restrictions and + before evaluating $smtpd_client_restrictions and $smtpd_helo_restrictions. parent_domain_matches_subdomains (see 'postconf -d' output) - A list of Postfix features where the pattern "example.com" also - matches subdomains of example.com, instead of requiring an + A list of Postfix features where the pattern "example.com" also + matches subdomains of example.com, instead of requiring an explicit ".example.com" pattern. smtpd_client_restrictions (empty) - Optional restrictions that the Postfix SMTP server applies in + Optional restrictions that the Postfix SMTP server applies in the context of a client connection request. smtpd_helo_required (no) - Require that a remote SMTP client introduces itself with the - HELO or EHLO command before sending the MAIL command or other + Require that a remote SMTP client introduces itself with the + HELO or EHLO command before sending the MAIL command or other commands that require EHLO negotiation. smtpd_helo_restrictions (empty) - Optional restrictions that the Postfix SMTP server applies in + Optional restrictions that the Postfix SMTP server applies in the context of a client HELO command. smtpd_sender_restrictions (empty) - Optional restrictions that the Postfix SMTP server applies in + Optional restrictions that the Postfix SMTP server applies in the context of a client MAIL FROM command. smtpd_recipient_restrictions (see 'postconf -d' output) - Optional restrictions that the Postfix SMTP server applies in - the context of a client RCPT TO command, after + Optional restrictions that the Postfix SMTP server applies in + the context of a client RCPT TO command, after smtpd_relay_restrictions. smtpd_etrn_restrictions (empty) - Optional restrictions that the Postfix SMTP server applies in + Optional restrictions that the Postfix SMTP server applies in the context of a client ETRN command. allow_untrusted_routing (no) - Forward mail with sender-specified routing - (user[@%!]remote[@%!]site) from untrusted clients to destina- + Forward mail with sender-specified routing + (user[@%!]remote[@%!]site) from untrusted clients to destina- tions matching $relay_domains. smtpd_restriction_classes (empty) User-defined aliases for groups of access restrictions. smtpd_null_access_lookup_key (<>) - The lookup key to be used in SMTP access(5) tables instead of + 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 + Restrict the use of the permit_mx_backup SMTP access feature to only domains whose primary MX hosts match the listed networks. Available in Postfix version 2.0 and later: @@ -1173,19 +1179,19 @@ SMTPD(8) SMTPD(8) applies in the context of the SMTP DATA command. smtpd_expansion_filter (see 'postconf -d' output) - What characters are allowed in $name expansions of RBL reply + 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 + 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 for unknown - recipient addresses, even when no explicit + Request that the Postfix SMTP server rejects mail for unknown + recipient addresses, even when no explicit reject_unlisted_recipient access restriction is specified. Available in Postfix version 2.2 and later: @@ -1199,17 +1205,17 @@ SMTPD(8) SMTPD(8) smtpd_relay_restrictions (permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination) Access restrictions for mail relay control that the Postfix SMTP - server applies in the context of the RCPT TO command, before + server applies in the context of the RCPT TO command, before smtpd_recipient_restrictions. SENDER AND RECIPIENT ADDRESS VERIFICATION CONTROLS - Postfix version 2.1 introduces sender and recipient address verifica- + Postfix version 2.1 introduces sender and recipient address verifica- tion. This feature is implemented by sending probe email messages that are not actually delivered. This feature is requested via the - reject_unverified_sender and reject_unverified_recipient access - restrictions. The status of verification probes is maintained by the - verify(8) server. See the file ADDRESS_VERIFICATION_README for infor- - mation about how to configure and operate the Postfix sender/recipient + reject_unverified_sender and reject_unverified_recipient access + restrictions. The status of verification probes is maintained by the + verify(8) server. See the file ADDRESS_VERIFICATION_README for infor- + mation about how to configure and operate the Postfix sender/recipient address verification service. address_verify_poll_count (normal: 3, overload: 1) @@ -1221,7 +1227,7 @@ SMTPD(8) SMTPD(8) fication request in progress. address_verify_sender ($double_bounce_sender) - The sender address to use in address verification probes; prior + The sender address to use in address verification probes; prior to Postfix 2.5 the default was "postmaster". unverified_sender_reject_code (450) @@ -1229,18 +1235,18 @@ SMTPD(8) SMTPD(8) address is rejected by the reject_unverified_sender restriction. unverified_recipient_reject_code (450) - The numerical Postfix SMTP server response when a recipient - address is rejected by the reject_unverified_recipient restric- + The numerical Postfix SMTP server response when a recipient + address is rejected by the reject_unverified_recipient restric- tion. Available in Postfix version 2.6 and later: unverified_sender_defer_code (450) - The numerical Postfix SMTP server response code when a sender + The numerical Postfix SMTP server response code when a sender address probe fails due to a temporary error condition. unverified_recipient_defer_code (450) - The numerical Postfix SMTP server response when a recipient + The numerical Postfix SMTP server response when a recipient address probe fails due to a temporary error condition. unverified_sender_reject_reason (empty) @@ -1252,17 +1258,17 @@ SMTPD(8) SMTPD(8) reject_unverified_recipient. unverified_sender_tempfail_action ($reject_tempfail_action) - The Postfix SMTP server's action when reject_unverified_sender + The Postfix SMTP server's action when reject_unverified_sender fails due to a temporary error condition. unverified_recipient_tempfail_action ($reject_tempfail_action) - The Postfix SMTP server's action when reject_unverified_recipi- + The Postfix SMTP server's action when reject_unverified_recipi- ent fails due to a temporary error condition. Available with Postfix 2.9 and later: address_verify_sender_ttl (0s) - The time between changes in the time-dependent portion of + The time between changes in the time-dependent portion of address verification probe sender addresses. ACCESS CONTROL RESPONSES @@ -1274,36 +1280,36 @@ SMTPD(8) SMTPD(8) map "reject" action. defer_code (450) - The numerical Postfix SMTP server response code when a remote + 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 + The numerical Postfix SMTP server response code when the client + HELO or EHLO command parameter is rejected by the reject_invalid_helo_hostname restriction. maps_rbl_reject_code (554) - The numerical Postfix SMTP server response code when a remote - SMTP client request is blocked by the reject_rbl_client, + 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_reverse_client, reject_rhsbl_sender or reject_rhsbl_recipient restriction. non_fqdn_reject_code (504) - The numerical Postfix SMTP server reply code when a client - request is rejected by the reject_non_fqdn_helo_hostname, + The numerical Postfix SMTP server reply code when a client + request is rejected by the reject_non_fqdn_helo_hostname, reject_non_fqdn_sender or reject_non_fqdn_recipient restriction. plaintext_reject_code (450) - The numerical Postfix SMTP server response code when a request + The numerical Postfix SMTP server response code when a request is rejected by the reject_plaintext_session restriction. reject_code (554) - The numerical Postfix SMTP server response code when a remote + 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 reject_unauth_destination recipient + 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) @@ -1311,24 +1317,24 @@ SMTPD(8) SMTPD(8) a sender or recipient address because its domain is unknown. unknown_client_reject_code (450) - The numerical Postfix SMTP server response code when a client - without valid address <=> name mapping is rejected by the + The numerical Postfix SMTP server response code when a client + without valid address <=> name mapping is rejected by the reject_unknown_client_hostname restriction. unknown_hostname_reject_code (450) - The numerical Postfix SMTP server response code when the host- - name specified with the HELO or EHLO command is rejected by the + The numerical Postfix SMTP server response code when the host- + name specified with the HELO or EHLO command is rejected by the reject_unknown_helo_hostname restriction. Available in Postfix version 2.0 and later: default_rbl_reply (see 'postconf -d' output) - The default Postfix SMTP server response template for a request + The default Postfix SMTP server response template for a request that is rejected by an RBL-based restriction. multi_recipient_bounce_reject_code (550) - The numerical Postfix SMTP server response code when a remote - SMTP client request is blocked by the reject_multi_recipi- + The numerical Postfix SMTP server response code when a remote + SMTP client request is blocked by the reject_multi_recipi- ent_bounce restriction. rbl_reply_maps (empty) @@ -1338,52 +1344,52 @@ SMTPD(8) SMTPD(8) access_map_defer_code (450) The numerical Postfix SMTP server response code for an access(5) - map "defer" action, including "defer_if_permit" or + map "defer" action, including "defer_if_permit" or "defer_if_reject". reject_tempfail_action (defer_if_permit) - The Postfix SMTP server's action when a reject-type restriction + The Postfix SMTP server's action when a reject-type restriction fails due to a temporary error condition. unknown_helo_hostname_tempfail_action ($reject_tempfail_action) - The Postfix SMTP server's action when reject_unknown_helo_host- + The Postfix SMTP server's action when reject_unknown_helo_host- name fails due to a temporary error condition. unknown_address_tempfail_action ($reject_tempfail_action) - The Postfix SMTP server's action when - reject_unknown_sender_domain or reject_unknown_recipient_domain + The Postfix SMTP server's action when + reject_unknown_sender_domain or reject_unknown_recipient_domain fail due to a temporary error condition. MISCELLANEOUS CONTROLS config_directory (see 'postconf -d' output) - The default location of the Postfix main.cf and master.cf con- + The default location of the Postfix main.cf and master.cf con- figuration files. daemon_timeout (18000s) - How much time a Postfix daemon process may take to handle 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 commands. double_bounce_sender (double-bounce) - The sender address of postmaster notifications that are gener- + The sender address of postmaster notifications that are gener- ated by the mail system. ipc_timeout (3600s) - The time limit for sending or receiving information over an + The time limit for sending or receiving information over an internal communication channel. mail_name (Postfix) - The mail system name that is displayed in Received: headers, in + The mail system name that is displayed in Received: headers, in the SMTP greeting banner, and in bounced mail. mail_owner (postfix) - The UNIX system account that owns the Postfix queue and most + The UNIX system account that owns the Postfix queue and most Postfix daemon processes. max_idle (100s) - The maximum amount of time that an idle Postfix daemon process + The maximum amount of time that an idle Postfix daemon process waits for an incoming connection before terminating voluntarily. max_use (100) @@ -1394,11 +1400,11 @@ SMTPD(8) SMTPD(8) The internet hostname of this mail system. mynetworks (see 'postconf -d' output) - The list of "trusted" remote SMTP clients that have more privi- + The list of "trusted" remote SMTP clients that have more privi- leges than "strangers". myorigin ($myhostname) - The domain name that locally-posted mail appears to come from, + The domain name that locally-posted mail appears to come from, and that locally posted mail is delivered to. process_id (read-only) @@ -1411,24 +1417,24 @@ SMTPD(8) SMTPD(8) The location of the Postfix top-level queue directory. recipient_delimiter (empty) - The set of characters that can separate an email address local- + The set of characters that can separate an email address local- part, user name, or a .forward file name from its extension. smtpd_banner ($myhostname ESMTP $mail_name) - The text that follows the 220 status code in the SMTP greeting + The text that follows the 220 status code in the SMTP greeting banner. syslog_facility (mail) The syslog facility of Postfix logging. syslog_name (see 'postconf -d' output) - A prefix that is prepended to the process name in syslog + A prefix that is prepended to the process name in syslog records, so that, for example, "smtpd" becomes "prefix/smtpd". Available in Postfix version 2.2 and later: smtpd_forbidden_commands (CONNECT GET POST regexp:{{/^[^A-Z]/ Bogus}}) - List of commands that cause the Postfix SMTP server to immedi- + List of commands that cause the Postfix SMTP server to immedi- ately terminate the session with a 221 code. Available in Postfix version 2.5 and later: @@ -1445,20 +1451,20 @@ SMTPD(8) SMTPD(8) Available in Postfix 3.4 and later: smtpd_reject_footer_maps (empty) - Lookup tables, indexed by the complete Postfix SMTP server 4xx + Lookup tables, indexed by the complete Postfix SMTP server 4xx or 5xx response, with reject footer templates. Available in Postfix 3.10 and later: smtpd_hide_client_session (no) - Do not include SMTP client session information in the Postfix + Do not include SMTP client session information in the Postfix SMTP server's Received: message header. Available in Postfix version 3.11 and later: smtpd_reject_filter_maps (empty) - An optional filter that can replace a reject response from the - Postfix SMTP server itself, or from a program that replies + An optional filter that can replace a reject response from the + Postfix SMTP server itself, or from a program that replies through the Postfix SMTP server. SEE ALSO diff --git a/postfix/makedefs b/postfix/makedefs index 79f32656a..d21749a23 100644 --- a/postfix/makedefs +++ b/postfix/makedefs @@ -280,27 +280,9 @@ case "$SYSTEM.$RELEASE" in *) error "Seems to be UnixWare`uname -v`. Untested.";; esac ;; - FreeBSD.2*) SYSTYPE=FREEBSD2 +FreeBSD.[2-7].*) SYSTYPE=FREEBSD$RELEASE_MAJOR ;; - FreeBSD.3*) SYSTYPE=FREEBSD3 - ;; - FreeBSD.4*) SYSTYPE=FREEBSD4 - ;; - FreeBSD.5*) SYSTYPE=FREEBSD5 - ;; - FreeBSD.6*) SYSTYPE=FREEBSD6 - ;; - FreeBSD.7*) SYSTYPE=FREEBSD7 - ;; - FreeBSD.8*) SYSTYPE=FREEBSD8 - : ${SHLIB_SUFFIX=.so} - : ${SHLIB_CFLAGS=-fPIC} - : ${SHLIB_LD="${CC-gcc} -shared"' -Wl,-soname,${LIB}'} - : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'} - : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} - : ${PLUGIN_LD="${CC-gcc} -shared"} - ;; - FreeBSD.9*) SYSTYPE=FREEBSD9 +FreeBSD.[89].*) SYSTYPE=FREEBSD$RELEASE_MAJOR : ${SHLIB_SUFFIX=.so} : ${SHLIB_CFLAGS=-fPIC} : ${SHLIB_LD="${CC-gcc} -shared"' -Wl,-soname,${LIB}'} @@ -308,43 +290,7 @@ case "$SYSTEM.$RELEASE" in : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} : ${PLUGIN_LD="${CC-gcc} -shared"} ;; - FreeBSD.10*) SYSTYPE=FREEBSD10 - : ${CC=cc} - : ${SHLIB_SUFFIX=.so} - : ${SHLIB_CFLAGS=-fPIC} - : ${SHLIB_LD="${CC} -shared"' -Wl,-soname,${LIB}'} - : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'} - : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} - : ${PLUGIN_LD="${CC} -shared"} - ;; - FreeBSD.11*) SYSTYPE=FREEBSD11 - : ${CC=cc} - : ${SHLIB_SUFFIX=.so} - : ${SHLIB_CFLAGS=-fPIC} - : ${SHLIB_LD="${CC} -shared"' -Wl,-soname,${LIB}'} - : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'} - : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} - : ${PLUGIN_LD="${CC} -shared"} - ;; - FreeBSD.12*) SYSTYPE=FREEBSD12 - : ${CC=cc} - : ${SHLIB_SUFFIX=.so} - : ${SHLIB_CFLAGS=-fPIC} - : ${SHLIB_LD="${CC} -shared"' -Wl,-soname,${LIB}'} - : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'} - : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} - : ${PLUGIN_LD="${CC} -shared"} - ;; - FreeBSD.13*) SYSTYPE=FREEBSD13 - : ${CC=cc} - : ${SHLIB_SUFFIX=.so} - : ${SHLIB_CFLAGS=-fPIC} - : ${SHLIB_LD="${CC} -shared"' -Wl,-soname,${LIB}'} - : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'} - : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} - : ${PLUGIN_LD="${CC} -shared"} - ;; - FreeBSD.14*) SYSTYPE=FREEBSD14 + FreeBSD.*) SYSTYPE=FREEBSD$RELEASE_MAJOR : ${CC=cc} : ${SHLIB_SUFFIX=.so} : ${SHLIB_CFLAGS=-fPIC} @@ -355,31 +301,9 @@ case "$SYSTEM.$RELEASE" in ;; DragonFly.*) SYSTYPE=DRAGONFLY ;; - OpenBSD.2*) SYSTYPE=OPENBSD2 - ;; - OpenBSD.3*) SYSTYPE=OPENBSD3 - ;; - OpenBSD.4*) SYSTYPE=OPENBSD4 - ;; - OpenBSD.5*) SYSTYPE=OPENBSD5 - : ${CC=cc} - : ${SHLIB_SUFFIX=.so.1.0} - : ${SHLIB_CFLAGS=-fPIC} - : ${SHLIB_LD="${CC} -shared"' -Wl,-soname,${LIB}'} - : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'} - : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} - : ${PLUGIN_LD="${CC} -shared"} - ;; - OpenBSD.6*) SYSTYPE=OPENBSD6 - : ${CC=cc} - : ${SHLIB_SUFFIX=.so.1.0} - : ${SHLIB_CFLAGS=-fPIC} - : ${SHLIB_LD="${CC} -shared"' -Wl,-soname,${LIB}'} - : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'} - : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} - : ${PLUGIN_LD="${CC} -shared"} +OpenBSD.[2-4].*) SYSTYPE=OPENBSD$RELEASE_MAJOR ;; - OpenBSD.7*) SYSTYPE=OPENBSD7 + OpenBSD.*) SYSTYPE=OPENBSD$RELEASE_MAJOR : ${CC=cc} : ${SHLIB_SUFFIX=.so.1.0} : ${SHLIB_CFLAGS=-fPIC} @@ -390,49 +314,9 @@ case "$SYSTEM.$RELEASE" in ;; ekkoBSD.1*) SYSTYPE=EKKOBSD1 ;; - NetBSD.1*) SYSTYPE=NETBSD1 - ;; - NetBSD.2*) SYSTYPE=NETBSD2 - ;; - NetBSD.3*) SYSTYPE=NETBSD3 - ;; - NetBSD.4*) SYSTYPE=NETBSD4 - ;; - NetBSD.5*) SYSTYPE=NETBSD5 - ;; - NetBSD.6*) SYSTYPE=NETBSD6 - : ${SHLIB_SUFFIX=.so} - : ${SHLIB_CFLAGS=-fPIC} - : ${SHLIB_LD="${CC-gcc} -shared"' -Wl,-soname,${LIB}'} - : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'} - : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} - : ${PLUGIN_LD="${CC-gcc} -shared"} - ;; - NetBSD.7*) SYSTYPE=NETBSD7 - : ${SHLIB_SUFFIX=.so} - : ${SHLIB_CFLAGS=-fPIC} - : ${SHLIB_LD="${CC-gcc} -shared"' -Wl,-soname,${LIB}'} - : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'} - : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} - : ${PLUGIN_LD="${CC-gcc} -shared"} - ;; - NetBSD.8*) SYSTYPE=NETBSD8 - : ${SHLIB_SUFFIX=.so} - : ${SHLIB_CFLAGS=-fPIC} - : ${SHLIB_LD="${CC-gcc} -shared"' -Wl,-soname,${LIB}'} - : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'} - : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} - : ${PLUGIN_LD="${CC-gcc} -shared"} - ;; - NetBSD.9*) SYSTYPE=NETBSD9 - : ${SHLIB_SUFFIX=.so} - : ${SHLIB_CFLAGS=-fPIC} - : ${SHLIB_LD="${CC-gcc} -shared"' -Wl,-soname,${LIB}'} - : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'} - : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} - : ${PLUGIN_LD="${CC-gcc} -shared"} +NetBSD.[1-5].*) SYSTYPE=NETBSD$RELEASE_MAJOR ;; - NetBSD.10*) SYSTYPE=NETBSD10 + NetBSD.*) SYSTYPE=NETBSD$RELEASE_MAJOR : ${SHLIB_SUFFIX=.so} : ${SHLIB_CFLAGS=-fPIC} : ${SHLIB_LD="${CC-gcc} -shared"' -Wl,-soname,${LIB}'} @@ -454,10 +338,10 @@ case "$SYSTEM.$RELEASE" in V[0-4].*) CCARGS="$CCARGS -DNO_IPV6";; esac ;; - SunOS.4*) SYSTYPE=SUNOS4 + SunOS.4.*) SYSTYPE=SUNOS4 SYSLIBS=-lresolv ;; - SunOS.5*) SYSTYPE=SUNOS5 + SunOS.5.*) SYSTYPE=SUNOS5 RANLIB=echo SYSLIBS="-lresolv -lsocket -lnsl -ldl" : ${SHLIB_SUFFIX=.so} @@ -554,14 +438,14 @@ case "$SYSTEM.$RELEASE" in *) error "Unknown AIX version: `uname -v`.";; esac;; # Tested with RedHat 3.03 on 20020729. - Linux.1*) SYSTYPE=LINUX1 + Linux.1.*) SYSTYPE=LINUX1 case "$CCARGS" in *-DNO_DB*) ;; *-DHAS_DB*) ;; *) SYSLIBS="-ldb";; esac ;; - Linux.2*) SYSTYPE=LINUX2 + Linux.2.*) SYSTYPE=LINUX2 case "$CCARGS" in *-DNO_DB*) ;; *-DHAS_DB*) ;; @@ -642,8 +526,7 @@ EOF : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} : ${PLUGIN_LD="${CC-gcc} -shared"} ;; - Linux.[34567].*) - SYSTYPE=LINUX$RELEASE_MAJOR + Linux.*) SYSTYPE=LINUX$RELEASE_MAJOR case "$CCARGS" in *-DNO_DB*) ;; *-DHAS_DB*) case "$AUXLIBS_DB" in diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index a1765cac5..a4b25a0e6 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -3630,6 +3630,10 @@ The LMTP\-specific version of the smtp_tls_loglevel configuration parameter. See there for details. .PP This feature is available in Postfix 2.3 and later. +.SH lmtp_tls_loglevel_maps (default: $smtp_tls_loglevel_maps) +The \fBlmtp\fR(8) equivalent of smtp_tls_loglevel_maps. +.PP +This feature is available in Postfix 3.12 and later. .SH lmtp_tls_mandatory_ciphers (default: medium) The LMTP\-specific version of the smtp_tls_mandatory_ciphers configuration parameter. See there for details. @@ -6106,6 +6110,12 @@ This feature is available in Postfix 3.12 and later. The \fBpostscreen\fR(8) equivalent of smtpd_tls_loglevel. .PP This feature is available in Postfix 3.12 and later. +.SH postscreen_tls_loglevel_maps (default: $smtpd_tls_loglevel_maps) +Optional TLS loglevel override that depends on the remote peer +host name or IP address. See smtp_tls_loglevel_maps for a detailed +description. +.PP +This feature is available in Postfix 3.12 and later. .SH postscreen_tls_mandatory_ciphers (default: $smtpd_tls_mandatory_ciphers) The \fBpostscreen\fR(8) equivalent of smtpd_tls_mandatory_ciphers. .PP @@ -9885,6 +9895,66 @@ Do not use "smtp_tls_loglevel = 2" or higher except in case of problems. Use of loglevel 4 is strongly discouraged. .PP This feature is available in Postfix 2.2 and later. +.SH smtp_tls_loglevel_maps (default: empty) +Optional TLS loglevel override that depends on the remote peer +host name or IP address. The text below also covers smtpd_tls_loglevel_maps +and postscreen_tls_loglevel_maps. +.PP +Specify zero or more lookup tables separated by comma or +whitespace. The table syntax is as follows: +.IP \(bu +On the left\-hand side, specify a domain name, IPv4 or IPv6 +network address, or a substring pattern as described below. An +internationalized domain name MUST be in A\-label form (xn\-\-mumble). +An IPv4 address MUST be in dotted\-quad form; an IPv6 address MUST +be in compressed form (text::text). Do not enclose any of these +inputs with "[" and "]". +.IP \(bu +On the right\-hand side, specify a valid TLS loglevel value, +or "DUNNO" for a "quick exit" as described below. +.br +.PP +The over\-all search strategy is as follows: +.IP \(bu +Look up the peer name in all specified lookup tables, and +stop at the first match. If no match was found, this may be followed +by substring lookups as described below. Note: peer name lookup is +not applicable for \fBpostscreen\fR(8) because that service does not have +the remote SMTP client name. +.IP \(bu +If no peer name match is found, look up the peer IP address +in all specified lookup tables, and stop at the first match. If no +match was found, this may be followed by substring lookups as +described below. +.IP \(bu +If any lookup result returns "DUNNO", terminate the search +and pretend that no name match and no address match were found. +.br +.PP +This feature may generate substring queries for a fixed\-string +lookup table (examples: hash:, lmdb:, pgsql:). Substring queries +do not happen with regexp:, pcre:, and cidr: tables. +.IP \(bu +By default, after all table queries with a full domain +name (example: "mail.example.com") produce "not found", the next +queries will use the parent domains with '.' prepended (examples: +".example.com" and ".com") until a match is found or until all +substrings have been tried. +.IP \(bu +To generate domain name substring queries without the +leading '.' (examples: "example.com" and "com"), specify the +applicable configuration parameter name ("smtpd_tls_policy_maps", +"smtp_tls_policy_maps", or "postscreen_tls_policy_maps") in the +parent_domain_matches_subdomains parameter value. +.IP \(bu +After all table queries with a full IP address produce +"not found", the next queries will use subnetworks, by repeatedly +removing the last ".text" component from a dotted\-quad IPv4 address, +or the last ":text" component from a compressed\-form IPv6 address, +until a match is found or until all subnetworks have been tried. +.br +.PP +This feature is available in Postfix 3.12 and later. .SH smtp_tls_mandatory_ciphers (default: medium) The minimum TLS cipher grade that the Postfix SMTP client will use with @@ -14353,6 +14423,12 @@ Do not use "smtpd_tls_loglevel = 2" or higher except in case of problems. Use of loglevel 4 is strongly discouraged. .PP This feature is available in Postfix 2.2 and later. +.SH smtpd_tls_loglevel_maps (default: empty) +Optional TLS loglevel override that depends on the remote peer +host name or IP address. See smtp_tls_loglevel_maps for a detailed +description. +.PP +This feature is available in Postfix 3.12 and later. .SH smtpd_tls_mandatory_ciphers (default: medium) The minimum TLS cipher grade that the Postfix SMTP server will use with mandatory TLS encryption. The default grade ("medium") is diff --git a/postfix/man/man8/postscreen.8 b/postfix/man/man8/postscreen.8 index bec651ffb..73a338e77 100644 --- a/postfix/man/man8/postscreen.8 +++ b/postfix/man/man8/postscreen.8 @@ -431,6 +431,9 @@ The \fBpostscreen\fR(8) equivalent of smtpd_tls_fingerprint_digest. The \fBpostscreen\fR(8) equivalent of smtpd_tls_key_file. .IP "\fBpostscreen_tls_loglevel ($smtpd_tls_loglevel)\fR" The \fBpostscreen\fR(8) equivalent of smtpd_tls_loglevel. +.IP "\fBpostscreen_tls_loglevel_maps ($smtpd_tls_loglevel_maps)\fR" +Optional TLS loglevel override that depends on the remote peer +host name or IP address. .IP "\fBpostscreen_tls_mandatory_ciphers ($smtpd_tls_mandatory_ciphers)\fR" The \fBpostscreen\fR(8) equivalent of smtpd_tls_mandatory_ciphers. .IP "\fBpostscreen_tls_mandatory_exclude_ciphers ($smtpd_tls_mandatory_exclude_ciphers)\fR" diff --git a/postfix/man/man8/smtp.8 b/postfix/man/man8/smtp.8 index 20a6734d0..11da44d31 100644 --- a/postfix/man/man8/smtp.8 +++ b/postfix/man/man8/smtp.8 @@ -704,6 +704,11 @@ for messages received with the REQUIRETLS option. .IP "\fBsmtp_log_tls_feature_status (yes)\fR" Enable logging of TLS feature information in delivery status logging. +.PP +Available in Postfix version 3.12 and later: +.IP "\fBsmtp_tls_loglevel_maps (empty)\fR" +Optional TLS loglevel override that depends on the remote peer +host name or IP address. .SH "OBSOLETE TLS CONTROLS" .na .nf diff --git a/postfix/man/man8/smtpd.8 b/postfix/man/man8/smtpd.8 index 349faf222..f79feab31 100644 --- a/postfix/man/man8/smtpd.8 +++ b/postfix/man/man8/smtpd.8 @@ -591,6 +591,11 @@ yes" message header. Whether to trust client certificates whose extended key usage (EKU) lists only \fBserverAuth\fR and not \fBclientAuth\fR as valid TLS client certificates. +.PP +Available in Postfix version 3.12 and later: +.IP "\fBsmtpd_tls_loglevel_maps (empty)\fR" +Optional TLS loglevel override that depends on the remote peer +host name or IP address. .SH "OBSOLETE TLS CONTROLS" .na .nf diff --git a/postfix/mantools/postlink b/postfix/mantools/postlink index 8affa0b62..159e05a12 100755 --- a/postfix/mantools/postlink +++ b/postfix/mantools/postlink @@ -275,6 +275,7 @@ while (<>) { s;\blmtp_tls_exclude_ciphers\b;$&;g; s;\blmtp_tls_mandatory_exclude_ciphers\b;$&;g; s;\blmtp_tls_loglevel\b;$&;g; + s;\blmtp_tls_loglevel_maps\b;$&;g; s;\blmtp_tls_session_cache_database\b;$&;g; s;\blmtp_tls_session_cache_timeout\b;$&;g; s;\blmtp_tls_enable_rpk\b;$&;g; @@ -693,6 +694,7 @@ while (<>) { s;\bsmtp_tls_enforce_peername\b;$&;g; s;\bsmtp_tls_key_file\b;$&;g; s;\bsmtp_tls_loglevel\b;$&;g; + s;\bsmtp_tls_loglevel_maps\b;$&;g; s;\bsmtp_tls_note_starttls_offer\b;$&;g; s;\bsmtp_tls_per_site\b;$&;g; s;\bsmtp_tls_policy_maps\b;$&;g; @@ -767,6 +769,7 @@ while (<>) { s;\bsmtpd_tls_key_file\b;$&;g; s;\bsmtpd_tls_security_level\b;$&;g; s;\bsmtpd_tls_loglevel\b;$&;g; + s;\bsmtpd_tls_loglevel_maps\b;$&;g; s;\bsmtpd_tls_manda[-]*\n*[ ]*tory_protocols\b;$&;g; s;\bsmtpd_tls_received_header\b;$&;g; s;\bsmtpd_tls_req_ccert\b;$&;g; @@ -1237,6 +1240,7 @@ while (<>) { s;\bpostscreen_tls_fingerprint_digest\b;$&;g; s;\bpostscreen_tls_key_file\b;$&;g; s;\bpostscreen_tls_loglevel\b;$&;g; + s;\bpostscreen_tls_loglevel_maps\b;$&;g; s;\bpostscreen_tls_mandatory_ciphers\b;$&;g; s;\bpostscreen_tls_mandatory_exclude_ciphers\b;$&;g; s;\bpostscreen_tls_mandatory_protocols\b;$&;g; diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index f175e65c4..d18943fa8 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -20861,3 +20861,98 @@ logs.

The postscreen(8) equivalent of smtpd_tls_ccert_verifydepth.

This feature is available in Postfix 3.12 and later.

+ +%PARAM postscreen_tls_loglevel_maps $smtpd_tls_loglevel_maps + +

Optional TLS loglevel override that depends on the remote peer +host name or IP address. See smtp_tls_loglevel_maps for a detailed +description. + +

This feature is available in Postfix 3.12 and later.

+ +%PARAM smtpd_tls_loglevel_maps empty + +

Optional TLS loglevel override that depends on the remote peer +host name or IP address. See smtp_tls_loglevel_maps for a detailed +description. + +

This feature is available in Postfix 3.12 and later.

+ +%PARAM smtp_tls_loglevel_maps empty + +

Optional TLS loglevel override that depends on the remote peer +host name or IP address. The text below also covers smtpd_tls_loglevel_maps +and postscreen_tls_loglevel_maps.

+ +

Specify zero or more lookup tables separated by comma or +whitespace. The table syntax is as follows:

+ +

    + +
  • On the left-hand side, specify a domain name, IPv4 or IPv6 +network address, or a substring pattern as described below. An +internationalized domain name MUST be in A-label form (xn--mumble). +An IPv4 address MUST be in dotted-quad form; an IPv6 address MUST +be in compressed form (text::text). Do not enclose any of these +inputs with "[" and "]".

    + +
  • On the right-hand side, specify a valid TLS loglevel value, +or "DUNNO" for a "quick exit" as described below.

    + +
+ +

The over-all search strategy is as follows:

+ +
    + +
  • Look up the peer name in all specified lookup tables, and +stop at the first match. If no match was found, this may be followed +by substring lookups as described below. Note: peer name lookup is +not applicable for postscreen(8) because that service does not have +the remote SMTP client name.

    + +
  • If no peer name match is found, look up the peer IP address +in all specified lookup tables, and stop at the first match. If no +match was found, this may be followed by substring lookups as +described below.

    + +
  • If any lookup result returns "DUNNO", terminate the search +and pretend that no name match and no address match were found. +

    + +
+ +

This feature may generate substring queries for a fixed-string +lookup table (examples: hash:, lmdb:, pgsql:). Substring queries +do not happen with regexp:, pcre:, and cidr: tables.

+ +
    + +
  • By default, after all table queries with a full domain +name (example: "mail.example.com") produce "not found", the next +queries will use the parent domains with '.' prepended (examples: +".example.com" and ".com") until a match is found or until all +substrings have been tried.

    + +
  • To generate domain name substring queries without the +leading '.' (examples: "example.com" and "com"), specify the +applicable configuration parameter name ("smtpd_tls_policy_maps", +"smtp_tls_policy_maps", or "postscreen_tls_policy_maps") in the +parent_domain_matches_subdomains parameter value.

    + +
  • After all table queries with a full IP address produce +"not found", the next queries will use subnetworks, by repeatedly +removing the last ".text" component from a dotted-quad IPv4 address, +or the last ":text" component from a compressed-form IPv6 address, +until a match is found or until all subnetworks have been tried. +

    + +
+ +

This feature is available in Postfix 3.12 and later.

+ +%PARAM lmtp_tls_loglevel_maps $smtp_tls_loglevel_maps + +

The lmtp(8) equivalent of smtp_tls_loglevel_maps.

+ +

This feature is available in Postfix 3.12 and later.

diff --git a/postfix/proto/stop b/postfix/proto/stop index 58fa2cb92..f1ed8411c 100644 --- a/postfix/proto/stop +++ b/postfix/proto/stop @@ -1714,3 +1714,7 @@ Vorobev BERKELEYDB Frankowicz Kamil +yana +YANA +substrings +Substring diff --git a/postfix/proto/stop.double-history b/postfix/proto/stop.double-history index c8e280f97..7a92b6f0d 100644 --- a/postfix/proto/stop.double-history +++ b/postfix/proto/stop.double-history @@ -244,3 +244,7 @@ proto proto stop proto stop double cc server role support Files smtpd smtpd c tlsproxy tlsproxy c support Files tlsproxy tlsproxy c tlsproxy tlsproxy_server hc calls Files tlsproxy tlsproxy c mantools postlink + global yana_policy_test c postscreen postscreen c + postscreen postscreen h postscreen postscreen_starttls c + posttls finger posttls finger c smtp smtp c smtp smtp h + smtp smtp_proto c smtpd smtpd c tls tls_client c tls tls h diff --git a/postfix/proto/stop.double-proto-html b/postfix/proto/stop.double-proto-html index 90491409b..b24f2da48 100644 --- a/postfix/proto/stop.double-proto-html +++ b/postfix/proto/stop.double-proto-html @@ -392,3 +392,4 @@ mynetworks mynetworks lmdb etc postfix network_table 187 for cpp tp want_log cpp tp want_log MAX_WANT_LOG cpp cpp rsasig rsasig rsa_pss_pss_sha256 rsa_pss_pss_sha384 rsa_pss_pss_sha512 rsasig rsasig rsa_pkcs1_sha256 rsa_pkcs1_sha384 rsa_pkcs1_sha512 +be in compressed form text text Do not enclose any of these diff --git a/postfix/src/global/Makefile.in b/postfix/src/global/Makefile.in index 176b0c5d4..f4849616a 100644 --- a/postfix/src/global/Makefile.in +++ b/postfix/src/global/Makefile.in @@ -39,7 +39,7 @@ SRCS = abounce.c anvil_clnt.c been_here.c bounce.c bounce_log.c \ test_server_main.c compat_level.c config_known_tcp_ports.c \ hfrom_format.c rfc2047_code.c ascii_header_text.c sendopts.c \ pol_stats.c nbdb_clnt.c nbdb_util.c allowed_prefix.c \ - nbdb_redirect.c nbdb_surrogate.c + nbdb_redirect.c nbdb_surrogate.c yana_policy.c OBJS = abounce.o anvil_clnt.o been_here.o bounce.o bounce_log.o \ canon_addr.o cfg_parser.o cleanup_strerror.o cleanup_strflags.o \ clnt_stream.o conv_time.o db_common.o debug_peer.o debug_process.o \ @@ -80,7 +80,7 @@ OBJS = abounce.o anvil_clnt.o been_here.o bounce.o bounce_log.o \ test_server_main.o compat_level.o config_known_tcp_ports.o \ hfrom_format.o rfc2047_code.o ascii_header_text.o sendopts.o \ pol_stats.o nbdb_clnt.o nbdb_util.o allowed_prefix.o \ - nbdb_redirect.o nbdb_surrogate.o + nbdb_redirect.o nbdb_surrogate.o yana_policy.o # MAP_OBJ is for maps that may be dynamically loaded with dynamicmaps.cf. # When hard-linking these maps, makedefs sets NON_PLUGIN_MAP_OBJ=$(MAP_OBJ), # otherwise it sets the PLUGIN_* macros. @@ -118,13 +118,13 @@ HDRS = abounce.h anvil_clnt.h been_here.h bounce.h bounce_log.h \ test_server_main.h compat_level.h config_known_tcp_ports.h \ hfrom_format.h rfc2047_code.h ascii_header_text.h sendopts.h \ pol_stats.h nbdb_clnt.h nbdb_util.h allowed_prefix.h \ - nbdb_redirect.h nbdb_surrogate.h + nbdb_redirect.h nbdb_surrogate.h yana_policy.h TESTSRC = rec2stream.c stream2rec.c recdump.c dict_sqlite_test.c \ ehlo_mask_test.c haproxy_srvr_test.c sendopts_test.c pol_stats_test.c \ allowed_prefix_test.c nbdb_util_test.c nbdb_redirect_test.c \ nbdb_surrogate_test.c recdump.c login_sender_match_test.c \ normalize_mailhost_addr_test.c smtp_reply_footer_test.c \ - map_search_test.c + map_search_test.c yana_policy_test.c DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE) CFLAGS = $(DEBUG) $(OPT) $(DEFS) INCL = @@ -144,7 +144,7 @@ TESTPROG= domain_list dot_lockfile mail_addr_crunch mail_addr_find \ config_known_tcp_ports_test hfrom_format_test rfc2047_code \ ascii_header_text sendopts_test dict_sqlite_test pol_stats_test \ allowed_prefix_test nbdb_util_test nbdb_redirect_test \ - nbdb_surrogate_test + nbdb_surrogate_test yana_policy_test TESTLIB = $(LIB_DIR)/libtesting.a LIBS = ../../lib/lib$(LIB_PREFIX)util$(LIB_SUFFIX) @@ -423,6 +423,9 @@ nbdb_redirect_test: nbdb_redirect_test.o $(TESTLIB) $(LIB) $(LIBS) nbdb_surrogate_test: nbdb_surrogate_test.o $(TESTLIB) $(LIB) $(LIBS) $(CC) $(CFLAGS) -o $@ $@.o $(TESTLIB) $(LIB) $(LIBS) $(SYSLIBS) +yana_policy_test: yana_policy_test.o $(PTEST_LIB) $(LIB) $(LIBS) + $(CC) $(CFLAGS) -o $@ $@.o $(PTEST_LIB) $(LIB) $(LIBS) $(SYSLIBS) + tests: update tok822_test mime_tests strip_addr_test tok822_limit_test \ xtext_test scache_multi_test test_ehlo_mask \ namadr_list_test mail_conf_time_test header_body_checks_tests \ @@ -434,7 +437,7 @@ tests: update tok822_test mime_tests strip_addr_test tok822_limit_test \ delivered_hdr_test test_login_sender_match compat_level_test \ test_config_known_tcp_ports test_hfrom_format rfc2047_code_test \ ascii_header_text_test test_sendopts test_dict_sqlite test_pol_stats \ - test_allowed_prefix nbdb_tests + test_allowed_prefix nbdb_tests test_yana_policy nbdb_tests: test_nbdb_util test_nbdb_redirect test_nbdb_surrogate @@ -833,6 +836,9 @@ test_nbdb_redirect: update nbdb_redirect_test test_nbdb_surrogate: update nbdb_surrogate_test $(SHLIB_ENV) $(VALGRIND) ./nbdb_surrogate_test +test_yana_policy: update yana_policy_test + $(SHLIB_ENV) $(VALGRIND) ./yana_policy_test + clean: rm -f *.o $(LIB) *core $(TESTPROG) junk $(MAPS) @@ -3431,3 +3437,39 @@ xtext.o: ../../include/vbuf.h xtext.o: ../../include/vstring.h xtext.o: xtext.c xtext.o: xtext.h +yana_policy.o: ../../include/argv.h +yana_policy.o: ../../include/check_arg.h +yana_policy.o: ../../include/dict.h +yana_policy.o: ../../include/midna_domain.h +yana_policy.o: ../../include/msg.h +yana_policy.o: ../../include/myflock.h +yana_policy.o: ../../include/mymalloc.h +yana_policy.o: ../../include/split_at.h +yana_policy.o: ../../include/stringops.h +yana_policy.o: ../../include/sys_defs.h +yana_policy.o: ../../include/valid_hostname.h +yana_policy.o: ../../include/vbuf.h +yana_policy.o: ../../include/vstream.h +yana_policy.o: ../../include/vstring.h +yana_policy.o: maps.h +yana_policy.o: yana_policy.c +yana_policy.o: yana_policy.h +yana_policy_test.o: ../../include/argv.h +yana_policy_test.o: ../../include/check_arg.h +yana_policy_test.o: ../../include/dict.h +yana_policy_test.o: ../../include/msg.h +yana_policy_test.o: ../../include/msg_jmp.h +yana_policy_test.o: ../../include/msg_output.h +yana_policy_test.o: ../../include/msg_vstream.h +yana_policy_test.o: ../../include/myflock.h +yana_policy_test.o: ../../include/myrand.h +yana_policy_test.o: ../../include/pmock_expect.h +yana_policy_test.o: ../../include/ptest.h +yana_policy_test.o: ../../include/ptest_main.h +yana_policy_test.o: ../../include/stringops.h +yana_policy_test.o: ../../include/sys_defs.h +yana_policy_test.o: ../../include/vbuf.h +yana_policy_test.o: ../../include/vstream.h +yana_policy_test.o: ../../include/vstring.h +yana_policy_test.o: yana_policy.h +yana_policy_test.o: yana_policy_test.c diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index c868c4f25..f35f81faa 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -1441,6 +1441,10 @@ extern char *var_smtpd_tls_eecdh; #define DEF_SMTPD_TLS_LOGLEVEL "0" extern char *var_smtpd_tls_loglevel; +#define VAR_SMTPD_TLS_LOGLEVEL_MAPS "smtpd_tls_loglevel_maps" +#define DEF_SMTPD_TLS_LOGLEVEL_MAPS "" +extern char *var_smtpd_tls_loglevel_maps; + #define VAR_SMTPD_TLS_RECHEAD "smtpd_tls_received_header" #define DEF_SMTPD_TLS_RECHEAD 0 extern bool var_smtpd_tls_received_header; @@ -1615,6 +1619,13 @@ extern char *var_smtp_tls_tafile; extern char *var_smtp_tls_loglevel; /* In smtp(8) and tlsmgr(8) */ extern char *var_lmtp_tls_loglevel; /* In tlsmgr(8) */ +#define VAR_SMTP_TLS_LOGLEVEL_MAPS "smtp_tls_loglevel_maps" +#define DEF_SMTP_TLS_LOGLEVEL_MAPS "" +#define VAR_LMTP_TLS_LOGLEVEL_MAPS "lmtp_tls_loglevel_maps" +#define DEF_LMTP_TLS_LOGLEVEL_MAPS "" +extern char *var_smtp_tls_loglevel_maps; +extern char *var_lmtp_tls_loglevel_maps; + #define VAR_SMTP_TLS_NOTEOFFER "smtp_tls_note_starttls_offer" #define DEF_SMTP_TLS_NOTEOFFER 0 #define VAR_LMTP_TLS_NOTEOFFER "lmtp_tls_note_starttls_offer" @@ -2611,6 +2622,10 @@ extern int var_local_rcpt_code; " $" VAR_VERP_CLIENTS \ " $" VAR_XCLIENT_HOSTS \ " $" VAR_XFORWARD_HOSTS \ + " $" VAR_LMTP_TLS_LOGLEVEL_MAPS \ + " $" VAR_PSC_TLS_LOGLEVEL_MAPS \ + " $" VAR_SMTP_TLS_LOGLEVEL_MAPS \ + " $" VAR_SMTPD_TLS_LOGLEVEL_MAPS \ extern char *var_proxy_read_maps; @@ -4738,6 +4753,10 @@ extern char *var_psc_tls_key_file; #define DEF_PSC_TLS_LOGLEVEL "$" VAR_SMTPD_TLS_LOGLEVEL extern char *var_psc_tls_loglevel; +#define VAR_PSC_TLS_LOGLEVEL_MAPS "postscreen_tls_loglevel_maps" +#define DEF_PSC_TLS_LOGLEVEL_MAPS "$" VAR_SMTPD_TLS_LOGLEVEL_MAPS +extern char *var_psc_tls_loglevel_maps; + #define VAR_PSC_TLS_MAND_CIPH "postscreen_tls_mandatory_ciphers" #define DEF_PSC_TLS_MAND_CIPH "$" VAR_SMTPD_TLS_MAND_CIPH extern char *var_psc_tls_mand_ciph; diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 86d9cc1d3..5bd42d3df 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "20260423" +#define MAIL_RELEASE_DATE "20260429" #define MAIL_VERSION_NUMBER "3.12" #ifdef SNAPSHOT diff --git a/postfix/src/global/yana_policy.c b/postfix/src/global/yana_policy.c new file mode 100644 index 000000000..75ac9bc61 --- /dev/null +++ b/postfix/src/global/yana_policy.c @@ -0,0 +1,201 @@ +/*++ +/* NAME +/* yana_policy 3 +/* SUMMARY +/* yet another peer-name/address policy +/* SYNOPSIS +/* #include +/* +/* YANA_POLICY *yana_policy_create( +/* const char *param_name, +/* const char *map_names, +/* int match_parent) +/* +/* const char *yana_policy_lookup( +/* YANA_POLICY *policy, +/* const char *peer_name, +/* const char *peer_addr) +/* +/* int yana_policy_error(YANA_POLICY *policy) +/* +/* void yana_policy_free(YANA_POLICY *policy) +/* DESCRIPTION +/* yana_policy_init() opens zero or more lookup tables and returns +/* a pointer to YANA_POLICY object. +/* +/* yana_policy_log_level() returns the log_level value for the +/* specified peer name or address, or null if not found. In the +/* policy specify a "DUNNO" result to terminate the search and to +/* pretend that nothing was found. +/* +/* yana_policy_error() returns the dictionary error status from +/* the last table lookup. +/* +/* yana_policy_free() destroys a YANA_POLICY object. +/* +/* Arguments: +/* .IP param_name +/* The name of the configuration that supplied the map_names. +/* .IP map_names +/* Zero or more type:table instances, separated by comma or +/* whitespace. Specify a null pointer or empty string if information +/* is not available. +/* .IP match_parent +/* Typically, this will be the result of match_parent_style() lookup. +/* If non-zero, a domain name in a policy will match the parent +/* domain of a peer name. Otherwise, a .domain will match. +/* DIAGNOSTICS +/* yana_policy_lookup() logs a warning when a peer name is malformed +/* or if it contains an IP address, or when a peer address is +/* malformed. Such names or addresses will never match policy. +/* LICENSE +/* .ad +/* .fi +/* The Secure Mailer license must be distributed with this software. +/* AUTHOR(S) +/* Wietse Venema +/* porcupine.org +/*--*/ + + /* + * System library. + */ +#include +#include + + /* + * Utility library. + */ +#include +#include +#include +#include +#include +#include + + /* + * Global library. + */ +#include +#include + + /* + * Unlike debug_peer_list which has the same effect for all matching peers, + * this implementation returns a result that may differ between matching + * peers. + */ + +/* yana_policy_create - initialize */ + +YANA_POLICY *yana_policy_create(const char *map_param, + const char *map_names, + int match_parent) +{ + YANA_POLICY *policy; + + policy = (YANA_POLICY *) mymalloc(sizeof(*policy)); + policy->maps = maps_create(map_param, map_names, + DICT_FLAG_FOLD_FIX | DICT_FLAG_LOCK | DICT_FLAG_UTF8_REQUEST); + policy->match_parent = match_parent; + return (policy); +} + +/* yana_policy_lookup - look up peer-specific log_level */ + +const char *yana_policy_lookup(YANA_POLICY *policy, + const char *peer_name, + const char *peer_addr) +{ + int delim; + const char *result; + char *addr; + const char *aname, *name, *next; + int flags; + +#define FULL 0 +#define PARTIAL DICT_FLAG_FIXED + + /* + * These will be updated only if we actually attempt to look up data. + */ + result = 0; + policy->error = 0; + + /* + * Match the peer name first. To avoid ambiguity (insecurity!) with + * unnormalized U-label forms and unnormalized label separators, the + * policy contains A-label forms, and the evaluator converts queries from + * U-label form to A-label form. + */ + if (peer_name && *peer_name) { + if (!valid_hostname(peer_name, DONT_GRIPE)) { + msg_warn("%s: ignoring malformed peer name: '%s'", + __func__, peer_name); + } else if (valid_hostaddr(peer_name, DONT_GRIPE)) { + msg_warn("%s: ignoring numeric peer name: '%s'", + __func__, peer_name); + } else { +#ifndef NO_EAI + if (!allascii(peer_name)) { + if ((aname = midna_domain_to_ascii(peer_name)) == 0) { + msg_warn("%s: ignoring malformed peer name: '%s'", + __func__, peer_name); + peer_name = ""; + } else { + peer_name = aname; + } + } +#endif + flags = FULL; + for (name = peer_name; *name != 0; name = next) { + if ((result = maps_find(policy->maps, name, flags)) != 0 + || (policy->error = policy->maps->error) != 0) + break; + if ((next = strchr(name + 1, '.')) == 0) + break; + if (policy->match_parent) + next += 1; + flags = PARTIAL; + } + } + } + + /* + * Match the peer address. + */ + if (result == 0 && policy->error == 0 && peer_addr && *peer_addr) { + if (!valid_hostaddr(peer_addr, DONT_GRIPE)) { + msg_warn("%s: ignoring malformed peer address: '%s'", + __func__, peer_addr); + } else { + addr = mystrdup(peer_addr); +#ifdef HAS_IPV6 + if (strchr(addr, ':') != 0) + delim = ':'; + else +#endif + delim = '.'; + flags = FULL; + do { + if ((result = maps_find(policy->maps, addr, flags)) != 0 + || (policy->error = policy->maps->error) != 0) + break; + flags = PARTIAL; + } while (split_at_right(addr, delim)); + myfree(addr); + } + } + + /* + * Wrap up. + */ + return (result && strcasecmp(result, "DUNNO") ? result : 0); +} + +/* yana_policy_free - release storage */ + +void yana_policy_free(YANA_POLICY *policy) +{ + maps_free(policy->maps); + myfree((void *) policy); +} diff --git a/postfix/src/global/yana_policy.h b/postfix/src/global/yana_policy.h new file mode 100644 index 000000000..cbd0ded24 --- /dev/null +++ b/postfix/src/global/yana_policy.h @@ -0,0 +1,38 @@ +#ifndef _YANA_POLICY_H_ +#define _YANA_POLICY_H_ + +/*++ +/* NAME +/* yana_policy 3h +/* SUMMARY +/* yet another peer-name/address policy +/* SYNOPSIS +/* #include +/* DESCRIPTION +* .nf + + /* + * External interface. + */ +typedef struct YANA_POLICY { + struct MAPS *maps; + int match_parent; + int error; +} YANA_POLICY; + +extern YANA_POLICY *yana_policy_create(const char *, const char *, int); +extern const char *yana_policy_lookup(YANA_POLICY *, const char *, const char *); +extern void yana_policy_free(YANA_POLICY *); + +#define yana_policy_error(policy) ((policy)->error) + +/* LICENSE +/* .ad +/* .fi +/* The Secure Mailer license must be distributed with this software. +/* AUTHOR(S) +/* Wietse Venema +/* porcupine.org +/*--*/ + +#endif diff --git a/postfix/src/global/yana_policy_test.c b/postfix/src/global/yana_policy_test.c new file mode 100644 index 000000000..bd07f7593 --- /dev/null +++ b/postfix/src/global/yana_policy_test.c @@ -0,0 +1,190 @@ + /* + * Test program to exercise yana_policy.c. See ptest_main.h for a documented + * example. + */ + + /* + * System library. + */ +#include +#include + + /* + * Utility library. + */ +#include + + /* + * Global library. + */ +#include + + /* + * Test library. + */ +#include + +typedef struct PTEST_CASE { + const char *testname; + void (*action) (PTEST_CTX *, const struct PTEST_CASE *); + + /* + * yana_policy_create() inputs. + */ + const char *policy; + int match_parent; + + /* + * yana_policy_lookup() inputs. + */ + const char *client_name; + const char *client_addr; + + /* + * yana_policy_lookup() outputs. + */ + const char *want_warning; /* expected warning or null */ + const char *want_found; /* expected lookup result or null */ + int want_error; /* expected DICT_ERR_XXX value */ +} PTEST_CASE; + +static void test_yana_policy(PTEST_CTX *t, const PTEST_CASE *tp) +{ + YANA_POLICY *policy; + const char *got_found; + +#define STR_OR_NULL(s) ((s) ? (s) : "(null)") + + /* + * Setup. + */ + policy = yana_policy_create(tp->testname, tp->policy, tp->match_parent); + if (tp->want_warning) + expect_ptest_log_event(t, tp->want_warning); + + /* + * Detonate. + */ + got_found = yana_policy_lookup(policy, tp->client_name, tp->client_addr); + + /* + * Verify. + */ + if (policy->error != tp->want_error) { + ptest_error(t, "unexpected policy error result: got '%d', want '%d'", + policy->error, tp->want_error); + } + if (!!got_found != !!tp->want_found) { + ptest_error(t, "unexpected policy lookup result: got '%s', want '%s'", + STR_OR_NULL(got_found), STR_OR_NULL(tp->want_found)); + } + if (got_found && tp->want_found) { + if (strcmp(got_found, tp->want_found) != 0) { + ptest_error(t, "unexpected policy result: got '%s', want '%s'", + got_found, tp->want_found); + } + } + yana_policy_free(policy); +} + +static const PTEST_CASE ptestcases[] = { + {"good-fullname-match", test_yana_policy, + .policy = "inline:{mx.example.com=name-match, 1.2.3.4=addr-match}", + .client_name = "mx.example.com", + .client_addr = "1.2.3.4", + .want_found = "name-match", + }, + {"good-full-v6-match", test_yana_policy, + .policy = "inline:{mx.example.com=name-match, 1:2::3:4=addr-match}", + .client_name = "other.example.com", + .client_addr = "1:2::3:4", + .want_found = "addr-match", + }, + {"good-full-v4-match", test_yana_policy, + .policy = "inline:{mx.example.com=name-match, 1.2.3.4=addr-match}", + .client_name = "other.example.com", + .client_addr = "1.2.3.4", + .want_found = "addr-match", + }, + {"dunno-overrides", test_yana_policy, + .policy = "inline:{mx.example.com=dunno, 1.2.3.4=addr-match}", + .client_name = "mx.example.com", + .client_addr = "1.2.3.4", + }, + {"good-non-match", test_yana_policy, + .policy = "inline:{mx.example.com=name-match, 1.2.3.4=addr-match}", + .client_name = "other.example.com", + .client_addr = "1.2.3.5", + }, + {"propgates-name-lookup-error", test_yana_policy, + .policy = "fail:whatever", + .client_name = "mx.example.com", + .want_warning = "warning: fail:whatever lookup error", + .want_error = DICT_ERR_RETRY, + }, + {"propgates-addr-lookup-error", test_yana_policy, + .policy = "fail:whatever", + .client_addr = "1.2.3.4", + .want_warning = "warning: fail:whatever lookup error", + .want_error = DICT_ERR_RETRY, + }, + {"good-parent-match", test_yana_policy, + .policy = "inline:{.example.com=name-match, 1.2.3.4=addr-match}", + .client_name = "mx.example.com", + .client_addr = "1.2.3.4", + .want_found = "name-match", + }, + {"good-tld-match", test_yana_policy, + .policy = "inline:{.com=name-match, 1.2.3.4=addr-match}", + .client_name = "mx.example.com", + .client_addr = "1.2.3.4", + .want_found = "name-match", + }, + {"good-v4-subnet-match", test_yana_policy, + .policy = "inline:{example.com=name-match, 1.2=addr-match}", + .client_name = "other.example", + .client_addr = "1.2.3.4", + .want_found = "addr-match", + }, + {"good-v4-subnet-non-match", test_yana_policy, + .policy = "inline:{example.com=name-match, 1.2=addr-match}", + .client_name = "other.example", + .client_addr = "2.2.3.4", + }, + {"good-v6-subnet-match", test_yana_policy, + .policy = "inline:{example.com=name-match, 1:2=addr-match}", + .client_name = "other.example", + .client_addr = "1:2::3:4", + .want_found = "addr-match", + }, + {"good-v6-subnet-non-match", test_yana_policy, + .policy = "inline:{example.com=name-match, 1:2=addr-match}", + .client_name = "other.example", + .client_addr = "2:2::3:4", + }, + {"good-regexp-match", test_yana_policy, + .policy = "regexp:{{/\\.example\\.com$$/ name-match}}", + .client_name = "mx.example.com", + .client_addr = "1:2::3:4", + .want_found = "name-match", + }, + {"good-regexp-non-match", test_yana_policy, + .policy = "regexp:{{/\\.example\\.com/ name-match}}", + .client_name = "other.example", + .client_addr = "1:2::3:4", + }, + {"good-cidr-match", test_yana_policy, + .policy = "cidr:{{1.2.3.4 addr-match}}", + .client_addr = "1.2.3.4", + .want_found = "addr-match", + }, + {"good-cidr-non-match", test_yana_policy, + .policy = "cidr:{{1.2.3.4 addr-match}}", + .client_addr = "1.2.3.5", + }, + {"null-data", test_yana_policy, + .policy = "fail:whatever", + }, +}; + +#include diff --git a/postfix/src/postscreen/Makefile.in b/postfix/src/postscreen/Makefile.in index fbf34d37b..82964688f 100644 --- a/postfix/src/postscreen/Makefile.in +++ b/postfix/src/postscreen/Makefile.in @@ -657,6 +657,7 @@ postscreen_tls_conf.o: ../../include/htable.h postscreen_tls_conf.o: ../../include/mail_params.h postscreen_tls_conf.o: ../../include/maps.h postscreen_tls_conf.o: ../../include/match_list.h +postscreen_tls_conf.o: ../../include/match_parent_style.h postscreen_tls_conf.o: ../../include/msg.h postscreen_tls_conf.o: ../../include/myaddrinfo.h postscreen_tls_conf.o: ../../include/myflock.h @@ -680,5 +681,6 @@ postscreen_tls_conf.o: ../../include/tls_proxy_server_start_proto.h postscreen_tls_conf.o: ../../include/vbuf.h postscreen_tls_conf.o: ../../include/vstream.h postscreen_tls_conf.o: ../../include/vstring.h +postscreen_tls_conf.o: ../../include/yana_policy.h postscreen_tls_conf.o: postscreen.h postscreen_tls_conf.o: postscreen_tls_conf.c diff --git a/postfix/src/postscreen/postscreen.c b/postfix/src/postscreen/postscreen.c index 793673049..9614608da 100644 --- a/postfix/src/postscreen/postscreen.c +++ b/postfix/src/postscreen/postscreen.c @@ -395,6 +395,9 @@ /* The \fBpostscreen\fR(8) equivalent of smtpd_tls_key_file. /* .IP "\fBpostscreen_tls_loglevel ($smtpd_tls_loglevel)\fR" /* The \fBpostscreen\fR(8) equivalent of smtpd_tls_loglevel. +/* .IP "\fBpostscreen_tls_loglevel_maps ($smtpd_tls_loglevel_maps)\fR" +/* Optional TLS loglevel override that depends on the remote peer +/* host name or IP address. /* .IP "\fBpostscreen_tls_mandatory_ciphers ($smtpd_tls_mandatory_ciphers)\fR" /* The \fBpostscreen\fR(8) equivalent of smtpd_tls_mandatory_ciphers. /* .IP "\fBpostscreen_tls_mandatory_exclude_ciphers ($smtpd_tls_mandatory_exclude_ciphers)\fR" @@ -635,6 +638,7 @@ char *var_smtpd_tls_excl_ciph; char *var_smtpd_tls_fpt_dgst; char *var_smtpd_tls_key_file; char *var_smtpd_tls_loglevel; +char *var_smtpd_tls_loglevel_maps; char *var_smtpd_tls_mand_ciph; char *var_smtpd_tls_mand_excl; char *var_smtpd_tls_mand_proto; @@ -664,6 +668,7 @@ char *var_psc_tls_excl_ciph; char *var_psc_tls_fpt_dgst; char *var_psc_tls_key_file; char *var_psc_tls_loglevel; +char *var_psc_tls_loglevel_maps; char *var_psc_tls_mand_ciph; char *var_psc_tls_mand_excl; char *var_psc_tls_mand_proto; @@ -1309,6 +1314,7 @@ int main(int argc, char **argv) VAR_SMTPD_TLS_FPT_DGST, DEF_SMTPD_TLS_FPT_DGST, &var_smtpd_tls_fpt_dgst, 1, 0, VAR_SMTPD_TLS_KEY_FILE, DEF_SMTPD_TLS_KEY_FILE, &var_smtpd_tls_key_file, 0, 0, VAR_SMTPD_TLS_LOGLEVEL, DEF_SMTPD_TLS_LOGLEVEL, &var_smtpd_tls_loglevel, 0, 0, + VAR_SMTPD_TLS_LOGLEVEL_MAPS, DEF_SMTPD_TLS_LOGLEVEL_MAPS, &var_smtpd_tls_loglevel_maps, 0, 0, VAR_SMTPD_TLS_MAND_CIPH, DEF_SMTPD_TLS_MAND_CIPH, &var_smtpd_tls_mand_ciph, 1, 0, VAR_SMTPD_TLS_MAND_EXCL, DEF_SMTPD_TLS_MAND_EXCL, &var_smtpd_tls_mand_excl, 0, 0, VAR_SMTPD_TLS_MAND_PROTO, DEF_SMTPD_TLS_MAND_PROTO, &var_smtpd_tls_mand_proto, 0, 0, @@ -1345,6 +1351,7 @@ int main(int argc, char **argv) VAR_PSC_TLS_FPT_DGST, DEF_PSC_TLS_FPT_DGST, &var_psc_tls_fpt_dgst, 1, 0, VAR_PSC_TLS_KEY_FILE, DEF_PSC_TLS_KEY_FILE, &var_psc_tls_key_file, 0, 0, VAR_PSC_TLS_LOGLEVEL, DEF_PSC_TLS_LOGLEVEL, &var_psc_tls_loglevel, 0, 0, + VAR_PSC_TLS_LOGLEVEL_MAPS, DEF_PSC_TLS_LOGLEVEL_MAPS, &var_psc_tls_loglevel_maps, 0, 0, VAR_PSC_TLS_MAND_CIPH, DEF_PSC_TLS_MAND_CIPH, &var_psc_tls_mand_ciph, 1, 0, VAR_PSC_TLS_MAND_EXCL, DEF_PSC_TLS_MAND_EXCL, &var_psc_tls_mand_excl, 0, 0, VAR_PSC_TLS_MAND_PROTO, DEF_PSC_TLS_MAND_PROTO, &var_psc_tls_mand_proto, 0, 0, diff --git a/postfix/src/postscreen/postscreen.h b/postfix/src/postscreen/postscreen.h index c8ae62e2b..c9b24ccdc 100644 --- a/postfix/src/postscreen/postscreen.h +++ b/postfix/src/postscreen/postscreen.h @@ -80,6 +80,7 @@ typedef struct { int smtp_server_fd; /* real SMTP server */ char *smtp_client_addr; /* client address */ char *smtp_client_port; /* client port */ + char *smtp_client_addr_port; /* [client_addr]:client_port */ char *smtp_server_addr; /* server address */ char *smtp_server_port; /* server port */ const char *final_reply; /* cause for hanging up */ @@ -417,6 +418,8 @@ extern HTABLE *psc_client_concurrency; /* per-client concurrency */ /* * postscreen_state.c + * + * TODO(wietse): migrate PSC_CLIENT_ADDR_PORT to smtp_client_addr_port. */ #define PSC_CLIENT_ADDR_PORT(state) \ (state)->smtp_client_addr, (state)->smtp_client_port @@ -571,7 +574,7 @@ extern bool psc_tls_pre_jail(void); #ifdef USE_TLS extern TLS_SERVER_PARAMS psc_tls_params; extern TLS_SERVER_INIT_PROPS psc_init_props; -extern bool psc_tls_pre_start(const char *, TLS_SERVER_START_PROPS *); +extern bool psc_tls_pre_start(const PSC_STATE *, TLS_SERVER_START_PROPS *); #endif diff --git a/postfix/src/postscreen/postscreen_dnsbl_test.c b/postfix/src/postscreen/postscreen_dnsbl_test.c index 96ec561c4..8e3a0fcf6 100644 --- a/postfix/src/postscreen/postscreen_dnsbl_test.c +++ b/postfix/src/postscreen/postscreen_dnsbl_test.c @@ -8,6 +8,7 @@ */ #include #include +#include /* * Utility library. diff --git a/postfix/src/postscreen/postscreen_starttls.c b/postfix/src/postscreen/postscreen_starttls.c index 3124223d5..3280f6d43 100644 --- a/postfix/src/postscreen/postscreen_starttls.c +++ b/postfix/src/postscreen/postscreen_starttls.c @@ -204,7 +204,6 @@ static void psc_starttls_first(int event, void *context) PSC_STARTTLS *starttls_state = (PSC_STARTTLS *) context; PSC_STATE *smtp_state = starttls_state->smtp_state; VSTREAM *tlsproxy_stream = starttls_state->tlsproxy_stream; - static VSTRING *remote_endpt = 0; TLS_SERVER_START_PROPS start_props; if (msg_verbose) @@ -242,18 +241,12 @@ static void psc_starttls_first(int event, void *context) * Send the data attributes now, and send the client file descriptor in a * later transaction. We report all errors asynchronously, to avoid * having to maintain multiple error delivery paths. - * - * XXX The formatted endpoint should be a state member. Then, we can - * simplify all the format strings throughout the program. */ - if (remote_endpt == 0) - remote_endpt = vstring_alloc(20); - vstring_sprintf(remote_endpt, "[%s]:%s", smtp_state->smtp_client_addr, - smtp_state->smtp_client_port); - psc_tls_pre_start(STR(remote_endpt), &start_props); + psc_tls_pre_start(smtp_state, &start_props); if (attr_print(tlsproxy_stream, ATTR_FLAG_NONE, - SEND_ATTR_STR(TLS_ATTR_REMOTE_ENDPT, STR(remote_endpt)), + SEND_ATTR_STR(TLS_ATTR_REMOTE_ENDPT, + smtp_state->smtp_client_addr_port), SEND_ATTR_INT(TLS_ATTR_FLAGS, TLS_PROXY_FLAG_ROLE_SERVER), SEND_ATTR_INT(TLS_ATTR_TIMEOUT, psc_normal_cmd_time_limit), SEND_ATTR_INT(TLS_ATTR_TIMEOUT, psc_normal_cmd_time_limit), diff --git a/postfix/src/postscreen/postscreen_state.c b/postfix/src/postscreen/postscreen_state.c index 2b5db3c16..d22bd656e 100644 --- a/postfix/src/postscreen/postscreen_state.c +++ b/postfix/src/postscreen/postscreen_state.c @@ -140,6 +140,7 @@ #include #include #include +#include /* Global library. */ @@ -162,6 +163,7 @@ PSC_STATE *psc_new_session_state(VSTREAM *stream, const char *server_port) { PSC_STATE *state; + VSTRING *addr_port; state = (PSC_STATE *) mymalloc(sizeof(*state)); if ((state->smtp_client_stream = stream) != 0) @@ -169,6 +171,9 @@ PSC_STATE *psc_new_session_state(VSTREAM *stream, state->smtp_server_fd = (-1); state->smtp_client_addr = mystrdup(client_addr); state->smtp_client_port = mystrdup(client_port); + addr_port = vstring_alloc(30); + vstring_sprintf(addr_port, "[%s]:%s", client_addr, client_port); + state->smtp_client_addr_port = vstring_export(addr_port); state->smtp_server_addr = mystrdup(server_addr); state->smtp_server_port = mystrdup(server_port); state->send_buf = vstring_alloc(100); @@ -243,6 +248,7 @@ void psc_free_session_state(PSC_STATE *state) state->send_buf = vstring_free(state->send_buf); myfree(state->smtp_client_addr); myfree(state->smtp_client_port); + myfree(state->smtp_client_addr_port); myfree(state->smtp_server_addr); myfree(state->smtp_server_port); if (state->dnsbl_reply) diff --git a/postfix/src/postscreen/postscreen_tls_conf.c b/postfix/src/postscreen/postscreen_tls_conf.c index ab3f2f4f3..4b52a6d17 100644 --- a/postfix/src/postscreen/postscreen_tls_conf.c +++ b/postfix/src/postscreen/postscreen_tls_conf.c @@ -64,6 +64,8 @@ /* Global library. */ #include +#include +#include /* TLS library. */ @@ -84,9 +86,12 @@ * Pre-computed state based on configuration parameters. TODO(wietse): some * legacy booleans use "|=". Fix that when this code is factored out. */ +bool psc_tls_ready; + +#ifdef USE_TLS TLS_SERVER_PARAMS psc_tls_params; TLS_SERVER_INIT_PROPS psc_init_props; -bool psc_tls_ready; +#endif /* * Private state. @@ -94,6 +99,11 @@ bool psc_tls_ready; static bool psc_tls_pre_jail_done; static int ask_client_cert; + /* + * Per-peer TLS logging policy. + */ +static YANA_POLICY *psc_tls_loglevel_maps; + /* psc_tls_pre_jail - pre-compute per-process TLS properties */ bool psc_tls_pre_jail(void) @@ -144,7 +154,6 @@ bool psc_tls_pre_jail(void) int no_server_cert_ok; int require_server_cert; - /* * Can't use anonymous ciphers if we want client certificates. Must * use anonymous ciphers if we have no certificates. @@ -221,6 +230,18 @@ bool psc_tls_pre_jail(void) msg_warn("TLS has been selected, but TLS support is not compiled in"); #endif } + + /* + * Per-peer TLS logging. + */ +#ifdef USE_TLS + if (*var_psc_tls_loglevel_maps) + psc_tls_loglevel_maps = + yana_policy_create(VAR_PSC_TLS_LOGLEVEL_MAPS, + var_psc_tls_loglevel_maps, + match_parent_style(VAR_PSC_TLS_LOGLEVEL_MAPS)); +#endif + psc_tls_pre_jail_done = true; return (psc_tls_ready); } @@ -229,16 +250,27 @@ bool psc_tls_pre_jail(void) /* psc_tls_pre_start - assign per-request TLS properties */ -bool psc_tls_pre_start(const char *remote_endpt, +bool psc_tls_pre_start(const PSC_STATE *state, TLS_SERVER_START_PROPS *start_props) { static char *cipher_grade; static VSTRING *cipher_exclusions; int requirecert; + const char *peer_log_param; + const char *peer_log_level; if (!psc_tls_ready) return (false); + if (psc_tls_loglevel_maps + && (peer_log_level = yana_policy_lookup(psc_tls_loglevel_maps, + "", state->smtp_client_addr)) != 0) { + peer_log_param = VAR_PSC_TLS_LOGLEVEL_MAPS; + } else { + peer_log_param = VAR_PSC_TLS_LOGLEVEL; + peer_log_level = var_smtpd_tls_loglevel; + } + /* * In non-wrapper mode, it is possible to require client certificate * verification without requiring TLS. Since certificates can be verified @@ -269,11 +301,13 @@ bool psc_tls_pre_start(const char *remote_endpt, } requirecert = (var_psc_tls_req_ccert && var_psc_enforce_tls); TLS_PROXY_SERVER_START_PROPS(start_props, + log_param = peer_log_param, + log_level = peer_log_level, timeout = var_psc_starttls_tmout, enable_rpk = var_psc_tls_enable_rpk, requirecert = requirecert, serverid = var_servname, - namaddr = remote_endpt, + namaddr = state->smtp_client_addr_port, cipher_grade = cipher_grade, cipher_exclusions = STR(cipher_exclusions), mdalg = var_psc_tls_fpt_dgst); diff --git a/postfix/src/posttls-finger/posttls-finger.c b/postfix/src/posttls-finger/posttls-finger.c index 109191c3f..da3cfe469 100644 --- a/postfix/src/posttls-finger/posttls-finger.c +++ b/postfix/src/posttls-finger/posttls-finger.c @@ -820,6 +820,8 @@ static int starttls(STATE *state) CApath = state->CApath, mdalg = state->mdalg); TLS_PROXY_CLIENT_START_PROPS(&start_props, + log_param = "-L option", + log_level = state->options.logopts, timeout = smtp_tmout, enable_rpk = state->options.enable_rpk, tls_level = state->level, @@ -924,6 +926,8 @@ static int starttls(STATE *state) state->tls_context = TLS_CLIENT_START(&start_props, ctx = state->tls_ctx, + log_param = "-L option", + log_level = state->options.logopts, stream = stream, fd = -1, timeout = smtp_tmout, diff --git a/postfix/src/smtp/Makefile.in b/postfix/src/smtp/Makefile.in index 83181852b..be3379148 100644 --- a/postfix/src/smtp/Makefile.in +++ b/postfix/src/smtp/Makefile.in @@ -118,6 +118,7 @@ smtp.o: ../../include/mail_server.h smtp.o: ../../include/mail_version.h smtp.o: ../../include/maps.h smtp.o: ../../include/match_list.h +smtp.o: ../../include/match_parent_style.h smtp.o: ../../include/mime_state.h smtp.o: ../../include/msg.h smtp.o: ../../include/msg_stats.h @@ -149,6 +150,7 @@ smtp.o: ../../include/tok822.h smtp.o: ../../include/vbuf.h smtp.o: ../../include/vstream.h smtp.o: ../../include/vstring.h +smtp.o: ../../include/yana_policy.h smtp.o: lmtp_params.c smtp.o: smtp.c smtp.o: smtp.h @@ -552,6 +554,7 @@ smtp_proto.o: ../../include/vstream.h smtp_proto.o: ../../include/vstring.h smtp_proto.o: ../../include/vstring_vstream.h smtp_proto.o: ../../include/xtext.h +smtp_proto.o: ../../include/yana_policy.h smtp_proto.o: smtp.h smtp_proto.o: smtp_proto.c smtp_proto.o: smtp_reqtls_policy.h diff --git a/postfix/src/smtp/lmtp_params.c b/postfix/src/smtp/lmtp_params.c index 5b2445b68..7e76bf56b 100644 --- a/postfix/src/smtp/lmtp_params.c +++ b/postfix/src/smtp/lmtp_params.c @@ -31,6 +31,7 @@ VAR_LMTP_TLS_ECCERT_FILE, DEF_LMTP_TLS_ECCERT_FILE, &var_smtp_tls_eccert_file, 0, 0, VAR_LMTP_TLS_ECKEY_FILE, DEF_LMTP_TLS_ECKEY_FILE, &var_smtp_tls_eckey_file, 0, 0, VAR_LMTP_TLS_LOGLEVEL, DEF_LMTP_TLS_LOGLEVEL, &var_smtp_tls_loglevel, 0, 0, + VAR_LMTP_TLS_LOGLEVEL_MAPS, DEF_LMTP_TLS_LOGLEVEL_MAPS, &var_smtp_tls_loglevel_maps, 0, 0, VAR_LMTP_TLS_SNI, DEF_LMTP_TLS_SNI, &var_smtp_tls_sni, 0, 0, #endif VAR_LMTP_SASL_MECHS, DEF_LMTP_SASL_MECHS, &var_smtp_sasl_mechs, 0, 0, diff --git a/postfix/src/smtp/smtp.c b/postfix/src/smtp/smtp.c index 9a7bcaeb7..b2d38d4a9 100644 --- a/postfix/src/smtp/smtp.c +++ b/postfix/src/smtp/smtp.c @@ -670,6 +670,11 @@ /* .IP "\fBsmtp_log_tls_feature_status (yes)\fR" /* Enable logging of TLS feature information in delivery status /* logging. +/* .PP +/* Available in Postfix version 3.12 and later: +/* .IP "\fBsmtp_tls_loglevel_maps (empty)\fR" +/* Optional TLS loglevel override that depends on the remote peer +/* host name or IP address. /* OBSOLETE TLS CONTROLS /* .ad /* .fi @@ -1038,6 +1043,11 @@ #include #include +#ifdef USE_TLS +#include +#include +#endif + /* DNS library. */ #include @@ -1132,6 +1142,7 @@ char *var_smtp_tls_dkey_file; bool var_smtp_tls_enforce_peername; char *var_smtp_tls_key_file; char *var_smtp_tls_loglevel; +char *var_smtp_tls_loglevel_maps; bool var_smtp_tls_note_starttls_offer; char *var_smtp_tls_mand_proto; char *var_smtp_tls_sec_cmatch; @@ -1221,6 +1232,8 @@ SMTP_REQTLS_POLICY *smtp_reqtls_policy; TLS_APPL_STATE *smtp_tls_ctx; int smtp_tls_insecure_mx_policy; +YANA_POLICY *smtp_tls_loglevel_maps; + #endif /* @@ -1729,6 +1742,17 @@ static void pre_init(char *unused_name, char **unused_argv) smtp_reqtls_policy = smtp_reqtls_policy_parse(VAR_LMTP_SMTP(REQTLS_POLICY), var_smtp_reqtls_policy); + + /* + * Per-peer TLS logging. + */ +#ifdef USE_TLS + if (*var_smtp_tls_loglevel_maps) + smtp_tls_loglevel_maps = + yana_policy_create(VAR_SMTP_TLS_LOGLEVEL_MAPS, + var_smtp_tls_loglevel_maps, + match_parent_style(VAR_SMTP_TLS_LOGLEVEL_MAPS)); +#endif } /* pre_accept - see if tables have changed */ diff --git a/postfix/src/smtp/smtp.h b/postfix/src/smtp/smtp.h index c25288c84..782a7fd70 100644 --- a/postfix/src/smtp/smtp.h +++ b/postfix/src/smtp/smtp.h @@ -411,6 +411,7 @@ extern STRING_LIST *smtp_use_srv_lookup;/* services with SRV record lookup */ extern TLS_APPL_STATE *smtp_tls_ctx; /* client-side TLS engine */ extern int smtp_tls_insecure_mx_policy; /* DANE post insecure MX? */ extern SMTP_REQTLS_POLICY *smtp_reqtls_policy; /* parsed list */ +extern struct YANA_POLICY *smtp_tls_loglevel_maps; #endif diff --git a/postfix/src/smtp/smtp_params.c b/postfix/src/smtp/smtp_params.c index 63aac7f0f..e206e4201 100644 --- a/postfix/src/smtp/smtp_params.c +++ b/postfix/src/smtp/smtp_params.c @@ -31,6 +31,7 @@ VAR_SMTP_TLS_ECCERT_FILE, DEF_SMTP_TLS_ECCERT_FILE, &var_smtp_tls_eccert_file, 0, 0, VAR_SMTP_TLS_ECKEY_FILE, DEF_SMTP_TLS_ECKEY_FILE, &var_smtp_tls_eckey_file, 0, 0, VAR_SMTP_TLS_LOGLEVEL, DEF_SMTP_TLS_LOGLEVEL, &var_smtp_tls_loglevel, 0, 0, + VAR_SMTP_TLS_LOGLEVEL_MAPS, DEF_SMTP_TLS_LOGLEVEL_MAPS, &var_smtp_tls_loglevel_maps, 0, 0, VAR_SMTP_TLS_SNI, DEF_SMTP_TLS_SNI, &var_smtp_tls_sni, 0, 0, VAR_SMTP_TLS_INSECURE_MX_POLICY, DEF_SMTP_TLS_INSECURE_MX_POLICY, &var_smtp_tls_insecure_mx_policy, 0, 0, #endif diff --git a/postfix/src/smtp/smtp_proto.c b/postfix/src/smtp/smtp_proto.c index b5538b4e5..f67360882 100644 --- a/postfix/src/smtp/smtp_proto.c +++ b/postfix/src/smtp/smtp_proto.c @@ -160,6 +160,9 @@ #if defined(USE_TLS) && defined(USE_TLSRPT) #include #endif +#ifdef USE_TLS +#include +#endif /* Application-specific. */ @@ -984,6 +987,18 @@ static int smtp_start_tls(SMTP_STATE *state) TLS_CLIENT_INIT_PROPS init_props; VSTREAM *tlsproxy; VSTRING *port_buf; + const char *peer_log_param; + const char *peer_log_level; + + if (smtp_tls_loglevel_maps + && (peer_log_level = yana_policy_lookup(smtp_tls_loglevel_maps, + STR(iter->host), + STR(iter->addr))) != 0) { + peer_log_param = VAR_SMTP_TLS_LOGLEVEL_MAPS; + } else { + peer_log_param = VAR_SMTP_TLS_LOGLEVEL; + peer_log_level = var_smtp_tls_loglevel; + } /* * When the TLS handshake succeeds, we can reuse a connection only if TLS @@ -1059,6 +1074,8 @@ static int smtp_start_tls(SMTP_STATE *state) CApath = var_smtp_tls_CApath, mdalg = var_smtp_tls_fpt_dgst); TLS_PROXY_CLIENT_START_PROPS(&start_props, + log_param = peer_log_param, + log_level = peer_log_level, timeout = var_smtp_starttls_tmout, tls_level = state->tls->level, enable_rpk = state->tls->enable_rpk, @@ -1186,6 +1203,8 @@ static int smtp_start_tls(SMTP_STATE *state) session->tls_context = TLS_CLIENT_START(&start_props, ctx = smtp_tls_ctx, + log_param = peer_log_param, + log_level = peer_log_level, stream = session->stream, fd = -1, timeout = var_smtp_starttls_tmout, diff --git a/postfix/src/smtpd/Makefile.in b/postfix/src/smtpd/Makefile.in index 2b9e4703d..133290975 100644 --- a/postfix/src/smtpd/Makefile.in +++ b/postfix/src/smtpd/Makefile.in @@ -316,6 +316,7 @@ smtpd.o: ../../include/vstring.h smtpd.o: ../../include/vstring_vstream.h smtpd.o: ../../include/watchdog.h smtpd.o: ../../include/xtext.h +smtpd.o: ../../include/yana_policy.h smtpd.o: smtpd.c smtpd.o: smtpd.h smtpd.o: smtpd_chat.h diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index 976d52ea0..4480eb954 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -557,6 +557,11 @@ /* Whether to trust client certificates whose extended key usage (EKU) lists /* only \fBserverAuth\fR and not \fBclientAuth\fR as valid TLS client /* certificates. +/* .PP +/* Available in Postfix version 3.12 and later: +/* .IP "\fBsmtpd_tls_loglevel_maps (empty)\fR" +/* Optional TLS loglevel override that depends on the remote peer +/* host name or IP address. /* OBSOLETE TLS CONTROLS /* .ad /* .fi @@ -1344,6 +1349,10 @@ #include #include +#ifdef USE_TLS +#include +#endif + /* Single-threaded server skeleton. */ #include @@ -1519,6 +1528,7 @@ char *var_smtpd_tls_dh512_param_file; char *var_smtpd_tls_dkey_file; char *var_smtpd_tls_key_file; char *var_smtpd_tls_loglevel; +char *var_smtpd_tls_loglevel_maps; char *var_smtpd_tls_mand_proto; bool var_smtpd_tls_received_header; bool var_smtpd_tls_req_ccert; @@ -1673,6 +1683,11 @@ static TLS_APPL_STATE *smtpd_tls_ctx; #endif /* USE_TLSPROXY */ static int ask_client_cert; + /* + * Per-peer TLS logging policy. + */ +static YANA_POLICY *smtpd_tls_loglevel_maps; + #endif /* @@ -5254,6 +5269,17 @@ static void smtpd_start_tls(SMTPD_STATE *state) TLS_SERVER_START_PROPS props; static char *cipher_grade; static VSTRING *cipher_exclusions; + const char *peer_log_param; + const char *peer_log_level; + + if (smtpd_tls_loglevel_maps + && (peer_log_level = yana_policy_lookup(smtpd_tls_loglevel_maps, + state->name, state->addr)) != 0) { + peer_log_param = VAR_SMTPD_TLS_LOGLEVEL_MAPS; + } else { + peer_log_param = VAR_SMTPD_TLS_LOGLEVEL; + peer_log_level = var_smtpd_tls_loglevel; + } #ifdef USE_TLSPROXY TLS_SERVER_PARAMS tls_params; @@ -5310,6 +5336,8 @@ static void smtpd_start_tls(SMTPD_STATE *state) */ tls_proxy_server_param_from_config(&tls_params); TLS_PROXY_SERVER_START_PROPS(&props, + log_param = peer_log_param, + log_level = peer_log_level, timeout = var_smtpd_starttls_tmout, enable_rpk = var_smtpd_tls_enable_rpk, requirecert = requirecert, @@ -5355,6 +5383,8 @@ static void smtpd_start_tls(SMTPD_STATE *state) state->tls_context = TLS_SERVER_START(&props, ctx = smtpd_tls_ctx, + log_param = peer_log_param, + log_level = peer_log_level, stream = state->client, fd = -1, timeout = var_smtpd_starttls_tmout, @@ -6745,6 +6775,17 @@ static void pre_jail_init(char *unused_name, char **unused_argv) */ if (*var_smtpd_rej_ftr_maps || *var_smtpd_reject_filter_maps) smtpd_chat_pre_jail_init(); + + /* + * Per-peer TLS logging. + */ +#ifdef USE_TLS + if (*var_smtpd_tls_loglevel_maps) + smtpd_tls_loglevel_maps = + yana_policy_create(VAR_SMTPD_TLS_LOGLEVEL_MAPS, + var_smtpd_tls_loglevel_maps, + match_parent_style(VAR_SMTPD_TLS_LOGLEVEL_MAPS)); +#endif } /* post_jail_init - post-jail initialization */ @@ -6981,6 +7022,7 @@ int main(int argc, char **argv) VAR_SMTPD_TLS_EECDH, DEF_SMTPD_TLS_EECDH, &var_smtpd_tls_eecdh, 1, 0, VAR_SMTPD_TLS_FPT_DGST, DEF_SMTPD_TLS_FPT_DGST, &var_smtpd_tls_fpt_dgst, 1, 0, VAR_SMTPD_TLS_LOGLEVEL, DEF_SMTPD_TLS_LOGLEVEL, &var_smtpd_tls_loglevel, 0, 0, + VAR_SMTPD_TLS_LOGLEVEL_MAPS, DEF_SMTPD_TLS_LOGLEVEL_MAPS, &var_smtpd_tls_loglevel_maps, 0, 0, #endif VAR_SMTPD_TLS_LEVEL, DEF_SMTPD_TLS_LEVEL, &var_smtpd_tls_level, 0, 0, VAR_SMTPD_SASL_TYPE, DEF_SMTPD_SASL_TYPE, &var_smtpd_sasl_type, 1, 0, diff --git a/postfix/src/testing/mock_myaddrinfo_test.c b/postfix/src/testing/mock_myaddrinfo_test.c index 4d4131044..216fa0be3 100644 --- a/postfix/src/testing/mock_myaddrinfo_test.c +++ b/postfix/src/testing/mock_myaddrinfo_test.c @@ -75,7 +75,7 @@ static void test_hostname_to_sockaddr_failure(PTEST_CTX *t, * The missing expectation is intentional. Do not count this as an error. */ expect_ptest_error(t, "unexpected call: " - "hostname_to_sockaddr_pf(\"notexist\", 0, \"smtp\", 1, (ptr))"); + "hostname_to_sockaddr_pf(\"notexist\", 0, \"smtp\", "); /* * Invoke the mock and verify results. @@ -145,8 +145,7 @@ static void test_hostaddr_to_sockaddr_failure(PTEST_CTX *t, * The missing expectation is intentional. Do not count this as an error. */ expect_ptest_error(t, "unexpected call: " - "hostaddr_to_sockaddr(\"127.0.0.1\", \"25\", " - "1, (ptr))"); + "hostaddr_to_sockaddr(\"127.0.0.1\", \"25\", "); /* * Invoke the mock and verify results. diff --git a/postfix/src/tls/tls.h b/postfix/src/tls/tls.h index 507aff593..8ce9c213c 100644 --- a/postfix/src/tls/tls.h +++ b/postfix/src/tls/tls.h @@ -496,6 +496,8 @@ typedef struct { typedef struct { TLS_APPL_STATE *ctx; + const char *log_param; + const char *log_level; VSTREAM *stream; int fd; /* Event-driven file descriptor */ int timeout; @@ -538,13 +540,13 @@ extern TLS_SESS_STATE *tls_client_post_connect(TLS_SESS_STATE *, a6, a7, a8, a9, a10, a11, a12, a13, a14)) #define TLS_CLIENT_START(props, a1, a2, a3, a4, a5, a6, a7, a8, a9, \ - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) \ + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22) \ tls_client_start((((props)->a1), ((props)->a2), ((props)->a3), \ ((props)->a4), ((props)->a5), ((props)->a6), ((props)->a7), \ ((props)->a8), ((props)->a9), ((props)->a10), ((props)->a11), \ ((props)->a12), ((props)->a13), ((props)->a14), ((props)->a15), \ ((props)->a16), ((props)->a17), ((props)->a18), ((props)->a19), \ - ((props)->a20), (props))) + ((props)->a20), ((props)->a21), ((props)->a22), (props))) /* * tls_server.c @@ -574,6 +576,8 @@ typedef struct { typedef struct { TLS_APPL_STATE *ctx; /* TLS application context */ + const char *log_param; + const char *log_level; VSTREAM *stream; /* Client stream */ int fd; /* Event-driven file descriptor */ int timeout; /* TLS handshake timeout */ @@ -608,11 +612,11 @@ extern TLS_SESS_STATE *tls_server_post_accept(TLS_SESS_STATE *); a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)) #define TLS_SERVER_START(props, a1, a2, a3, a4, a5, a6, a7, a8, a9, \ - a10, a11) \ + a10, a11, a12, a13) \ tls_server_start((((props)->a1), ((props)->a2), ((props)->a3), \ ((props)->a4), ((props)->a5), ((props)->a6), ((props)->a7), \ ((props)->a8), ((props)->a9), ((props)->a10), ((props)->a11), \ - (props))) + ((props)->a12), ((props)->a13), (props))) /* * tls_session.c diff --git a/postfix/src/tls/tls_client.c b/postfix/src/tls/tls_client.c index e7ec3c8e8..23e66964b 100644 --- a/postfix/src/tls/tls_client.c +++ b/postfix/src/tls/tls_client.c @@ -978,7 +978,12 @@ TLS_SESS_STATE *tls_client_start(const TLS_CLIENT_START_PROPS *props) SSL_SESSION *session = 0; TLS_SESS_STATE *TLScontext; TLS_APPL_STATE *app_ctx = props->ctx; - int log_mask = app_ctx->log_mask; + int log_mask; + + /* + * Convert user loglevel to internal logmask. + */ + log_mask = tls_log_mask(props->log_param, props->log_level); /* * When certificate verification is required, log trust chain validation @@ -1038,6 +1043,16 @@ TLS_SESS_STATE *tls_client_start(const TLS_CLIENT_START_PROPS *props) return (0); } + /* + * Set the call-back routine for verbose logging. + * + * Log_mask-dependent behavior should be consistent whether it is specified + * globally in tls_client_init(), or per-connection in + * tls_client_start(). + */ + if (log_mask & TLS_LOG_DEBUG) + SSL_set_info_callback(TLScontext->con, tls_info_callback); + /* * Per session cipher selection for sessions with mandatory encryption * diff --git a/postfix/src/tls/tls_misc.c b/postfix/src/tls/tls_misc.c index af234a74e..dad8cb54f 100644 --- a/postfix/src/tls/tls_misc.c +++ b/postfix/src/tls/tls_misc.c @@ -660,7 +660,7 @@ int tls_proto_mask_lims(const char *plist, int *floor, int *ceiling) void tls_param_init(void) { - /* If this changes, update TLS_CLIENT_PARAMS in tls_proxy.h. */ + /* If this changes, update TLS_*_PARAMS* in tls_*.h. */ static const CONFIG_STR_TABLE str_table[] = { VAR_TLS_CNF_FILE, DEF_TLS_CNF_FILE, &var_tls_cnf_file, 0, 0, VAR_TLS_CNF_NAME, DEF_TLS_CNF_NAME, &var_tls_cnf_name, 0, 0, @@ -682,13 +682,13 @@ void tls_param_init(void) 0, }; - /* If this changes, update TLS_CLIENT_PARAMS in tls_proxy.h. */ + /* If this changes, update TLS_*_PARAMS* in tls_*.h. */ static const CONFIG_INT_TABLE int_table[] = { VAR_TLS_DAEMON_RAND_BYTES, DEF_TLS_DAEMON_RAND_BYTES, &var_tls_daemon_rand_bytes, 1, 0, 0, }; - /* If this changes, update TLS_CLIENT_PARAMS in tls_proxy.h. */ + /* If this changes, update TLS_*_PARAMS* in tls_*.h. */ static const CONFIG_BOOL_TABLE bool_table[] = { VAR_TLS_APPEND_DEF_CA, DEF_TLS_APPEND_DEF_CA, &var_tls_append_def_CA, VAR_TLS_PREEMPT_CLIST, DEF_TLS_PREEMPT_CLIST, &var_tls_preempt_clist, @@ -845,7 +845,7 @@ void tls_pre_jail_init(TLS_ROLE role) maps_create(VAR_TLS_SERVER_SNI_MAPS, var_tls_server_sni_maps, flags); } -int tls_cert_cb(SSL *ssl, void *arg) +int tls_cert_cb(SSL *ssl, void *arg) { TLS_SESS_STATE *TLScontext = arg; const char *cp = TLScontext->peer_sni; @@ -869,12 +869,11 @@ int tls_cert_cb(SSL *ssl, void *arg) } msg_info("TLS SNI %s from %s not matched, using default chain", TLScontext->peer_sni, TLScontext->namaddr); - return 1; + return 1; } - SSL_certs_clear(ssl); if (tls_load_pem_chain(ssl, pem, TLScontext->peer_sni) == 0) - return 1; + return 1; /* errors already logged */ return 0; @@ -917,7 +916,6 @@ static int server_sni_callback(SSL *ssl, int *alert, void *unused) TLScontext->namaddr, TLScontext->peer_sni, sni); return SSL_TLSEXT_ERR_NOACK; } - TLScontext->peer_sni = mystrdup(sni); return SSL_TLSEXT_ERR_OK; } diff --git a/postfix/src/tls/tls_proxy_client_init_proto.c b/postfix/src/tls/tls_proxy_client_init_proto.c index eecdbdda3..e9a827b97 100644 --- a/postfix/src/tls/tls_proxy_client_init_proto.c +++ b/postfix/src/tls/tls_proxy_client_init_proto.c @@ -133,7 +133,7 @@ char *tls_proxy_client_init_serialize(ATTR_PRINT_COMMON_FN print_fn, TLS_CLIENT_INIT_PROPS *tls_proxy_client_init_from_string( ATTR_SCAN_COMMON_FN scan_fn, - VSTRING *buf) + VSTRING *buf) { const char myname[] = "tls_proxy_client_init_from_string"; TLS_CLIENT_INIT_PROPS *props = 0; @@ -276,10 +276,13 @@ int tls_proxy_client_init_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp, props->CAfile = vstring_export(CAfile); props->CApath = vstring_export(CApath); props->mdalg = vstring_export(mdalg); - ret = (ret == 14 ? 1 : -1); - if (ret != 1) { + if (ret != 14) { + msg_warn("%s: want 14 attributes, got %d", __func__, ret); + ret = -1; tls_proxy_client_init_free(props); props = 0; + } else { + ret = 1; } *(TLS_CLIENT_INIT_PROPS **) ptr = props; if (msg_verbose) diff --git a/postfix/src/tls/tls_proxy_client_param_proto.c b/postfix/src/tls/tls_proxy_client_param_proto.c index d0720519c..a7e1628e2 100644 --- a/postfix/src/tls/tls_proxy_client_param_proto.c +++ b/postfix/src/tls/tls_proxy_client_param_proto.c @@ -319,11 +319,13 @@ int tls_proxy_client_param_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp, params->tls_dane_digests = vstring_export(tls_dane_digests); params->tls_mgr_service = vstring_export(tls_mgr_service); params->tls_tkt_cipher = vstring_export(tls_tkt_cipher); - - ret = (ret == 19 ? 1 : -1); - if (ret != 1) { + if (ret != 19) { + msg_warn("%s: want 19 attributes, got %d", __func__, ret); + ret = -1; tls_proxy_client_param_free(params); params = 0; + } else { + ret = 1; } *(TLS_CLIENT_PARAMS **) ptr = params; if (msg_verbose) diff --git a/postfix/src/tls/tls_proxy_client_start_proto.c b/postfix/src/tls/tls_proxy_client_start_proto.c index aef615aca..beae3a7c6 100644 --- a/postfix/src/tls/tls_proxy_client_start_proto.c +++ b/postfix/src/tls/tls_proxy_client_start_proto.c @@ -230,6 +230,10 @@ int tls_proxy_client_start_print(ATTR_PRINT_COMMON_FN print_fn, #define STRING_OR_EMPTY(s) ((s) ? (s) : "") ret = print_fn(fp, flags | ATTR_FLAG_MORE, + SEND_ATTR_STR(TLS_ATTR_LOG_PARAM, + STRING_OR_EMPTY(props->log_param)), + SEND_ATTR_STR(TLS_ATTR_LOG_LEVEL, + STRING_OR_EMPTY(props->log_level)), SEND_ATTR_INT(TLS_ATTR_TIMEOUT, props->timeout), SEND_ATTR_INT(TLS_ATTR_ENABLE_RPK, props->enable_rpk), SEND_ATTR_INT(TLS_ATTR_TLS_LEVEL, props->tls_level), @@ -274,6 +278,8 @@ int tls_proxy_client_start_print(ATTR_PRINT_COMMON_FN print_fn, void tls_proxy_client_start_free(TLS_CLIENT_START_PROPS *props) { + myfree((void *) props->log_param); + myfree((void *) props->log_level); myfree((void *) props->nexthop); myfree((void *) props->host); myfree((void *) props->namaddr); @@ -478,6 +484,8 @@ int tls_proxy_client_start_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp, TLS_CLIENT_START_PROPS *props = (TLS_CLIENT_START_PROPS *) mymalloc(sizeof(*props)); int ret; + VSTRING *log_param = vstring_alloc(25); + VSTRING *log_level = vstring_alloc(25); VSTRING *nexthop = vstring_alloc(25); VSTRING *host = vstring_alloc(25); VSTRING *namaddr = vstring_alloc(25); @@ -491,9 +499,9 @@ int tls_proxy_client_start_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp, VSTRING *ffail_type = vstring_alloc(25); #ifdef USE_TLSRPT -#define EXPECT_START_SCAN_RETURN 17 +#define EXPECT_START_SCAN_RETURN 19 #else -#define EXPECT_START_SCAN_RETURN 16 +#define EXPECT_START_SCAN_RETURN 18 #endif if (msg_verbose) @@ -508,6 +516,8 @@ int tls_proxy_client_start_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp, props->fd = -1; props->dane = 0; /* scan_fn may return early */ ret = scan_fn(fp, flags | ATTR_FLAG_MORE, + RECV_ATTR_STR(TLS_ATTR_LOG_PARAM, log_param), + RECV_ATTR_STR(TLS_ATTR_LOG_LEVEL, log_level), RECV_ATTR_INT(TLS_ATTR_TIMEOUT, &props->timeout), RECV_ATTR_INT(TLS_ATTR_ENABLE_RPK, &props->enable_rpk), RECV_ATTR_INT(TLS_ATTR_TLS_LEVEL, &props->tls_level), @@ -532,6 +542,8 @@ int tls_proxy_client_start_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp, RECV_ATTR_STR(TLS_ATTR_FFAIL_TYPE, ffail_type), ATTR_TYPE_END); /* Always construct a well-formed structure. */ + props->log_param = vstring_export(log_param); + props->log_level = vstring_export(log_level); props->nexthop = vstring_export(nexthop); props->host = vstring_export(host); props->namaddr = vstring_export(namaddr); diff --git a/postfix/src/tls/tls_proxy_client_start_proto.h b/postfix/src/tls/tls_proxy_client_start_proto.h index 9965c685d..f1859ff7d 100644 --- a/postfix/src/tls/tls_proxy_client_start_proto.h +++ b/postfix/src/tls/tls_proxy_client_start_proto.h @@ -25,12 +25,12 @@ #ifdef USE_TLS #define TLS_PROXY_CLIENT_START_PROPS(props, a1, a2, a3, a4, a5, a6, a7, a8, \ - a9, a10, a11, a12, a13, a14, a15, a16, a17) \ + a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19) \ (((props)->a1), ((props)->a2), ((props)->a3), \ ((props)->a4), ((props)->a5), ((props)->a6), ((props)->a7), \ ((props)->a8), ((props)->a9), ((props)->a10), ((props)->a11), \ ((props)->a12), ((props)->a13), ((props)->a14), ((props)->a15), \ - ((props)->a16), ((props)->a17)) + ((props)->a16), ((props)->a17), ((props)->a18), ((props)->a19)) extern int tls_proxy_client_start_print(ATTR_PRINT_COMMON_FN, VSTREAM *, int, const void *); extern void tls_proxy_client_start_free(TLS_CLIENT_START_PROPS *); diff --git a/postfix/src/tls/tls_proxy_server_start_proto.c b/postfix/src/tls/tls_proxy_server_start_proto.c index b64dab3ee..db2f6c4ce 100644 --- a/postfix/src/tls/tls_proxy_server_start_proto.c +++ b/postfix/src/tls/tls_proxy_server_start_proto.c @@ -101,6 +101,10 @@ int tls_proxy_server_start_print(ATTR_PRINT_COMMON_FN print_fn, VSTREAM *fp, #define STRING_OR_EMPTY(s) ((s) ? (s) : "") ret = print_fn(fp, flags | ATTR_FLAG_MORE, + SEND_ATTR_STR(TLS_ATTR_LOG_PARAM, + STRING_OR_EMPTY(props->log_param)), + SEND_ATTR_STR(TLS_ATTR_LOG_LEVEL, + STRING_OR_EMPTY(props->log_level)), SEND_ATTR_INT(TLS_ATTR_TIMEOUT, props->timeout), SEND_ATTR_INT(TLS_ATTR_ENABLE_RPK, props->enable_rpk), SEND_ATTR_INT(TLS_ATTR_REQUIRECERT, props->requirecert), @@ -127,6 +131,8 @@ int tls_proxy_server_start_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp, TLS_SERVER_START_PROPS *props = (TLS_SERVER_START_PROPS *) mymalloc(sizeof(*props)); int ret; + VSTRING *log_param = vstring_alloc(25); + VSTRING *log_level = vstring_alloc(25); VSTRING *serverid = vstring_alloc(25); VSTRING *namaddr = vstring_alloc(25); VSTRING *cipher_grade = vstring_alloc(25); @@ -141,6 +147,8 @@ int tls_proxy_server_start_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp, props->stream = 0; /* XXX Caller sets fd. */ ret = scan_fn(fp, flags | ATTR_FLAG_MORE, + RECV_ATTR_STR(TLS_ATTR_LOG_PARAM, log_param), + RECV_ATTR_STR(TLS_ATTR_LOG_LEVEL, log_level), RECV_ATTR_INT(TLS_ATTR_TIMEOUT, &props->timeout), RECV_ATTR_INT(TLS_ATTR_ENABLE_RPK, &props->enable_rpk), RECV_ATTR_INT(TLS_ATTR_REQUIRECERT, &props->requirecert), @@ -151,12 +159,15 @@ int tls_proxy_server_start_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp, cipher_exclusions), RECV_ATTR_STR(TLS_ATTR_MDALG, mdalg), ATTR_TYPE_END); + /* Always construct a well-formed structure. */ + props->log_param = vstring_export(log_param); + props->log_level = vstring_export(log_level); props->serverid = vstring_export(serverid); props->namaddr = vstring_export(namaddr); props->cipher_grade = vstring_export(cipher_grade); props->cipher_exclusions = vstring_export(cipher_exclusions); props->mdalg = vstring_export(mdalg); - ret = (ret == 8 ? 1 : -1); + ret = (ret == 10 ? 1 : -1); if (ret != 1) { tls_proxy_server_start_free(props); props = 0; @@ -170,6 +181,8 @@ int tls_proxy_server_start_scan(ATTR_SCAN_COMMON_FN scan_fn, VSTREAM *fp, void tls_proxy_server_start_free(TLS_SERVER_START_PROPS *props) { /* XXX Caller closes fd. */ + myfree((void *) props->log_param); + myfree((void *) props->log_level); myfree((void *) props->serverid); myfree((void *) props->namaddr); myfree((void *) props->cipher_grade); diff --git a/postfix/src/tls/tls_proxy_server_start_proto.h b/postfix/src/tls/tls_proxy_server_start_proto.h index a63865158..2062d78fb 100644 --- a/postfix/src/tls/tls_proxy_server_start_proto.h +++ b/postfix/src/tls/tls_proxy_server_start_proto.h @@ -24,10 +24,11 @@ #ifdef USE_TLS -#define TLS_PROXY_SERVER_START_PROPS(props, a1, a2, a3, a4, a5, a6, a7, a8) \ +#define TLS_PROXY_SERVER_START_PROPS(props, a1, a2, a3, a4, a5, a6, a7, a8, \ + a9, a10) \ (((props)->a1), ((props)->a2), ((props)->a3), \ ((props)->a4), ((props)->a5), ((props)->a6), ((props)->a7), \ - ((props)->a8)) + ((props)->a8), ((props)->a9), ((props)->a10)) extern int tls_proxy_server_start_print(ATTR_PRINT_COMMON_FN, VSTREAM *, int, const void *); extern void tls_proxy_server_start_free(TLS_SERVER_START_PROPS *); diff --git a/postfix/src/tls/tls_server.c b/postfix/src/tls/tls_server.c index d38b3b331..122628501 100644 --- a/postfix/src/tls/tls_server.c +++ b/postfix/src/tls/tls_server.c @@ -394,7 +394,7 @@ static int trust_server_ccerts(X509_STORE_CTX *ctx, void *unused) int i, usages = 0; if ((x = X509_STORE_CTX_get0_cert(ctx)) == NULL - || (xku = X509_get_ext_d2i(x, NID_ext_key_usage, NULL, NULL)) == NULL) + || (xku = X509_get_ext_d2i(x, NID_ext_key_usage, NULL, NULL)) == NULL) return X509_verify_cert(ctx); for (i = 0; i < sk_ASN1_OBJECT_num(xku); i++) { @@ -740,7 +740,6 @@ TLS_APPL_STATE *tls_server_init(const TLS_SERVER_INIT_PROPS *props) } SSL_CTX_set_client_CA_list(server_ctx, calist); } - if (props->ask_ccert && var_tls_srvr_ccerts) SSL_CTX_set_cert_verify_callback(server_ctx, trust_server_ccerts, NULL); @@ -820,7 +819,12 @@ TLS_SESS_STATE *tls_server_start(const TLS_SERVER_START_PROPS *props) TLS_SESS_STATE *TLScontext; const char *cipher_list; TLS_APPL_STATE *app_ctx = props->ctx; - int log_mask = app_ctx->log_mask; + int log_mask; + + /* + * Convert user loglevel to internal logmask. + */ + log_mask = tls_log_mask(props->log_param, props->log_level); /* * Implicitly enable logging of trust chain errors when verified certs @@ -847,6 +851,17 @@ TLS_SESS_STATE *tls_server_start(const TLS_SERVER_START_PROPS *props) tls_free_context(TLScontext); return (0); } + + /* + * Set the call-back routine for verbose logging. + * + * Log_mask-dependent behavior should be consistent whether it is specified + * globally in tls_server_init(), or per-connection in + * tls_server_start(). + */ + if (log_mask & TLS_LOG_DEBUG) + SSL_set_info_callback(TLScontext->con, tls_info_callback); + cipher_list = tls_set_ciphers(TLScontext, props->cipher_grade, props->cipher_exclusions); if (cipher_list == 0) { @@ -868,7 +883,6 @@ TLS_SESS_STATE *tls_server_start(const TLS_SERVER_START_PROPS *props) tls_free_context(TLScontext); return (0); } - /* Configure the SNI-based certificate selection callback */ SSL_set_cert_cb(TLScontext->con, tls_cert_cb, TLScontext); diff --git a/postfix/src/util/sys_defs.h b/postfix/src/util/sys_defs.h index e14b2ef8e..ebda90a69 100644 --- a/postfix/src/util/sys_defs.h +++ b/postfix/src/util/sys_defs.h @@ -31,14 +31,15 @@ || defined(FREEBSD5) || defined(FREEBSD6) || defined(FREEBSD7) \ || defined(FREEBSD8) || defined(FREEBSD9) || defined(FREEBSD10) \ || defined(FREEBSD11) || defined(FREEBSD12) || defined(FREEBSD13) \ - || defined(FREEBSD14) \ + || defined(FREEBSD14) || defined(FREEBSD15) || defined(FREEBSD16) \ || defined(BSDI2) || defined(BSDI3) || defined(BSDI4) \ || defined(OPENBSD2) || defined(OPENBSD3) || defined(OPENBSD4) \ || defined(OPENBSD5) || defined(OPENBSD6) || defined(OPENBSD7) \ + || defined(OPENBSD8) \ || defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD3) \ || defined(NETBSD4) || defined(NETBSD5) || defined(NETBSD6) \ || defined(NETBSD7) | defined(NETBSD8) || defined(NETBSD9) \ - || defined(NETBSD10) \ + || defined(NETBSD10) || defined(NETBSD11) || defined(NETBSD12) \ || defined(EKKOBSD1) || defined(DRAGONFLY) #define SUPPORTED #include diff --git a/postfix/src/util/wrap_netdb.c b/postfix/src/util/wrap_netdb.c index 7d33f2fff..56ef911a4 100644 --- a/postfix/src/util/wrap_netdb.c +++ b/postfix/src/util/wrap_netdb.c @@ -122,7 +122,7 @@ struct servent *wrap_getservbyport(int port, const char *proto) void wrap_setservent(int stayopen) { #undef setservent - return (setservent(stayopen)); + setservent(stayopen); } /* wrap_endservent - wrap endservent() with stable internal API */ @@ -130,7 +130,7 @@ void wrap_setservent(int stayopen) void wrap_endservent(void) { #undef endservent - return (endservent()); + endservent(); } #endif