TLSPROXY(8postfix)

πŸ“¦
version 3.8.6 Β· 3 versions
, in ubuntu noble

πŸ’– TLSPROXY(8postfix) β€” Postfix TLS proxy πŸ’–

okay bestie, gather round, because this one is a whole moment. it's tlsproxy from the 8postfix manual section, and it's lowkey iconic. let's get into it. πŸŽ€


✨ NAME ✨

tlsproxy β€” Postfix TLS proxy. that's it, that's the name, slay. πŸ’…


✨ SYNOPSIS ✨

tlsproxy [generic Postfix daemon options]

✨ DESCRIPTION ✨

so the tlsproxy(8) server is literally a two-way TLS proxy. it's giving middleman, but make it secure. πŸ¦‹

it gets used by the postscreen(8) server to talk SMTP-over-TLS with remote SMTP clients that are not allowlisted (and yes, that includes clients whose allowlist status has expired β€” the vibes have left the building, they're out). it's also used by the smtp(8) client to support TLS connection reuse. but honestly? it should also work for non-SMTP protocols, so it's flexible like that. main character energy fr fr. πŸ‘‘

okay and here's a lil tip: even though one single tlsproxy(8) process can serve multiple sessions at the same time (multitasking queen), it's a good idea to let the number of processes grow with the load, so the service stays responsive and doesn't get overwhelmed. no cap. πŸ’€


🌸 PROTOCOL EXAMPLE 🌸

the example below is all about postscreen(8). BUT β€” and this is important β€” the tlsproxy(8) server is agnostic of the application protocol, so you can adapt this example to other applications super easily. it doesn't care, it's unbothered, it's thriving. ✨

so here's the storyline, bestie:

  1. the postscreen(8) server receives a valid remote SMTP client STARTTLS command.
  2. then it sends tlsproxy(8) three things: the remote SMTP client endpoint string, the requested role (server), and the requested timeout.
  3. postscreen(8) then receives a "TLS available" indication from tlsproxy(8).
  4. if the TLS service is available, postscreen(8) sends the remote SMTP client file descriptor to tlsproxy(8), and sends the plaintext 220 greeting to the remote SMTP client.
  5. and that is what triggers TLS negotiations between the remote SMTP client and tlsproxy(8). πŸŽ€
  6. upon completion of the TLS-level handshake, tlsproxy(8) translates between plaintext from/to postscreen(8) and ciphertext to/from the remote SMTP client. it's literally bilingual. it's giving translator arc. 🌈

πŸ”’ SECURITY πŸ”’

the tlsproxy(8) server is moderately security-sensitive. it talks to untrusted clients on the network, so like… stay alert, bestie. πŸ‘€

the good news: the process can be run chrooted at fixed low privilege, which is a nice lil safety blanket. 🫢


🩺 DIAGNOSTICS 🩺

problems and transactions get logged to syslogd(8) or postlogd(8). so if something's acting up, that's where the receipts live. πŸ“


βš™οΈ CONFIGURATION PARAMETERS βš™οΈ

heads up!! 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 don't just sit there waiting for it to notice. 😭

if you want the change to actually happen fast, use this command:

postfix reload

the text below is only a parameter summary. for more details (including examples, because we love an example), go read postconf(5). πŸ’œ


🌟 STARTTLS GLOBAL CONTROLS 🌟

these settings are global, which means they cannot be overruled by anything a tlsproxy(8) client request says. they run the show. periodt. πŸ‘‘

  • tls_append_default_CA (no) β€” append the system-supplied default Certification Authority certificates to the ones you specified with *_tls_CApath or *_tls_CAfile.
  • tls_daemon_random_bytes (32) β€” the number of pseudo-random bytes that an smtp(8) or smtpd(8) process requests from the tlsmgr(8) server, in order to seed its internal pseudo random number generator (PRNG). ✨
  • tls_high_cipherlist (see postconf -d output) β€” the OpenSSL cipherlist for "high" grade ciphers. only the best for you. πŸ’…
  • tls_medium_cipherlist (see postconf -d output) β€” 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 bestie, no encryption. read that twice.
  • 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 (see postconf -d output) β€” 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. server said "my order, not yours." πŸ’…

available in Postfix version 2.8..3.7:

  • tls_low_cipherlist (see postconf -d output) β€” the OpenSSL cipherlist for "low" or higher grade ciphers.
  • tls_export_cipherlist (see postconf -d output) β€” 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. (yeah, it's a whole thing. it's a bandaid, not a lifestyle.) 🩹

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 the tlsmgr(8) service entry in master.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 program openssl(1).

available in Postfix version 3.2 and later:

  • tls_eecdh_auto_curves (see postconf -d output) β€” the prioritized list of elliptic curves supported by 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. (rude of them, honestly.) 😀

available in Postfix version 3.8 and later:

  • tls_ffdhe_auto_groups (see postconf -d output) β€” 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 bestie, these settings are literally clones of the Postfix SMTP server settings πŸ‘― they let tlsproxy(8) load up the exact same certificate and private key info that the Postfix SMTP server uses, and it does this before dropping privileges, so the key files can stay read-only for root πŸ”’ iconic security behavior, no cap.

heads up though: these settings currently can't be overruled by info in a tlsproxy(8) client request β€” but that limitation may get removed in a future version, so stay tuned πŸ‘€
  • tlsproxy_tls_CAfile ($smtpd_tls_CAfile) β€” a file holding (PEM format) CA certificates of root CAs that are trusted 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 Postfix tlsproxy(8) server to issue a TLS session id, even when TLS session caching is turned off. stubborn queen πŸ’…
  • 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 Postfix tlsproxy(8) server RSA certificate in PEM format.
  • tlsproxy_tls_ciphers ($smtpd_tls_ciphers) β€” the minimum TLS cipher grade that the Postfix tlsproxy(8) server will use with opportunistic TLS encryption.
  • tlsproxy_tls_dcert_file ($smtpd_tls_dcert_file) β€” file with the Postfix tlsproxy(8) server DSA certificate in PEM format.
  • tlsproxy_tls_dh1024_param_file ($smtpd_tls_dh1024_param_file) β€” file with DH parameters that the Postfix tlsproxy(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 Postfix tlsproxy(8) server should use with export-grade EDH ciphers.
  • tlsproxy_tls_dkey_file ($smtpd_tls_dkey_file) β€” file with the Postfix tlsproxy(8) server DSA private key in PEM format.
  • tlsproxy_tls_eccert_file ($smtpd_tls_eccert_file) β€” file with the Postfix tlsproxy(8) server ECDSA certificate in PEM format.
  • tlsproxy_tls_eckey_file ($smtpd_tls_eckey_file) β€” file with the Postfix tlsproxy(8) server ECDSA private key in PEM format.
  • tlsproxy_tls_eecdh_grade ($smtpd_tls_eecdh_grade) β€” the Postfix tlsproxy(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 the tlsproxy(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 Postfix tlsproxy(8) server RSA private key in PEM format.
  • tlsproxy_tls_loglevel ($smtpd_tls_loglevel) β€” turn on extra Postfix tlsproxy(8) server logging of TLS activity. gossip but make it TLS πŸ—£οΈ
  • tlsproxy_tls_mandatory_ciphers ($smtpd_tls_mandatory_ciphers) β€” the minimum TLS cipher grade that the Postfix tlsproxy(8) server will use with mandatory TLS encryption.
  • tlsproxy_tls_mandatory_exclude_ciphers ($smtpd_tls_mandatory_exclude_ciphers) β€” an additional list of ciphers or cipher types to exclude from the tlsproxy(8) server cipher list at mandatory TLS security levels.
  • tlsproxy_tls_mandatory_protocols ($smtpd_tls_mandatory_protocols) β€” the SSL/TLS protocols accepted by the Postfix tlsproxy(8) server with mandatory TLS encryption.
  • tlsproxy_tls_protocols ($smtpd_tls_protocols) β€” list of TLS protocols that the Postfix tlsproxy(8) server will exclude or include with opportunistic TLS encryption.
  • tlsproxy_tls_req_ccert ($smtpd_tls_req_ccert) β€” with mandatory TLS encryption, require a trusted remote SMTP client certificate before letting TLS connections proceed. no cert, no entry 🚫
  • tlsproxy_tls_security_level ($smtpd_tls_security_level) β€” the SMTP TLS security level for the Postfix tlsproxy(8) server; when a non-empty value is specified, this overrides the obsolete parameters smtpd_use_tls and smtpd_enforce_tls.
  • tlsproxy_tls_chain_files ($smtpd_tls_chain_files) β€” files with the Postfix tlsproxy(8) server keys and certificate chains in PEM format.

✨ STARTTLS CLIENT CONTROLS ✨

and now for the client side πŸ¦‹ these settings 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 be kept read-only for root πŸ”. some settings may be overruled by information in a tlsproxy(8) client request, so that's a little more flexible, love that for us.

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 Postfix tlsproxy(8) client uses to verify a remote TLS server certificate.
  • tlsproxy_client_chain_files ($smtp_tls_chain_files) β€” files with the Postfix tlsproxy(8) client keys and certificate chains in PEM format.
  • tlsproxy_client_cert_file ($smtp_tls_cert_file) β€” file with the Postfix tlsproxy(8) client RSA certificate in PEM format.
  • tlsproxy_client_key_file ($smtp_tls_key_file) β€” file with the Postfix tlsproxy(8) client RSA private key in PEM format.
  • tlsproxy_client_dcert_file ($smtp_tls_dcert_file) β€” file with the Postfix tlsproxy(8) client DSA certificate in PEM format.
  • tlsproxy_client_dkey_file ($smtp_tls_dkey_file) β€” file with the Postfix tlsproxy(8) client DSA private key in PEM format.
  • tlsproxy_client_eccert_file ($smtp_tls_eccert_file) β€” file with the Postfix tlsproxy(8) client ECDSA certificate in PEM format.
  • tlsproxy_client_eckey_file ($smtp_tls_eckey_file) β€” file with the Postfix tlsproxy(8) client ECDSA private key in PEM format.
  • tlsproxy_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) β€” turn on extra Postfix tlsproxy(8) client logging of TLS activity.
  • tlsproxy_client_loglevel_parameter (smtp_tls_loglevel) β€” the name of the parameter that provides the tlsproxy_client_loglevel value.
  • tlsproxy_client_scert_verifydepth ($smtp_tls_scert_verifydepth) β€” the verification depth for remote TLS server certificates.
  • tlsproxy_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. no TLS = no talk 😀
  • tlsproxy_client_per_site ($smtp_tls_per_site) β€” optional lookup tables with the Postfix tlsproxy(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 Postfix tlsproxy(8) client.
  • tlsproxy_client_policy ($smtp_tls_policy_maps) β€” optional lookup tables with the Postfix tlsproxy(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 Postfix tlsproxy(8) client.
  • tlsproxy_client_policy_maps ($smtp_tls_policy_maps) β€” optional lookup tables with the Postfix tlsproxy(8) client TLS security policy by next-hop destination.

🌈 OBSOLETE STARTTLS SUPPORT CONTROLS 🌈

these parameters are still hanging around for compatibility with smtpd(8) legacy parameters 🫢 retro era, we respect it, but like… they're obsolete bestie.

  • tlsproxy_use_tls ($smtpd_use_tls) β€” opportunistic TLS: announce STARTTLS support to remote SMTP clients, but don't require that clients use TLS encryption.
  • tlsproxy_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 support.
  • tlsproxy_client_enforce_tls ($smtp_enforce_tls) β€” enforcement mode: require that SMTP servers use TLS encryption.

🧚 RESOURCE CONTROLS 🧚

  • tlsproxy_watchdog_timeout (10s) β€” how much time a tlsproxy(8) process may take to process local or remote I/O before it gets terminated by a built-in watchdog timer. tick tock, the watchdog is watching ⏰

πŸŽ€ MISCELLANEOUS CONTROLS πŸŽ€

  • config_directory (see postconf -d output) β€” the default location of the Postfix main.cf and master.cf configuration 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 (see postconf -d output) β€” a prefix that gets 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) β€” the master.cf service name of a Postfix daemon process.

πŸ‘€ SEE ALSO πŸ‘€


πŸ’– LICENSE πŸ’–

The Secure Mailer license must be distributed with this software. periodt, that's the legal tea β˜•


πŸ“œ HISTORY πŸ“œ

This service was introduced with Postfix version 2.8. vintage 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 a wrap on TLSPROXY(8postfix) 🫢 you read the whole thing, bestie, that's main character energy right there. go forth and proxy your TLS like the icon you are πŸ’…βœ¨

πŸ“¦ where this page comes from