From e49780511cb689340b98c550f0ae40f762d4c6cc Mon Sep 17 00:00:00 2001
From: Wietse Z Venema
Date: Sat, 6 Sep 2025 00:00:00 -0500
Subject: [PATCH] postfix-3.11-20250906-nonprod
---
postfix/.indent.pro | 1 +
postfix/HISTORY | 269 ++++++++++++-
postfix/html/bounce.8.html | 9 +
postfix/html/defer.8.html | 9 +
postfix/html/lmtp.8.html | 15 +-
postfix/html/mailq.1.html | 40 +-
postfix/html/newaliases.1.html | 40 +-
postfix/html/pipe.8.html | 15 +
postfix/html/postconf.5.html | 242 ++++++++++++
postfix/html/relocated.5.html | 82 ++--
postfix/html/sendmail.1.html | 40 +-
postfix/html/smtp.8.html | 15 +-
postfix/html/smtpd.8.html | 403 ++++++++++----------
postfix/html/trace.8.html | 9 +
postfix/makedefs | 2 +-
postfix/man/man1/sendmail.1 | 32 +-
postfix/man/man5/postconf.5 | 218 ++++++++++-
postfix/man/man8/bounce.8 | 8 +
postfix/man/man8/pipe.8 | 13 +
postfix/man/man8/smtp.8 | 12 +-
postfix/man/man8/smtpd.8 | 10 +-
postfix/mantools/postconf2man | 1 +
postfix/mantools/postlink | 4 +
postfix/proto/postconf.proto | 230 ++++++++++-
postfix/proto/stop | 4 +
postfix/proto/stop.double-history | 14 +-
postfix/proto/stop.double-proto-html | 1 +
postfix/proto/stop.spell-cc | 4 +
postfix/proto/stop.spell-history | 1 +
postfix/src/bounce/Makefile.in | 2 +
postfix/src/bounce/bounce.c | 51 +++
postfix/src/bounce/bounce_notify_util.c | 3 +-
postfix/src/cleanup/cleanup_api.c | 10 +-
postfix/src/global/Makefile.in | 26 +-
postfix/src/global/cleanup_strflags.c | 1 +
postfix/src/global/cleanup_user.h | 1 +
postfix/src/global/ehlo_mask.c | 62 +--
postfix/src/global/ehlo_mask.h | 28 +-
postfix/src/global/ehlo_mask.in | 3 -
postfix/src/global/ehlo_mask.ref | 3 -
postfix/src/global/ehlo_mask_test.c | 150 ++++++++
postfix/src/global/mail_params.c | 3 +
postfix/src/global/mail_params.h | 15 +
postfix/src/global/post_mail.c | 7 +-
postfix/src/global/rec_type.h | 2 +-
postfix/src/local/forward.c | 3 +-
postfix/src/pipe/Makefile.in | 1 +
postfix/src/pipe/pipe.c | 20 +
postfix/src/postcat/postcat.c | 4 +
postfix/src/posttls-finger/posttls-finger.c | 2 +-
postfix/src/sendmail/Makefile.in | 1 +
postfix/src/sendmail/sendmail.c | 82 +++-
postfix/src/showq/showq.c | 3 +-
postfix/src/smtp/Makefile.in | 66 +++-
postfix/src/smtp/lmtp_params.c | 1 +
postfix/src/smtp/smtp.c | 24 +-
postfix/src/smtp/smtp.h | 25 +-
postfix/src/smtp/smtp_connect.c | 74 +++-
postfix/src/smtp/smtp_params.c | 1 +
postfix/src/smtp/smtp_proto.c | 152 ++++++--
postfix/src/smtp/smtp_reqtls_policy.c | 207 ++++++++++
postfix/src/smtp/smtp_reqtls_policy.h | 58 +++
postfix/src/smtp/smtp_reqtls_policy_test.c | 263 +++++++++++++
postfix/src/smtp/smtp_state.c | 3 +
postfix/src/smtp/smtp_trouble.c | 37 +-
postfix/src/smtpd/smtpd.c | 25 +-
postfix/src/smtpd/smtpd.h | 1 +
postfix/src/tls/tls.h | 3 +-
postfix/src/util/argv.c | 7 +
postfix/src/util/argv.h | 9 +
postfix/src/util/dict_debug_test.sh | 0
postfix/src/util/inet_addr_list.c | 3 +-
postfix/src/util/inet_prefix_top.c | 1 +
postfix/src/util/name_mask.c | 44 ++-
postfix/src/util/name_mask.h | 3 +-
postfix/src/util/name_mask.ref5 | 4 +-
postfix/src/util/name_mask.ref6 | 4 +-
77 files changed, 2795 insertions(+), 446 deletions(-)
delete mode 100644 postfix/src/global/ehlo_mask.in
delete mode 100644 postfix/src/global/ehlo_mask.ref
create mode 100644 postfix/src/global/ehlo_mask_test.c
create mode 100644 postfix/src/smtp/smtp_reqtls_policy.c
create mode 100644 postfix/src/smtp/smtp_reqtls_policy.h
create mode 100644 postfix/src/smtp/smtp_reqtls_policy_test.c
mode change 100755 => 100644 postfix/src/util/dict_debug_test.sh
diff --git a/postfix/.indent.pro b/postfix/.indent.pro
index 9fa65a8f9..78948c7aa 100644
--- a/postfix/.indent.pro
+++ b/postfix/.indent.pro
@@ -346,6 +346,7 @@
-TSMTP_CLI_ATTR
-TSMTP_CMD
-TSMTP_ITERATOR
+-TSMTP_REQTLS_POLICY
-TSMTP_RESP
-TSMTP_SASL_AUTH_CACHE
-TSMTP_SESSION
diff --git a/postfix/HISTORY b/postfix/HISTORY
index bd2c2beec..ca33b511e 100644
--- a/postfix/HISTORY
+++ b/postfix/HISTORY
@@ -28932,7 +28932,7 @@ Apologies for any names omitted.
Documentation: updated TLSRPT_README, added postfix-tlspol
policy plugin, deprecated the policy_ttl attribute. File:
proto/TLSRPT_README.html.
-
+
20250207
Performance: when a mysql: or pgsql: configuration specifies
@@ -29604,3 +29604,270 @@ Apologies for any names omitted.
proto/postconf.proto, global/mail_params.h, smtp/lmtp_params.c,
smtp/smtp.c, smtp/smtp.h, smtp/smtp_connect.c, smtp/smtp_params.c,
smtp/smtp_tls_policy.c, smtp/smtp_tls_policy_test.c.
+
+ Baseline is postfix-3.11-20250906
+
+NONPROD CODE
+
+ Feature: support for the REQUIRETLS verb in SMTP. According
+ to RFC 8689, this requires TLS server certificate matching.
+ Files: cleanup/cleanup_api.c, global/cleanup_strflags.c,
+ global/post_mail.c, global/post_mail.c, global/ehlo_mask.[hc],
+ global/ehlo_mask_test.c, local/forward.c, smtpd/smtpd.c,
+ smtp/smtp_connect.c, smtp/smtp_proto.c.
+
+ Added a configuration parameter "requiretls_enable" (default:
+ yes). Files: cleanup/cleanup_api.c, global/cleanup_strflags.c,
+ global/post_mail.c, global/post_mail.c, global/ehlo_mask.[hc],
+ global/ehlo_mask_test.c, local/forward.c, smtpd/smtpd.c,
+ smtp/smtp_connect.c, smtp/smtp_proto.c.
+
+ After a certificate check fails, or a remote SMTP server
+ does not announce REQUIRETLS support, the Postfix SMTP
+ client will override the RFC 8689 5.x.x. status and treat
+ it as a soft error, until there are no more alternate MX
+ servers to try. Files: smtp/smtp.h, smtp/smtp_proto.c,
+ smtp/smtp_trouble.c.
+
+ When a message received with REQUIRETLS is returned in a
+ delivery status notification, return the message headers
+ only, and do not request delivery with REQUIRETLS. Files:
+ bounce/bounce_notify_service.c, bounce/bounce_one_service.c,
+ bounce/bounce_trace_service.c, bounce/bounce_verp_service.c,
+ bounce/bounce_warn_service.c.
+
+ Completed: new Postfix sendmail command option "-O requiretls"
+ to request that deliveries over SMTP use the REQUIRETLS
+ extension. The option value "requiretls" is case-insensitive.
+ Files: sendmail/sendmail.c, global/rec_types.h, pickup/pickup.c.
+
+ Cleanup: new Postfix sendmail command option "-O smtputf8"
+ to request that deliveries over SMTP use the SMTPUTF8
+ extension. This reuses logic that was introduced for
+ REQUIRETLS. The option value "smtputf8" is case-insensitive.
+ Files: sendmail/sendmail.c.
+
+ Cleanup: when message delivery requires that a remote SMTP
+ server supports SMTPUTF8, try multiple MX servers before
+ returning a message as undeliverable. This reuses logic
+ that was introduced for REQUIRETLS. File: smtp/smtp_proto.c.
+
+ Completed: support in the pipe(8) daemon to propagate
+ REQUIRETLS through post-queue content filters that pass
+ filtered mail to the Postfix sendmail(1) command. This
+ involves a new a pipe(8) macro ${requiretls} that expands
+ into a suitable sendmail(1) command-line option. A more
+ secretive alternative would be to pass the info with a
+ REQUIRETLS environment variable, but that would require
+ change to the default import_environment setting. Files:
+ pipe/pipe.c, sendmail/sendmail.c.
+
+ Completed: REQUIRETLS support can be disabled in the Postfix
+ SMTP/LMTP client with "{ -o requiretls_enable = no }". This
+ is recommended for a perimeter MTA that hands off mail to
+ internal servers that may not support REQUIRETLS.
+
+ Completed: smtp_enforce_requiretls list of next-hop domains
+ (or UNIX-domain pathnames) that are ready for REQUIRETLS
+ enforcement. This may help with gradual adoption.
+
+ Completed 20250818: infrastructure that will use message
+ headers to propagate REQUIRETLS through non-Milter content
+ filters. Files: global/x_esmtp_verb.[hc],
+ global/x_esmtp_verb_test.c.
+
+ Completed 20250818: infrastructure for REQUIRETLS enforcement
+ policy (enforce, best-effort, disable) that will be indexed
+ by the TLS next-hop hostname. Files: smtp/smtp_reqtls_policy.[hc],
+ smtp/smtp_reqtls_policy_test.c.
+
+ Completed 20250818: return headers-only messages in all delivery status
+ notifications. Files: qmgr/qmgr_message.c, oqmgr/qmgr_message.c.
+
+ Completed 20250818: do not propagate REQUIRETLS when sending
+ delivery status notifications. (RFC 8689 section 5: When
+ the MAIL FROM return-path is empty, the REQUIRETLS parameter
+ SHOULD NOT cause a bounce message to be discarded even if
+ the next-hop relay does not advertise REQUIRETLS.)
+
+ Completed 20250820: enable/disable redacting delivery status
+ notifications as described in RFC 8689 section 5.
+
+ Completed 20250824: when a message needs top be delivered
+ with SMTPUTF8, bit a remote server does not support it,
+ try an alternate server. File: smtp/smtp_proto.c.
+
+ Completed 20250824: better handling of line breaks in
+ indented paragraphs in the postconf(5) conversion
+ from HTML to 'man' format. File: mantools/postconf2man.
+
+ Completed 20250824: requiretls_redact_dsn (default: yes)
+ as described in RFC 8689 section 5, to produces bounce
+ messages that don't need REQUIRETLS support on every hop
+ in the return path. Files: proto/postconf.proto,
+ global/mail_params.h, bounce/bounce.c.
+
+ Completed 20250824: smtp_requiretls_policy and
+ lmtp_requiretls_policy for responsible REQUIRETLS policy
+ enforcement. Files: proto/postconf.proto, global/mail_params.h,
+ smtp/lmtp_params.c, smtp/smtp.c, smtp/smtp_connect.c,
+ smtp/smtp.h, smtp/smtp_params.c, smtp/smtp_proto.c,
+ smtp/smtp_reqtls_policy.c, smtp/smtp_reqtls_policy.h,
+ smtp/smtp_reqtls_policy_test.c, smtp/smtp_state.c.
+
+ Completed 20250824: cleaned up some test code. Files:
+ util/inet_prefix_top.c, util/inet_addr_list.c.
+
+ Completed 20250824: When SMTPUTF8 is needed, skip servers
+ that don't support SMTPUTF8, instead of giving up immediately.
+ File: smtp/smtp_proto.c.
+
+ Completed 20250825: when a server does not announce REQUIRETLS,
+ and the Postfix SMTP or LMTP client does not enforce
+ REQUIRETLS, send "MAIL FROM ... RET=HDRS" to limit exposure.
+ file: smtp/smtp_proto.c.
+
+ Completed 20250826: renamed all the new identifiers introduced
+ for REQUIRETLS support to ...REQTLS... and ...reqtls... and
+ re-indented the code. minimize differences with pre-existing code.
+
+ Completed 20250826: support to request REQUIRETLS and
+ SMTPUTF8 on the Postfix sendmail(1) command line, plus
+ corresponding support in other programs to handle that
+ information. Files: sendmail/sendmail.c, pickup/pickup.c,
+ postcat/postcat.c., showq/showq.c.
+
+ Completed 20250827: logic to skip destinations whose TLS
+ policy level cannot satisfy the REQUIRETLS policy, or to
+ log what would fail if REQUIRETLS were fully enforced.
+ File: smtp/smtp_connect.c.
+
+ Completed 20250829: removed code that was not used; backed
+ out gratuitous changes; minimized the diffs against the
+ production release; renamed enforce_reqtls to the more
+ meaningful reqtls_level.
+
+TODO
+
+ Make it easy to find out by domain what the REQUIRETLS
+ success rates are, and what the failure modes are.
+
+ Add optional statistics logging for "REQUIRETLS sent" and
+ for "all REQUIRETLS requirements pass". But these say
+ nothing about connections that failed to establish an
+ acceptable TLS session.
+
+ Other logging: RFC 8689 prescribes enhanced status codes:
+
+ - REQUIRETLS not supported by server: 5.7.30 REQUIRETLS
+ support required
+
+ - Unable to establish TLS-protected SMTP session: 5.7.10
+ Encryption needed
+
+ These will show up in logging.
+
+ Known failure modes
+ misc problems at DNS, TCP, or SMTP level
+ misc errors with TLS policy or REQUIRETLS policy
+ smtp_connect.c:
+ TLS policy disables certificate matching
+ TLS policy disables encryption (opportunistic only)
+ smtp_proto.c.
+ STARTTLS rejected (sender requested REQUIRETLS...)
+ STARTTLS not offered (sender requested REQUIRETLS...)
+ (TLS is required, but our TLS engine is unavailable)
+ (TLS is required, but unavailable)
+ CERT not trusted|matched (sender requested REQUIRETLS...)
+
+ Revert $requiretls in pipe daemon?
+
+ Which enforcement levels can we implement?
+
+ enforce: require that the server supports REQUIRETLS,
+ and that the connection satisfies RFC XXX requirements.
+
+ no-plaintext: skip servers that don't announce STARTTLS;
+ request REQUIRETLS if the server supports REQUIRETLS,
+ otherwise deliver the message as if the sender did not
+ request REQUIRETLS.
+
+ ????/ignore/disable/none: request REQUIRETLS if the
+ server supports REQUIRETLS, otherwise deliver the message
+ as if the sender did not request REQUIRETLS.
+
+ Maybe log "server announces REQUIRETLS" if we're not
+ enforcing REQUIRETLS.
+
+ Delete $requiretls from pipe daemon?
+
+ Verify that SMTPUTF8 and REQUIRETLS flags propagate from
+ sendmail(1) and smtpd(8) through cleanup(8) and qmgr(8) to
+ delivery agents and bounce services.
+
+ Add support to propagate REQUIRETLS (Not: TLS-Required:)
+ header through cleanup to queue files.
+
+ Encapsulate the sendopts-to-cleanup-flags mapping.
+
+ Postfix sendmail -O TlsRequired option?
+
+ What REQUIRETLS expectations can we enforce when delivering
+ over a UNIX-domain channel? The SMTP/LMTP client currently
+ implements the same behavior as for TCP, except that
+ opportunistic TLS is converted into 'none'.
+
+ Document how REQUIRETLS works (or does not) with external
+ content filters.
+
+ - REQUIRETLS will not affect Milter-based content filters,
+ assuming that they don't expose message content via some
+ side channel.
+
+ - REQUIRETLS can work with smtpd_proxy_filter as long as
+ - the Postfix SMTP server passes the entire Postfix SMTP
+ client's MAIL FROM command line through the filter to
+ the Postfix SMTP server after the proxy filter,
+ - the post-filter Postfix SMTP server allows REQUIRETLS
+ in a plaintext session.
+ The Postfix proxy filter client does not need to require
+ REQUIRETLS (or SMTPUTF8) announcements in the filter's
+ EHLO response.
+
+ - REQUIRETLS can work with a local SMTP-based after-queue
+ content filters as long as
+ - the filter announces REQUIRETLS in the EHLO response
+ (this could be 'always', or copied from the after-filter
+ Postfix SMTP server's EHLO response),
+ - the filter passes the entire MAIL FROM command from the
+ before-filter Postfix SMTP client to the after-filter
+ Postfix SMTP server,
+ - the post-filter Postfix SMTP server allows MAIL FROM
+ with REQUIRETLS in a plaintext session.
+ Apart from that, the content filter does not need to
+ 'know' that REQUIRETLS is active (assuming that it does
+ not leak message content through some side channel.
+
+ - REQUIRETLS can work with pipe(8)-filter-sendmail(1)
+ after-queue content filters, by specifying a pipe(8) macro
+ ${requiretls} which expands to a suitable sendmail(1)
+ command-line option. Maybe we can also make this work
+ with a REQUIRETLS environment variable (requires change
+ to the (Postfix sendmail) import_environment list.
+
+ - The Postfix LMTP client when run with the -X option will
+ not require that the LMTP server announces REQUIRETLS
+ support.
+
+ - Perimeter MTA configuration: disable REQUIRETLS (or
+ REQUIRETLS enforcement) on the inbound relay transport
+ when internal infrastructure may not be suitable for
+ REQUIRETLS enforcement.
+
+ If a message contains "TLS-Required: no", should a bounce
+ message also contain this header?
+
+ Ditto for "tls_required_enable = no" and "TLS-Required:
+ no". The header is provided by the sender, and enforcement
+ is up the Postfix SMTP client.
+
diff --git a/postfix/html/bounce.8.html b/postfix/html/bounce.8.html
index 695478942..44f4b2608 100644
--- a/postfix/html/bounce.8.html
+++ b/postfix/html/bounce.8.html
@@ -172,6 +172,15 @@ BOUNCE(8) BOUNCE(8)
Enable support for the "TLS-Required: no" message header,
defined in RFC 8689.
+ Available in Postfix 3.11 and later:
+
+ requiretls_redact_dsn (yes)
+ When sending a delivery status notification for an original mes-
+ sage received with the REQUIRETLS option, do not send the origi-
+ nal message body (as if that message was received with
+ "RET=HDRS") and do not enforce REQUIRETLS (as if that message
+ was received without REQUIRETLS).
+
FILES
/var/spool/postfix/bounce/* non-delivery records
/var/spool/postfix/defer/* non-delivery records
diff --git a/postfix/html/defer.8.html b/postfix/html/defer.8.html
index 695478942..44f4b2608 100644
--- a/postfix/html/defer.8.html
+++ b/postfix/html/defer.8.html
@@ -172,6 +172,15 @@ BOUNCE(8) BOUNCE(8)
Enable support for the "TLS-Required: no" message header,
defined in RFC 8689.
+ Available in Postfix 3.11 and later:
+
+ requiretls_redact_dsn (yes)
+ When sending a delivery status notification for an original mes-
+ sage received with the REQUIRETLS option, do not send the origi-
+ nal message body (as if that message was received with
+ "RET=HDRS") and do not enforce REQUIRETLS (as if that message
+ was received without REQUIRETLS).
+
FILES
/var/spool/postfix/bounce/* non-delivery records
/var/spool/postfix/defer/* non-delivery records
diff --git a/postfix/html/lmtp.8.html b/postfix/html/lmtp.8.html
index e116f43aa..c0ce2ddb3 100644
--- a/postfix/html/lmtp.8.html
+++ b/postfix/html/lmtp.8.html
@@ -174,7 +174,7 @@ SMTP(8) SMTP(8)
RFC 6531 (Internationalized SMTP)
RFC 6533 (Internationalized Delivery Status Notifications)
RFC 7672 (SMTP security via opportunistic DANE TLS)
- RFC 8689 (TLS-Required message header)
+ RFC 8689 (SMTP REQUIRETLS extension, TLS-Required header)
DIAGNOSTICS
Problems and transactions are logged to syslogd(8) or postlogd(8).
@@ -507,7 +507,7 @@ SMTP(8) SMTP(8)
The delimiter between username and password in sasl_passwd_maps
lookup results.
-STARTTLS SUPPORT CONTROLS
+TLS SUPPORT CONTROLS
Detailed information about STARTTLS configuration may be found in the
TLS_README document.
@@ -775,7 +775,16 @@ SMTP(8) SMTP(8)
Enable support for the "TLS-Required: no" message header,
defined in RFC 8689.
-OBSOLETE STARTTLS CONTROLS
+ requiretls_enable (yes)
+ Enable support for the ESMTP verb "REQUIRETLS" in the "MAIL
+ FROM" command.
+
+ smtp_requiretls_policy (see 'postconf -d smtp_requiretls_policy' out-
+ put)
+ How the Postfix SMTP and LMTP client will enforce REQUIRETLS for
+ messages received with the REQUIRETLS option.
+
+OBSOLETE TLS CONTROLS
The following configuration parameters exist for compatibility with
Postfix versions before 2.3. Support for these will be removed in a
future release.
diff --git a/postfix/html/mailq.1.html b/postfix/html/mailq.1.html
index 4645b733a..91157d8ef 100644
--- a/postfix/html/mailq.1.html
+++ b/postfix/html/mailq.1.html
@@ -168,7 +168,7 @@ SENDMAIL(1) SENDMAIL(1)
Delivery status notification control. Specify either a
comma-separated list with one or more of failure (send notifica-
tion when delivery fails), delay (send notification when deliv-
- ery is delayed), or success (send notification when the message
+ ery is delayed), or success (send notification after the message
is delivered); or specify never (don't send any notifications at
all).
@@ -177,14 +177,36 @@ SENDMAIL(1) SENDMAIL(1)
-n (ignored)
Backwards compatibility.
- -oAalias_database
- Non-default alias database. Specify pathname or type:pathname.
- See postalias(1) for details.
+ -O requiretls=yes
+
+ -O requiretls=no
+ When delivering a message to an SMTP or LMTP server, the connec-
+ tion must use TLS with a verified server certificate, and that
+ server must support REQUIRETLS. The "requiretls" name and option
+ value are case-insensitive. REQUIRETLS enforcement is controlled
+ with the configuration parameters requiretls_enable,
+ smtp_requiretls_policy, and lmtp_requiretls_policy.
+
+ This feature is available in Postfix 3.11 and later.
+
+ -O smtputf8=yes
+
+ -O smtputf8=no
+ When delivering a message to an SMTP or LMTP server, and an
+ envelope address or message header contains UTF8 text, that
+ server must support SMTPUTF8. The "smtputf8" option name and
+ value are case-insensitive.
+
+ This feature is available in Postfix 3.11 and later.
-Ooption=value (ignored)
- Set the named option to value. Use the equivalent configuration
+ Set the named option to value. Use the equivalent configuration
parameter in main.cf instead.
+ -oAalias_database
+ Non-default alias database. Specify pathname or type:pathname.
+ See postalias(1) for details.
+
-o7 (ignored)
-o8 (ignored)
@@ -483,6 +505,12 @@ SENDMAIL(1) SENDMAIL(1)
the default Postfix instance, and that are started, stopped,
etc., together with the default Postfix instance.
+ Postfix 3.11 and later:
+
+ requiretls_enable (yes)
+ Enable support for the ESMTP verb "REQUIRETLS" in the "MAIL
+ FROM" command.
+
FILES
/var/spool/postfix, mail queue
/etc/postfix, configuration files
@@ -501,7 +529,7 @@ SENDMAIL(1) SENDMAIL(1)
syslogd(8), system logging
README_FILES
- Use "postconf readme_directory" or "postconf html_directory" to locate
+ Use "postconf readme_directory" or "postconf html_directory" to locate
this information.
DEBUG_README, Postfix debugging howto
ETRN_README, Postfix ETRN howto
diff --git a/postfix/html/newaliases.1.html b/postfix/html/newaliases.1.html
index 4645b733a..91157d8ef 100644
--- a/postfix/html/newaliases.1.html
+++ b/postfix/html/newaliases.1.html
@@ -168,7 +168,7 @@ SENDMAIL(1) SENDMAIL(1)
Delivery status notification control. Specify either a
comma-separated list with one or more of failure (send notifica-
tion when delivery fails), delay (send notification when deliv-
- ery is delayed), or success (send notification when the message
+ ery is delayed), or success (send notification after the message
is delivered); or specify never (don't send any notifications at
all).
@@ -177,14 +177,36 @@ SENDMAIL(1) SENDMAIL(1)
-n (ignored)
Backwards compatibility.
- -oAalias_database
- Non-default alias database. Specify pathname or type:pathname.
- See postalias(1) for details.
+ -O requiretls=yes
+
+ -O requiretls=no
+ When delivering a message to an SMTP or LMTP server, the connec-
+ tion must use TLS with a verified server certificate, and that
+ server must support REQUIRETLS. The "requiretls" name and option
+ value are case-insensitive. REQUIRETLS enforcement is controlled
+ with the configuration parameters requiretls_enable,
+ smtp_requiretls_policy, and lmtp_requiretls_policy.
+
+ This feature is available in Postfix 3.11 and later.
+
+ -O smtputf8=yes
+
+ -O smtputf8=no
+ When delivering a message to an SMTP or LMTP server, and an
+ envelope address or message header contains UTF8 text, that
+ server must support SMTPUTF8. The "smtputf8" option name and
+ value are case-insensitive.
+
+ This feature is available in Postfix 3.11 and later.
-Ooption=value (ignored)
- Set the named option to value. Use the equivalent configuration
+ Set the named option to value. Use the equivalent configuration
parameter in main.cf instead.
+ -oAalias_database
+ Non-default alias database. Specify pathname or type:pathname.
+ See postalias(1) for details.
+
-o7 (ignored)
-o8 (ignored)
@@ -483,6 +505,12 @@ SENDMAIL(1) SENDMAIL(1)
the default Postfix instance, and that are started, stopped,
etc., together with the default Postfix instance.
+ Postfix 3.11 and later:
+
+ requiretls_enable (yes)
+ Enable support for the ESMTP verb "REQUIRETLS" in the "MAIL
+ FROM" command.
+
FILES
/var/spool/postfix, mail queue
/etc/postfix, configuration files
@@ -501,7 +529,7 @@ SENDMAIL(1) SENDMAIL(1)
syslogd(8), system logging
README_FILES
- Use "postconf readme_directory" or "postconf html_directory" to locate
+ Use "postconf readme_directory" or "postconf html_directory" to locate
this information.
DEBUG_README, Postfix debugging howto
ETRN_README, Postfix ETRN howto
diff --git a/postfix/html/pipe.8.html b/postfix/html/pipe.8.html
index 911a740eb..2b0f82d05 100644
--- a/postfix/html/pipe.8.html
+++ b/postfix/html/pipe.8.html
@@ -309,6 +309,15 @@ PIPE(8) PIPE(8)
This information is modified by the hqu flags for quoting
and case folding.
+ ${requiretls}
+ This feature is intended for content filters that pass
+ filtered mail to the Postfix sendmail(1) command. The
+ macro expands to the Postfix sendmail(1) command-line
+ option -Orequiretls=yes if the sender requested
+ REQUIRETLS, otherwise it expands to -Orequiretls=no.
+
+ This feature is available as of Postfix 3.11.
+
${sasl_method}
This macro expands to the name of the SASL authentication
mechanism in the AUTH command when the Postfix SMTP
@@ -488,6 +497,12 @@ PIPE(8) PIPE(8)
The email address form that will be used in non-debug logging
(info, warning, etc.).
+ Available in Postfix 3.11 and later:
+
+ requiretls_enable (yes)
+ Enable support for the ESMTP verb "REQUIRETLS" in the "MAIL
+ FROM" command.
+
SEE ALSOqmgr(8), queue manager
bounce(8), delivery status reports
diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html
index e3ad23702..a9e03fe25 100644
--- a/postfix/html/postconf.5.html
+++ b/postfix/html/postconf.5.html
@@ -5373,6 +5373,17 @@ configuration parameter. See there for details.
This feature is available in Postfix 2.7 and later.
Enable support for the ESMTP verb "REQUIRETLS" in the "MAIL
+FROM" command. As defined in RFC 8689, when a message specifies
+REQUIRETLS:
+
+
+
+
deliveries with SMTP or LMTP must use a TLS connection,
+
+
to a securely looked up MX server (e.g., DNSSEC or MTA-STS),
+
+
+
with a matched server certificate (Postfix SMTP or LMTP
+client TLS security levels "secure", "verify", "fingerprint",
+dane-only, or opportunistic "dane"),
+
+
and the server must announce "REQUIRETLS" support after
+the STARTTLS handshake.
+
+
+
+
When delivering a message that specifies REQUIRETLS, the Postfix
+SMTP client will try one or more servers, limited by the
+smtp_mx_address_limit and smtp_mx_session_limit parameters, until
+it finds an MX server that satisfies the above requirements. If
+such a server is not found, the Postfix SMTP or LMTP client returns
+the message as undeliverable.
+
+
Notes:
+
+
+
+
With the Postfix SMTP or LMTP clients, REQUIRETLS enforcement
+is controlled with smtp_requiretls_policy or lmtp_requiretls_policy. It
+is initially not enforced for deliveries to local servers, including
+LMTP message stores and local content filters.
+
+
The ESMTP REQUIRETLS option overrides the "TLS-Required:
+no" message header.
When sending a delivery status notification for an original
+message received with the REQUIRETLS option, do not send the original
+message body (as if that message was received with "RET=HDRS") and
+do not enforce REQUIRETLS (as if that message was received without
+REQUIRETLS). For a detailed discussion see RFC 8689 section 5.
+
+
Note: the 'reverse' path for sending a delivery status notification
+may differ from the 'forward' path for receiving the original message.
+Not every hop in the reverse path may support REQUIRETLS, even
+though every hop in the forward path supported it. The setting
+"requiretls_redact_dsn = no" may therefore result in the loss of a
+delivery status notification.
How the Postfix SMTP and LMTP client will enforce REQUIRETLS
+for messages received with the REQUIRETLS option. Policy examples
+for SMTP and LMTP are at the end.
+
+
+
+
Specify a list of items, separated with whitespace or
+comma; continue a long line by starting the next line with whitespace.
+
+
+
Each item must be an action (see below), or a type:table
+lookup table that must return an action (not a type:table).
+
+
A type:table lookup table is searched with the next-hop
+destination, without any [ ], :service, or :port.
+
+
+
The next-hop destination for TCP connections is the recipient
+domain, but this can be overruled with transport_maps, relayhost,
+content_filter, or other routing features. The next-hop destination
+for LMTP over UNIX-domain connections is always the value of
+myhostname.
+
+
+
+
Supported actions:
+
+
+
+
enforce
Skip connections that do not
+meet RFC 8689 section 4.2 requirements, and skip servers that don't
+announce REQUIRETLS support. Return the message as undeliverable if no
+suitable connection and server are found, and log a "REQUIRETLS
+Failure" event.
+
+
opportunistic+starttls
Skip servers
+that don't announce STARTTLS support. Return the message as
+undeliverable if no suitable server is found, and log a "REQUIRETLS
+Failure" event.
Request REQUIRETLS if a server supports
+REQUIRETLS, otherwise simply deliver the message and log "REQUIRETLS
+Debug" events when a connection would not meet all RFC 8689 section
+4.2 requirements.
This can be appropriate for an outbound
+perimeter MTA, when forwarding messages from internal systems to
+the Internet, at a time that many domains do not publish DANE or
+MTA-STS policies.
+
+
opportunistic
Request REQUIRETLS if
+the server supports REQUIRETLS, otherwise simply deliver the message.
+
This can be appropriate for an inbound perimeter MTA, when
+forwarding messages from the Internet to internal servers or content
+filters. Internal servers or content filters may not support
+REQUIRETLS, and internal connections may be secured with means other
+than DANE or STS.
+
+
disable
Disable REQUIRETLS support.
+This may be used as a last-resort workaround when a server announces
+REQUIRETLS support, but the support is inoperable.
+
+
+
+
Notes:
+
+
+
+
Postfix appends an implicit opportunistic+starttls
+action after the end of each policy.
+
+
To match any name below the domain "example.com" specify
+a table entry with the storage key ".example.com" in type:table
+lookup tables that need an exact match. This is appropriate, for
+example, with hash:, btree: or lmdb:.
The default SMTP client REQUIRETLS policy: when a sender
+requests REQUIRETLS, require that external servers support STARTTLS,
+and request REQUIRETLS if an internal or external server supports
+REQUIRETLS.
The default LMTP client REQUIRETLS policy: when a sender
+requests REQUIRETLS, request REQUIRETLS if the server supports
+REQUIRETLS, otherwise deliver the message as if the sender did not
+request REQUIRETLS. Note: with deliveries over a UNIX-domain socket,
+the next-hop destination for lmtp_requiretls_policy lookups will
+be the myhostname parameter value.
smtp_rset_timeout
@@ -20876,6 +21115,9 @@ If a message contains a "TLS-Required: no" header, then Postfix
will add that header to a delivery status notification for that
message.
+
Note: the ESMTP REQUIRETLS option overrides the "TLS-Required:
+no" message header.
-RELOCATED(5) File Formats Manual RELOCATED(5)
+RELOCATED(5) RELOCATED(5)
NAME
relocated - Postfix relocated table format
@@ -19,25 +19,25 @@
Normally, the relocated(5) table is specified as a text file that
serves as input to the postmap(1) command. The result, an indexed file
- in dbm or db format, is used for fast searching by the mail system. Ex-
- ecute the command "postmap /etc/postfix/relocated" to rebuild an in-
- dexed file after changing the corresponding relocated table.
+ in dbm or db format, is used for fast searching by the mail system.
+ Execute the command "postmap /etc/postfix/relocated" to rebuild an
+ indexed file after changing the corresponding relocated table.
When the table is provided via other means such as NIS, LDAP or SQL,
the same lookups are done as for ordinary indexed files.
Alternatively, the table can be provided as a regular-expression map
- where patterns are given as regular expressions, or lookups can be di-
- rected to a TCP-based server. In those case, the lookups are done in a
- slightly different way as described below under "REGULAR EXPRESSION TA-
- BLES" or "TCP-BASED TABLES".
+ where patterns are given as regular expressions, or lookups can be
+ directed to a TCP-based server. In those case, the lookups are done in
+ a slightly different way as described below under "REGULAR EXPRESSION
+ TABLES" or "TCP-BASED TABLES".
Table lookups are case insensitive.
CASE FOLDING
- The search string is folded to lowercase before database lookup. As of
- Postfix 2.3, the search string is not case folded with database types
- such as regexp: or pcre: whose lookup fields can match both upper and
+ The search string is folded to lowercase before database lookup. As of
+ Postfix 2.3, the search string is not case folded with database types
+ such as regexp: or pcre: whose lookup fields can match both upper and
lower case.
TABLE FORMAT
@@ -48,29 +48,29 @@
pattern new_location
Where new_location specifies contact information such as an
- email address, or perhaps a street address or telephone number.
+ email address, or perhaps a street address or telephone number.
- o Postfix 3.11 and later can optionally disable the hard-coded
- prefix. Specify "relocated_prefix_enable = no" in main.cf, and
- specify relocated_maps entries with your own RFC 3463-compliant
+ o Postfix 3.11 and later can optionally disable the hard-coded
+ prefix. Specify "relocated_prefix_enable = no" in main.cf, and
+ specify relocated_maps entries with your own RFC 3463-compliant
enhanced status code and text, for example:
pattern 5.2.0 Mailbox is unavailable
pattern 5.2.1 Mailbox is disabled
- o Empty lines and whitespace-only lines are ignored, as are lines
+ o Empty lines and whitespace-only lines are ignored, as are lines
whose first non-whitespace character is a `#'.
- o A logical line starts with non-whitespace text. A line that
+ o A logical line starts with non-whitespace text. A line that
starts with whitespace continues a logical line.
TABLE SEARCH ORDER
- With lookups from indexed files such as DB or DBM, or from networked
- tables such as NIS, LDAP or SQL, patterns are tried in the order as
+ With lookups from indexed files such as DB or DBM, or from networked
+ tables such as NIS, LDAP or SQL, patterns are tried in the order as
listed below:
user@domain
- Matches user@domain. This form has precedence over all other
+ Matches user@domain. This form has precedence over all other
forms.
user Matches user@site when site is $myorigin, when site is listed in
@@ -83,21 +83,21 @@
ADDRESS EXTENSION
When a mail address localpart contains the optional recipient delimiter
- (e.g., user+foo@domain), the lookup order becomes: user+foo@domain,
+ (e.g., user+foo@domain), the lookup order becomes: user+foo@domain,
user@domain, user+foo, user, and @domain.
REGULAR EXPRESSION TABLES
- This section describes how the table lookups change when the table is
- given in the form of regular expressions or when lookups are directed
- to a TCP-based server. For a description of regular expression lookup
- table syntax, see regexp_table(5) or pcre_table(5). For a description
+ This section describes how the table lookups change when the table is
+ given in the form of regular expressions or when lookups are directed
+ to a TCP-based server. For a description of regular expression lookup
+ table syntax, see regexp_table(5) or pcre_table(5). For a description
of the TCP client/server table lookup protocol, see tcp_table(5). This
feature is available in Postfix 2.5 and later.
- Each pattern is a regular expression that is applied to the entire ad-
- dress being looked up. Thus, user@domain mail addresses are not broken
- up into their user and @domain constituent parts, nor is user+foo bro-
- ken up into user and foo.
+ Each pattern is a regular expression that is applied to the entire
+ address being looked up. Thus, user@domain mail addresses are not bro-
+ ken up into their user and @domain constituent parts, nor is user+foo
+ broken up into user and foo.
Patterns are applied in the order as specified in the table, until a
pattern is found that matches the search string.
@@ -122,9 +122,9 @@
The table format does not understand quoting conventions.
CONFIGURATION PARAMETERS
- The following main.cf parameters are especially relevant. The text be-
- low provides only a parameter summary. See postconf(5) for more details
- including examples.
+ The following main.cf parameters are especially relevant. The text
+ below provides only a parameter summary. See postconf(5) for more
+ details including examples.
relocated_maps (empty)
Optional lookup tables with new contact information for users or
@@ -133,27 +133,27 @@
Available with Postfix version 3.11 and later:
relocated_prefix_enable (yes)
- Prepend the prefix "5.1.6 User has moved to " to all relo-
+ Prepend the prefix "5.1.6 User has moved to " to all relo-
cated_maps lookup results.
Other parameters of interest:
inet_interfaces (all)
- The local network interface addresses that this mail system re-
- ceives mail on.
+ The local network interface addresses that this mail system
+ receives mail on.
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.
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.
proxy_interfaces (empty)
- The remote network interface addresses that this mail system re-
- ceives mail on by way of a proxy or network address translation
- unit.
+ The remote network interface addresses that this mail system
+ receives mail on by way of a proxy or network address transla-
+ tion unit.
SEE ALSOtrivial-rewrite(8), address resolver
@@ -178,5 +178,5 @@
111 8th Avenue
New York, NY 10011, USA
- RELOCATED(5)
+ RELOCATED(5)