TLSPROXY(8)
๐ TLSPROXY โ the Postfix TLS proxy bestie ๐
ok so real talk, the manual name is tlsproxy(8) and it lives in the System Manager's Manual section, iykyk ๐
โจ NAME โจ
tlsproxy โ the Postfix TLS proxy, no cap ๐
๐ธ SYNOPSIS ๐ธ
tlsproxy [generic Postfix daemon options]
๐ฆ DESCRIPTION ๐ฆ
ok bestie, listen. The tlsproxy(8) server is a two-way TLS proxy. It's got two whole jobs and it's serving both of them flawlessly ๐
- The
postscreen(8)server uses it to talk SMTP-over-TLS with remote SMTP clients that are not allowlisted โ and yes that includes the clients whose allowlist status has expired, they're still getting proxied, periodt. - The
smtp(8)client uses it to support TLS connection reuse.
But lowkey? It should also work for non-SMTP protocols. It's flexible like that, main character energy fr fr โจ
So like, one single tlsproxy(8) process can serve multiple sessions at the same time, but ngl it's genuinely a good idea to let the number of processes increase with load so the service stays responsive. Don't be stingy with the processes bestie ๐ซถ
๐ฅ PROTOCOL EXAMPLE ๐ฅ
The example below is all about postscreen(8). BUT โ and this is the important part โ the tlsproxy(8) server is agnostic of the application protocol, so you can easily adapt this example to other applications too. It's not a postscreen-only situation, it's giving versatile ๐
So here's the whole flow:
- After receiving a valid remote SMTP client
STARTTLScommand, thepostscreen(8)server sends the remote SMTP client endpoint string, the requested role (server), and the requested timeout totlsproxy(8). - Then
postscreen(8)receives a"TLS available"indication fromtlsproxy(8). - If the TLS service is available,
postscreen(8)sends the remote SMTP client file descriptor totlsproxy(8), and sends the plaintext220greeting to the remote SMTP client. - This triggers TLS negotiations between the remote SMTP client and
tlsproxy(8). - Upon completion of the TLS-level handshake,
tlsproxy(8)translates between plaintext from/topostscreen(8)and ciphertext to/from the remote SMTP client.
That's it. That's the whole glow-up. Obsessed ๐ญ๐
๐ SECURITY ๐
The tlsproxy(8) server is moderately security-sensitive. It talks to untrusted clients on the network, so like, keep that in mind bestie ๐
The good news: the process can be run chrooted at fixed low privilege. Slay ๐ซถ
๐ DIAGNOSTICS ๐
Problems and transactions are logged to syslogd(8) or postlogd(8). So if something's weird, go check the logs, that's where the drama gets written down โจ
๐ CONFIGURATION PARAMETERS ๐
ok so important: changes to main.cf are not picked up automatically, because tlsproxy(8) processes may run for a long time depending on mail server load. So if you want your change to actually happen fast, run this:
postfix reload
The text below is only a parameter summary. For more details including examples, go read postconf(5). That's where the full lore lives ๐
๐ STARTTLS GLOBAL CONTROLS ๐
these settings are global which means they literally cannot be overruled by information specified in a tlsproxy(8) client request. Not up for negotiation, bestie, that's just how it is ๐
tls_append_default_CA(no) โ Append the system-supplied default Certification Authority certificates to the ones specified with*_tls_CApathor*_tls_CAfile.tls_daemon_random_bytes(32) โ The number of pseudo-random bytes that ansmtp(8)orsmtpd(8)process requests from thetlsmgr(8)server in order to seed its internal pseudo random number generator (PRNG).tls_high_cipherlist(seepostconf -doutput) โ The OpenSSL cipherlist for"high"grade ciphers.tls_medium_cipherlist(seepostconf -doutput) โ The OpenSSL cipherlist for"medium"or higher grade ciphers.tls_null_cipherlist(eNULL:!aNULL) โ The OpenSSL cipherlist for"NULL"grade ciphers that provide authentication without encryption. (yes, auth with no encryption, that's the whole point of this one ๐ซฃ)tls_eecdh_strong_curve(prime256v1) โ The elliptic curve used by the Postfix SMTP server for sensibly strong ephemeral ECDH key exchange.tls_eecdh_ultra_curve(secp384r1) โ The elliptic curve used by the Postfix SMTP server for maximally strong ephemeral ECDH key exchange.tls_disable_workarounds(seepostconf -doutput) โ List or bit-mask of OpenSSL bug work-arounds to disable.tls_preempt_cipherlist(no) โ With SSLv3 and later, use the Postfix SMTP server's cipher preference order instead of the remote client's cipher preference order.
Available in Postfix version 2.8..3.7: โจ
tls_low_cipherlist(seepostconf -doutput) โ The OpenSSL cipherlist for"low"or higher grade ciphers.tls_export_cipherlist(seepostconf -doutput) โ The OpenSSL cipherlist for"export"or higher grade ciphers.
Available in Postfix version 2.9 and later: โจ
tls_legacy_public_key_fingerprints(no) โ A temporary migration aid for sites that use certificate public-key fingerprints with Postfix 2.9.0..2.9.5, which use an incorrect algorithm. (temporary aid, bestie, don't get attached ๐ฅฒ)
Available in Postfix version 2.11-3.1: โจ
tls_dane_digest_agility(on) โ Configure RFC7671 DANE TLSA digest algorithm agility.tls_dane_trust_anchor_digest_enable(yes) โ Enable support for RFC 6698 (DANE TLSA) DNS records that contain digests of trust-anchors with certificate usage"2".
Available in Postfix version 2.11 and later: โจ
tlsmgr_service_name(tlsmgr) โ The name of thetlsmgr(8)service entry inmaster.cf.
Available in Postfix version 3.0 and later: โจ
tls_session_ticket_cipher(Postfix >= 3.0:aes-256-cbc, Postfix < 3.0:aes-128-cbc) โ Algorithm used to encrypt RFC5077 TLS session tickets.openssl_path(openssl) โ The location of the OpenSSL command line programopenssl(1).
Available in Postfix version 3.2 and later: โจ
tls_eecdh_auto_curves(seepostconf -doutput) โ The prioritized list of elliptic curves, that should be enabled in the Postfix SMTP client and server.
Available in Postfix version 3.4 and later: โจ
tls_server_sni_maps(empty) โ Optional lookup tables that map names received from remote SMTP clients via the TLS Server Name Indication (SNI) extension to the appropriate keys and certificate chains.
Available in Postfix 3.5, 3.4.6, 3.3.5, 3.2.10, 3.1.13 and later: โจ
tls_fast_shutdown_enable(yes) โ A workaround for implementations that hang Postfix while shutting down a TLS session, until Postfix times out. (a whole workaround for someone else's drama ๐ญ)
Available in Postfix version 3.8 and later: โจ
tls_ffdhe_auto_groups(seepostconf -doutput) โ The prioritized list of finite-field Diffie-Hellman ephemeral (FFDHE) key exchange groups supported by the Postfix SMTP client and server.
Available in Postfix 3.9, 3.8.1, 3.7.6, 3.6.10, 3.5.20 and later: โจ
tls_config_file(default) โ Optional configuration file with baseline OpenSSL settings.tls_config_name(empty) โ The application name passed by Postfix to OpenSSL library initialization functions.
โจ STARTTLS SERVER CONTROLS โจ
okay so these settings are literal clones of the Postfix SMTP server settings ๐ซ They let tlsproxy(8) load the same certificate and private key info as the Postfix SMTP server does, before it drops privileges โ so those key files can stay read-only for root and nobody else gets to peek at them ๐ lowkey a whole security glow-up.
real talk though: these settings can currently not be overruled by anything in a tlsproxy(8) client request. That limitation might get removed in a future version, but for now? that's the vibe. ๐
tlsproxy_tls_CAfile($smtpd_tls_CAfile) โ a file holding (PEM format) CA certificates of the root CAs you trust to sign either remote SMTP client certificates or intermediate CA certificates ๐tlsproxy_tls_CApath($smtpd_tls_CApath) โ a directory holding (PEM format) CA certificates of root CAs trusted to sign either remote SMTP client certificates or intermediate CA certificates ๐ฆtlsproxy_tls_always_issue_session_ids($smtpd_tls_always_issue_session_ids) โ force the Postfixtlsproxy(8)server to issue a TLS session id, even when TLS session caching is turned off. yes, even then. periodt โจtlsproxy_tls_ask_ccert($smtpd_tls_ask_ccert) โ ask a remote SMTP client for a client certificate ๐โโ๏ธtlsproxy_tls_ccert_verifydepth($smtpd_tls_ccert_verifydepth) โ the verification depth for remote SMTP client certificates ๐ธtlsproxy_tls_cert_file($smtpd_tls_cert_file) โ file with the Postfixtlsproxy(8)server RSA certificate in PEM format ๐tlsproxy_tls_ciphers($smtpd_tls_ciphers) โ the minimum TLS cipher grade that the Postfixtlsproxy(8)server will use with opportunistic TLS encryption ๐tlsproxy_tls_dcert_file($smtpd_tls_dcert_file) โ file with the Postfixtlsproxy(8)server DSA certificate in PEM formattlsproxy_tls_dh1024_param_file($smtpd_tls_dh1024_param_file) โ file with DH parameters that the Postfixtlsproxy(8)server should use with non-export EDH ciphers ๐งฎtlsproxy_tls_dh512_param_file($smtpd_tls_dh512_param_file) โ file with DH parameters that the Postfixtlsproxy(8)server should use with export-grade EDH cipherstlsproxy_tls_dkey_file($smtpd_tls_dkey_file) โ file with the Postfixtlsproxy(8)server DSA private key in PEM format ๐tlsproxy_tls_eccert_file($smtpd_tls_eccert_file) โ file with the Postfixtlsproxy(8)server ECDSA certificate in PEM formattlsproxy_tls_eckey_file($smtpd_tls_eckey_file) โ file with the Postfixtlsproxy(8)server ECDSA private key in PEM formattlsproxy_tls_eecdh_grade($smtpd_tls_eecdh_grade) โ the Postfixtlsproxy(8)server security grade for ephemeral elliptic-curve Diffie-Hellman (EECDH) key exchange ๐tlsproxy_tls_exclude_ciphers($smtpd_tls_exclude_ciphers) โ list of ciphers or cipher types to exclude from thetlsproxy(8)server cipher list at all TLS security levels ๐ซtlsproxy_tls_fingerprint_digest($smtpd_tls_fingerprint_digest) โ the message digest algorithm used to construct remote SMTP client-certificate fingerprints ๐ซtlsproxy_tls_key_file($smtpd_tls_key_file) โ file with the Postfixtlsproxy(8)server RSA private key in PEM formattlsproxy_tls_loglevel($smtpd_tls_loglevel) โ enable additional Postfixtlsproxy(8)server logging of TLS activity ๐tlsproxy_tls_mandatory_ciphers($smtpd_tls_mandatory_ciphers) โ the minimum TLS cipher grade that the Postfixtlsproxy(8)server will use with mandatory TLS encryptiontlsproxy_tls_mandatory_exclude_ciphers($smtpd_tls_mandatory_exclude_ciphers) โ additional list of ciphers or cipher types to exclude from thetlsproxy(8)server cipher list at mandatory TLS security levelstlsproxy_tls_mandatory_protocols($smtpd_tls_mandatory_protocols) โ the SSL/TLS protocols accepted by the Postfixtlsproxy(8)server with mandatory TLS encryptiontlsproxy_tls_protocols($smtpd_tls_protocols) โ list of TLS protocols that the Postfixtlsproxy(8)server will exclude or include with opportunistic TLS encryptiontlsproxy_tls_req_ccert($smtpd_tls_req_ccert) โ with mandatory TLS encryption, require a trusted remote SMTP client certificate in order to allow TLS connections to proceed โtlsproxy_tls_security_level($smtpd_tls_security_level) โ the SMTP TLS security level for the Postfixtlsproxy(8)server; when a non-empty value is specified, this overrides the obsolete parameterssmtpd_use_tlsandsmtpd_enforce_tls๐tlsproxy_tls_chain_files($smtpd_tls_chain_files) โ files with the Postfixtlsproxy(8)server keys and certificate chains in PEM format โ๏ธ
available in Postfix version 3.9 and later:
tlsproxy_tls_enable_rpk($smtpd_tls_enable_rpk) โ request that remote SMTP clients send an RFC7250 raw public key instead of an X.509 certificate, when asking or requiring client authentication ๐
๐ฆ STARTTLS CLIENT CONTROLS ๐ฆ
these ones are clones of the Postfix SMTP client settings โจ they let tlsproxy(8) load the same certificate and private key info as the Postfix SMTP client, before dropping privileges, so the key files can stay read-only for root. and unlike the server ones, some of these settings may be overruled by info in a tlsproxy(8) client request ๐
available in Postfix version 3.4 and later:
tlsproxy_client_CAfile($smtp_tls_CAfile) โ a file containing CA certificates of root CAs trusted to sign either remote TLS server certificates or intermediate CA certificates ๐tlsproxy_client_CApath($smtp_tls_CApath) โ directory with PEM format Certification Authority certificates that the Postfixtlsproxy(8)client uses to verify a remote TLS server certificatetlsproxy_client_chain_files($smtp_tls_chain_files) โ files with the Postfixtlsproxy(8)client keys and certificate chains in PEM format โ๏ธtlsproxy_client_cert_file($smtp_tls_cert_file) โ file with the Postfixtlsproxy(8)client RSA certificate in PEM formattlsproxy_client_key_file($smtp_tls_key_file) โ file with the Postfixtlsproxy(8)client RSA private key in PEM format ๐tlsproxy_client_dcert_file($smtp_tls_dcert_file) โ file with the Postfixtlsproxy(8)client DSA certificate in PEM formattlsproxy_client_dkey_file($smtp_tls_dkey_file) โ file with the Postfixtlsproxy(8)client DSA private key in PEM formattlsproxy_client_eccert_file($smtp_tls_eccert_file) โ file with the Postfixtlsproxy(8)client ECDSA certificate in PEM formattlsproxy_client_eckey_file($smtp_tls_eckey_file) โ file with the Postfixtlsproxy(8)client ECDSA private key in PEM formattlsproxy_client_fingerprint_digest($smtp_tls_fingerprint_digest) โ the message digest algorithm used to construct remote TLS server certificate fingerprints ๐ซtlsproxy_client_loglevel($smtp_tls_loglevel) โ enable additional Postfixtlsproxy(8)client logging of TLS activity ๐tlsproxy_client_loglevel_parameter(smtp_tls_loglevel) โ the name of the parameter that provides thetlsproxy_client_loglevelvalue ๐ท๏ธtlsproxy_client_scert_verifydepth($smtp_tls_scert_verifydepth) โ the verification depth for remote TLS server certificatestlsproxy_client_use_tls($smtp_use_tls) โ opportunistic mode: use TLS when a remote server announces TLS support ๐tlsproxy_client_enforce_tls($smtp_enforce_tls) โ enforcement mode: require that SMTP servers use TLS encryption ๐tlsproxy_client_per_site($smtp_tls_per_site) โ optional lookup tables with the Postfixtlsproxy(8)client TLS usage policy by next-hop destination and by remote TLS server hostname ๐บ๏ธ
available in Postfix version 3.4-3.6:
tlsproxy_client_level($smtp_tls_security_level) โ the default TLS security level for the Postfixtlsproxy(8)client ๐tlsproxy_client_policy($smtp_tls_policy_maps) โ optional lookup tables with the Postfixtlsproxy(8)client TLS security policy by next-hop destination
available in Postfix version 3.7 and later:
tlsproxy_client_security_level($smtp_tls_security_level) โ the default TLS security level for the Postfixtlsproxy(8)client ๐tlsproxy_client_policy_maps($smtp_tls_policy_maps) โ optional lookup tables with the Postfixtlsproxy(8)client TLS security policy by next-hop destination
๐ OBSOLETE STARTTLS SUPPORT CONTROLS ๐
ngl these parameters are only here for compatibility with smtpd(8) legacy parameters. they're giving vintage, and not in the cute way ๐ซ
tlsproxy_use_tls($smtpd_use_tls) โ opportunistic TLS: announce STARTTLS support to remote SMTP clients, but do not require that clients use TLS encryptiontlsproxy_enforce_tls($smtpd_enforce_tls) โ mandatory TLS: announce STARTTLS support to remote SMTP clients, and require that clients use TLS encryption ๐tlsproxy_client_use_tls($smtp_use_tls) โ opportunistic mode: use TLS when a remote server announces TLS supporttlsproxy_client_enforce_tls($smtp_enforce_tls) โ enforcement mode: require that SMTP servers use TLS encryption
๐ RESOURCE CONTROLS ๐
tlsproxy_watchdog_timeout(10s) โ how much time atlsproxy(8)process may take to process local or remote I/O before it is terminated by a built-in watchdog timer โฐ the vibes expire, bestie.
๐ธ MISCELLANEOUS CONTROLS ๐ธ
config_directory(seepostconf -doutput) โ the default location of the Postfixmain.cfandmaster.cfconfiguration files ๐process_id(read-only) โ the process ID of a Postfix command or daemon process ๐ขprocess_name(read-only) โ the process name of a Postfix command or daemon process ๐ท๏ธsyslog_facility(mail) โ the syslog facility of Postfix logging ๐ฎsyslog_name(seepostconf -doutput) โ 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:
service_name(read-only) โ themaster.cfservice name of a Postfix daemon process ๐
๐ฅ SEE ALSO ๐ฅ
postscreen(8), Postfix zombie blocker ๐งsmtpd(8), Postfix SMTP serverpostconf(5), configuration parameterspostlogd(8), Postfix loggingsyslogd(8), system logging
๐ LICENSE ๐
The Secure Mailer license must be distributed with this software. no exceptions bestie, it's literally the rules ๐โจ
๐ HISTORY ๐
This service was introduced with Postfix version 2.8. an icon from day one, fr fr ๐
๐ AUTHOR(S) ๐
Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA
Wietse Venema Google, Inc. 111 8th Avenue New York, NY 10011, USA
and that's the whole page babes ๐ซถ this was TLSPROXY(8) from the Postfix source, dated like the original manpage footer says โ go forth and proxy your TLS, you absolute legend ๐๐๐ฆ
๐ฆ where this page comes from
- alpine 3.22: postfix-doc 3.10.13-r0 ยท IPL-1.0 EPL-2.0
- alpine 3.23: postfix-doc 3.10.13-r0 ยท IPL-1.0 EPL-2.0
- alpine 3.24: postfix-doc 3.11.7-r0 ยท IPL-1.0 EPL-2.0
- arch rolling: postfix 3.11.7-1 ยท EPL-2.0 OR IPL-1.0 AND BSD-4-Clause-UC
- debian trixie: postfix 3.10.13-0+deb13u1
- fedora 43: postfix 2:3.10.14-1.fc43 ยท (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 43: postfix 2:3.10.3-3.fc43 ยท (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 44: postfix 2:3.10.14-1.fc44 ยท (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 44: postfix 2:3.10.7-2.fc44 ยท (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- nixos 26.05: postfix 3.11.7
- nixpkgs unstable: postfix 3.11.7
- opensuse-leap 16.0: postfix 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix-bdb 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix-bdb 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix-bdb 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix-bdb 3.10.2-160000.3.1 ยท EPL-2.0 OR IPL-1.0
- ubuntu questing: postfix 3.10.2-1ubuntu2
- ubuntu questing: postfix 3.10.2-1ubuntu2.1
- ubuntu resolute: postfix 3.10.6-4ubuntu2
- ubuntu resolute: postfix 3.10.6-4ubuntu2.1
- ubuntu resolute: postfix 3.10.6-4ubuntu2.2
- ubuntu stonking: postfix 3.11.7-1ubuntu2
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms