SMTP(8postfix)

๐Ÿ“ฆ
version 3.8.6 ยท 3 versions
, in ubuntu noble

โœจ SMTP(8postfix) โœจ

okay bestie, gather round, because this is the smtp page from the Postfix manual โ€” manual section 8, daemon-flavored โ€” and it's literally the whole entire vibe of how Postfix goes out there and delivers your mail. it's a big one so we're doing it in parts. buckle up. ๐ŸŽ€


๐Ÿ’Œ NAME

smtp โ€” the Postfix SMTP+LMTP client. yes it does both. overachiever behavior, we love to see it. ๐Ÿ’…


๐Ÿฆ‹ SYNOPSIS

smtp [generic Postfix daemon options] [flags=DORX]

that's it, that's the whole summoning ritual. โœจ


๐ŸŒธ DESCRIPTION

so the Postfix SMTP+LMTP client is the thing that actually speaks the SMTP and LMTP mail delivery protocols out loud. it takes message delivery requests handed to it by the queue manager, and each request comes with: a queue file, a sender address, a domain or host to deliver to, and recipient info. and like, heads up โ€” this program expects to be launched by the master(8) process manager. it does not want to be started by you. it wants to be started by master. respect the hierarchy. ๐Ÿ‘‘

what it does with those requests: it updates the queue file and marks recipients as finished, OR it goes back to the queue manager like "bestie we gotta try again later" and reschedules. delivery status reports get sent to the bounce(8), defer(8) or trace(8) daemon, whichever one is appropriate for the situation. ๐Ÿซถ

then it looks up a list of mail exchanger addresses for the destination host, sorts that list by preference, and connects to each listed address in turn until it finds a server that actually responds. it's giving "calling every number in your contacts until someone picks up." ๐Ÿ“ž

if a server is unreachable, or if the delivery fails because of a recoverable error condition, the SMTP+LMTP client will try to deliver the mail to an alternate host. plan B always exists.

and after a successful mail transaction? a connection may be saved to the scache(8) connection cache server so that any SMTP+LMTP client can reuse it for a subsequent transaction. reusing connections is the most sustainable, zero-waste, eco-friendly, main character thing you can do honestly. ๐ŸŒˆ

by default, connection caching is enabled temporarily for destinations that have a high volume of mail sitting in the active queue. but you can also enable it permanently for specific destinations if you're obsessed with them. ๐Ÿ’–


๐Ÿ“ฎ SMTP DESTINATION SYNTAX

the Postfix SMTP+LMTP client supports multiple destinations separated by comma or whitespace โ€” and that's Postfix 3.5 and later, fyi.

SMTP destinations look like this:

  • domainname
  • domainname:port โ€” look up the mail exchangers for the specified domain, and connect to the specified port (default: smtp).
  • [hostname]
  • [hostname]:port โ€” look up the address(es) of the specified host, and connect to the specified port (default: smtp).
  • [address]
  • [address]:port โ€” connect to the host at the specified address, and connect to the specified port (default: smtp). an IPv6 address must be formatted as [ipv6:address]. do not forget the brackets, i am begging you. ๐Ÿฅบ

๐Ÿงš LMTP DESTINATION SYNTAX

same deal, multiple destinations separated by comma or whitespace (Postfix 3.5 and later). LMTP destinations look like this:

  • unix:pathname โ€” connect to the local UNIX-domain server bound to the specified pathname. if the process runs chrooted, an absolute pathname is interpreted relative to the Postfix queue directory. (chroot says "your / is not my `/", iykyk)
  • inet:hostname
  • inet:hostname:port
  • inet:[address]
  • inet:[address]:port โ€” connect to the specified TCP port on the specified local or remote host. if no port is specified, connect to the port defined as lmtp in services(4). if no such service is found, the lmtp_tcp_port configuration parameter gets used instead (default value of 24). and again: an IPv6 address must be formatted as [ipv6:address]. ๐Ÿฆ‹

๐ŸŽฏ SINGLE-RECIPIENT DELIVERY

by default, the Postfix SMTP+LMTP client delivers mail to multiple recipients per delivery request. which is fine and normal! except it's not what you want when you're prepending a Delivered-to: or X-Original-To: message header. ๐Ÿ’€

so if you wanna stop Postfix from sending multiple recipients per delivery request, set this:

transport_destination_recipient_limit = 1

in the Postfix main.cf file, where transport is the name in the first column of the Postfix master.cf entry for this mail delivery service. one recipient, one request. exclusive. ๐Ÿ’…


๐Ÿท๏ธ COMMAND ATTRIBUTE SYNTAX

flags=DORX (optional)

optional message processing flags. here's the tea on each one:

  • D โ€” prepend a "Delivered-To: recipient" message header with the envelope recipient address.
โš ๏ธ note: for this to work, the transport_destination_recipient_limit must be 1 (peep SINGLE-RECIPIENT DELIVERY above for the details, bestie).

the D flag also enforces loop detection: if a message already contains a Delivered-To: header with the same recipient address, then the message is returned as undeliverable. the address comparison is case insensitive.

this feature is available as of Postfix 3.5.

  • O โ€” prepend an "X-Original-To: recipient" message header with the recipient address as given to Postfix.
โš ๏ธ note: for this to work, the transport_destination_recipient_limit must be 1 (see SINGLE-RECIPIENT DELIVERY above for details).

this feature is available as of Postfix 3.5.

  • R โ€” prepend a "Return-Path: <sender>" message header with the envelope sender address.

this feature is available as of Postfix 3.5.

  • X โ€” indicates that the delivery is final. this flag affects the status reported in "success" DSN (delivery status notification) messages, and changes it from "relayed" into "delivered".

this feature is available as of Postfix 3.5.


๐Ÿ”’ SECURITY

the SMTP+LMTP client is moderately security-sensitive. it talks to SMTP or LMTP servers and to DNS servers on the network. the SMTP+LMTP client can be run chrooted at fixed low privilege. locked down but still cute. ๐Ÿซถ


๐Ÿ“œ STANDARDS

a whole syllabus. we love an educated queen. ๐Ÿ“šโœจ


๐Ÿฉบ DIAGNOSTICS

problems and transactions get logged to syslogd(8) or postlogd(8). and corrupted message files get marked so that the queue manager can move them to the corrupt queue for further inspection. (it's not deleted, it's quarantined. it's in time-out.) ๐Ÿ™ˆ

depending on the setting of the notify_classes parameter, the postmaster is notified of bounces, protocol problems, and of other trouble. so like, the postmaster will find out. ๐Ÿ’€


๐Ÿ› BUGS

  • SMTP and LMTP connection reuse for TLS (without closing the SMTP or LMTP connection) is not supported before Postfix 3.4.
  • SMTP and LMTP connection reuse assumes that SASL credentials are valid for all destinations that map onto the same IP address and TCP port. (so like, careful with that assumption, it's doing a lot of heavy lifting.)

โš™๏ธ CONFIGURATION PARAMETERS

before Postfix version 2.3, the LMTP client was a separate program that implemented only a subset of the functionality available with SMTP: there's no support for TLS, and connections are cached in-process, which makes it ineffective when the client is used for multiple domains. ancient history, but we respect the lore. ๐Ÿ›๏ธ

most smtp_xxx configuration parameters have an lmtp_xxx "mirror" parameter for the equivalent LMTP feature. this document describes only those LMTP-related parameters that aren't simply "mirror" parameters. no duplicates, we're not doing that today.

changes to main.cf are picked up automatically, since smtp(8) processes only run for a limited amount of time. if you're impatient (same), use the command postfix reload to speed up a change. โšก

the text below provides only a parameter summary. see postconf(5) for more details including examples. ๐Ÿ“–


๐Ÿ’ซ COMPATIBILITY CONTROLS ๐Ÿ’ซ

Okay bestie, this whole section is basically the "we love you, legacy systems" part of the config. Every knob here is a little accommodation for the weird, the old, and the firewall-brained. Defaults are in the parentheses, as always ๐Ÿซถ

  • ignore_mx_lookup_error (no) โ€” when a DNS MX lookup comes back with literally nothing, just ignore it. No response, no drama.
  • smtp_always_send_ehlo (yes) โ€” always fire off an EHLO at the top of an SMTP session. Every time. No exceptions.
  • smtp_never_send_ehlo (no) โ€” the exact opposite vibe: never send EHLO at the start of an SMTP session.
  • smtp_defer_if_no_mx_address_found (no) โ€” if no MX record actually resolves to an IP address, defer the delivery instead of justโ€ฆ sending it anyway.
  • smtp_line_length_limit (998) โ€” the max length of message header and body lines that Postfix will send over SMTP. 998, iconic, don't @ me.
  • smtp_pix_workaround_delay_time (10s) โ€” how long the Postfix SMTP client pauses before sending .<CR><LF>, purely to dodge the PIX firewall <CR><LF>.<CR><LF> bug. Cisco really said "let me ruin your day" ๐Ÿ˜ญ
  • smtp_pix_workaround_threshold_time (500s) โ€” how long a message has to sit in the queue before the Postfix SMTP client turns on that PIX firewall <CR><LF>.<CR><LF> bug workaround for delivery through firewalls with smtp fixup mode turned on.
  • smtp_pix_workarounds (disable_esmtp, delay_dotcrlf) โ€” a list specifying zero or more workarounds for CISCO PIX firewall bugs. Zero is a valid answer, queen.
  • smtp_pix_workaround_maps (empty) โ€” lookup tables, indexed by the remote SMTP server address, holding per-destination workarounds for CISCO PIX firewall bugs.
  • smtp_quote_rfc821_envelope (yes) โ€” quote addresses in Postfix SMTP client MAIL FROM and RCPT TO commands the way RFC 5321 requires. Manners!
  • smtp_reply_filter (empty) โ€” a whole mechanism to transform replies from remote SMTP servers, one line at a time. Glow-up but for server replies โœจ
  • smtp_skip_5xx_greeting (yes) โ€” if a remote SMTP server greets you with a 5XX status code, just skip it. Not today.
  • smtp_skip_quit_response (yes) โ€” don't wait around for a response to the SMTP QUIT command. Leave them on read ๐Ÿ’…

Available in Postfix version 2.0 and earlier:

  • smtp_skip_4xx_greeting (yes) โ€” skip SMTP servers that greet with a 4XX status code (go away, try again later).

Available in Postfix version 2.2 and later:

  • smtp_discard_ehlo_keyword_address_maps (empty) โ€” lookup tables, indexed by the remote SMTP server address, holding case insensitive lists of EHLO keywords (pipelining, starttls, auth, etc.) that the Postfix SMTP client will ignore in the EHLO response from a remote SMTP server.
  • smtp_discard_ehlo_keywords (empty) โ€” a case insensitive list of EHLO keywords (pipelining, starttls, auth, etc.) that the Postfix SMTP client will ignore in the EHLO response from a remote SMTP server.
  • smtp_generic_maps (empty) โ€” optional lookup tables that do address rewriting in the Postfix SMTP client, typically turning a locally valid address into a globally valid one when you're sending mail across the Internet. Cute little address glow-up ๐ŸŒธ

Available in Postfix version 2.2.9 and later:

  • smtp_cname_overrides_servername (version dependent) โ€” when the remote SMTP servername is a DNS CNAME, replace the servername with the result from CNAME expansion for the purpose of logging, SASL password lookup, TLS policy decisions, or TLS certificate verification.

Available in Postfix version 2.3 and later:

  • lmtp_discard_lhlo_keyword_address_maps (empty) โ€” lookup tables, indexed by the remote LMTP server address, holding case insensitive lists of LHLO keywords (pipelining, starttls, auth, etc.) that the Postfix LMTP client will ignore in the LHLO response from a remote LMTP server.
  • lmtp_discard_lhlo_keywords (empty) โ€” a case insensitive list of LHLO keywords (pipelining, starttls, auth, etc.) that the Postfix LMTP client will ignore in the LHLO response from a remote LMTP server.

Available in Postfix version 2.4.4 and later:

  • send_cyrus_sasl_authzid (no) โ€” when authenticating to a remote SMTP or LMTP server, the default setting no means: send no SASL authoriZation ID (authzid); send only the SASL authentiCation ID (authcid) plus the authcid's password. Identity crisis avoided ๐Ÿชช

Available in Postfix version 2.5 and later:

  • smtp_header_checks (empty) โ€” restricted header_checks(5) tables for the Postfix SMTP client.
  • smtp_mime_header_checks (empty) โ€” restricted mime_header_checks(5) tables for the Postfix SMTP client.
  • smtp_nested_header_checks (empty) โ€” restricted nested_header_checks(5) tables for the Postfix SMTP client.
  • smtp_body_checks (empty) โ€” restricted body_checks(5) tables for the Postfix SMTP client.

Available in Postfix version 2.6 and later:

  • tcp_windowsize (0) โ€” an optional workaround for routers that break TCP window scaling. Networking villains, truly ๐Ÿ’€

Available in Postfix version 2.8 and later:

  • smtp_dns_resolver_options (empty) โ€” DNS Resolver options for the Postfix SMTP client.

Available in Postfix version 2.9 - 3.6:

  • smtp_per_record_deadline (no) โ€” changes how the smtp_*_timeout time limits behave: instead of a time limit per read or write system call, it becomes 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 2.9 and later:

  • smtp_send_dummy_mail_auth (no) โ€” whether or not to append the "AUTH=<>" option to the MAIL FROM command in SASL-authenticated SMTP sessions.

Available in Postfix version 2.11 and later:

  • smtp_dns_support_level (empty) โ€” level of DNS support in the Postfix SMTP client.

Available in Postfix version 3.0 and later:

  • smtp_delivery_status_filter ($default_delivery_status_filter) โ€” optional filter for the smtp(8) delivery agent to change the delivery status code or explanatory text of successful or unsuccessful deliveries.
  • smtp_dns_reply_filter (empty) โ€” optional filter for Postfix SMTP client DNS lookup results.

Available in Postfix version 3.3 and later:

  • smtp_balance_inet_protocols (yes) โ€” when a remote destination resolves to a mix of IPv4 and IPv6 addresses, make sure the Postfix SMTP client can try both address types before it runs into the smtp_mx_address_limit. Equality, bestie ๐Ÿค

Available in Postfix 3.5 and later:

  • info_log_address_format (external) โ€” the email address form that will be used in non-debug logging (info, warning, etc.).

Available in Postfix 3.6 and later:

  • dnssec_probe (ns:.) โ€” the DNS query type (default: "ns") and DNS query name (default: ".") that Postfix may use to determine whether DNSSEC validation is available.
  • known_tcp_ports (lmtp=24, smtp=25, smtps=submissions=465, submission=587) โ€” optional setting that avoids lookups in the services(5) database. Fewer lookups, faster vibes โšก

Available in Postfix version 3.7 and later:

  • smtp_per_request_deadline (no) โ€” changes how the smtp_*_timeout time limits behave: instead of a time limit per plaintext or TLS read or write call, it becomes a combined 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 DATA requests, when deadlines are enabled with smtp_per_request_deadline.
  • header_from_format (standard) โ€” the format of the Postfix-generated From: header.

Available in Postfix version 3.8 and later:

  • use_srv_lookup (empty) โ€” enables discovery for the specified service(s) using DNS SRV records.
  • ignore_srv_lookup_error (no) โ€” when SRV record lookup fails, fall back to MX or IP address lookup as if SRV record lookup was not enabled.
  • allow_srv_lookup_fallback (no) โ€” when SRV record lookup fails or no SRV record exists, fall back to MX or IP address lookup as if SRV record lookup was not enabled.

๐Ÿงš MIME PROCESSING CONTROLS ๐Ÿงš

Available in Postfix version 2.0 and later:

  • disable_mime_output_conversion (no) โ€” disable the conversion of 8BITMIME format to 7BIT format. Let the bits live free ๐Ÿ’–
  • mime_boundary_length_limit (2048) โ€” the maximal length of MIME multipart boundary strings.
  • mime_nesting_limit (100) โ€” the maximal recursion level that the MIME processor will handle. 100 layers deep, it's giving onion ๐Ÿง…

๐Ÿ” EXTERNAL CONTENT INSPECTION CONTROLS ๐Ÿ”

Available in Postfix version 2.1 and later:

  • smtp_send_xforward_command (no) โ€” send the non-standard XFORWARD command when the Postfix SMTP server EHLO response announces XFORWARD support.

๐Ÿ” SASL AUTHENTICATION CONTROLS ๐Ÿ”

  • smtp_sasl_auth_enable (no) โ€” enable SASL authentication in the Postfix SMTP client.
  • smtp_sasl_password_maps (empty) โ€” optional Postfix SMTP client lookup tables with one username:password entry per sender, remote hostname or next-hop domain. Keep these safe, bestie, they're literally the keys to the kingdom ๐Ÿ—๏ธ
  • smtp_sasl_security_options (noplaintext, noanonymous) โ€” Postfix SMTP client SASL security options; as of Postfix 2.3 the list of available features depends on the SASL client implementation that is selected with smtp_sasl_type.

Available in Postfix version 2.2 and later:

  • smtp_sasl_mechanism_filter (empty) โ€” if non-empty, a Postfix SMTP client filter for the remote SMTP server's list of offered SASL mechanisms.

Available in Postfix version 2.3 and later:

  • smtp_sender_dependent_authentication (no) โ€” enable sender-dependent authentication in the Postfix SMTP client; this is available only with SASL authentication, and it disables SMTP connection caching to ensure that mail from different senders will use the appropriate credentials. No credential crossover, periodt.
  • smtp_sasl_path (empty) โ€” implementation-specific information that the Postfix SMTP client passes through to the SASL plug-in implementation that is selected with smtp_sasl_type.
  • smtp_sasl_type (cyrus) โ€” the SASL plug-in type that the Postfix SMTP client should use for authentication.

Available in Postfix version 2.5 and later:

  • smtp_sasl_auth_cache_name (empty) โ€” an optional table to prevent repeated SASL authentication failures with the same remote SMTP server hostname, username and password.
  • smtp_sasl_auth_cache_time (90d) โ€” the maximal age of an smtp_sasl_auth_cache_name entry before it is removed.
  • smtp_sasl_auth_soft_bounce (yes) โ€” when a remote SMTP server rejects a SASL authentication request with a 535 reply code, defer mail delivery instead of returning mail as undeliverable. Soft bounce, soft heart ๐Ÿซถ

Available in Postfix version 2.9 and later:

  • smtp_send_dummy_mail_auth (no) โ€” whether or not to append the "AUTH=<>" option to the MAIL FROM command in SASL-authenticated SMTP sessions.

โœจ STARTTLS SUPPORT CONTROLS โœจ

okay so if you want the full tea on STARTTLS config, it's all in the TLS_README document bestie ๐Ÿ’–


  • smtp_tls_security_level (empty) โ€” the default SMTP TLS security level for the Postfix SMTP client. that's it, that's the vibe check ๐Ÿฆ‹
  • smtp_sasl_tls_security_options ($smtp_sasl_security_options) โ€” the SASL auth security options that the Postfix SMTP client uses for TLS encrypted SMTP sessions ๐Ÿ”
  • smtp_starttls_timeout (300s) โ€” time limit for Postfix SMTP client write and read operations during TLS startup and shutdown handshake procedures. like a lil timer so it doesn't just sit there ๐Ÿ’€
  • smtp_tls_CAfile (empty) โ€” a file containing CA certificates of root CAs trusted to sign either remote SMTP server certificates or intermediate CA certificates ๐ŸŒณ
  • smtp_tls_CApath (empty) โ€” directory with PEM format Certification Authority certificates that the Postfix SMTP client uses to verify a remote SMTP server certificate ๐Ÿ“
  • smtp_tls_cert_file (empty) โ€” file with the Postfix SMTP client RSA certificate in PEM format ๐ŸŽ€
  • smtp_tls_mandatory_ciphers (medium) โ€” the minimum TLS cipher grade that the Postfix SMTP client will use with mandatory TLS encryption ๐Ÿ”ฅ
  • smtp_tls_exclude_ciphers (empty) โ€” list of ciphers or cipher types to exclude from the Postfix SMTP client cipher list at all TLS security levels. not me blocking them ๐Ÿšซ
  • smtp_tls_mandatory_exclude_ciphers (empty) โ€” additional list of ciphers or cipher types to exclude from the Postfix SMTP client cipher list at mandatory TLS security levels ๐Ÿ™ˆ
  • smtp_tls_dcert_file (empty) โ€” file with the Postfix SMTP client DSA certificate in PEM format ๐Ÿ“œ
  • smtp_tls_dkey_file ($smtp_tls_dcert_file) โ€” file with the Postfix SMTP client DSA private key in PEM format ๐Ÿ”‘
  • smtp_tls_key_file ($smtp_tls_cert_file) โ€” file with the Postfix SMTP client RSA private key in PEM format ๐Ÿ—๏ธ
  • smtp_tls_loglevel (0) โ€” enable additional Postfix SMTP client logging of TLS activity ๐Ÿ“
  • smtp_tls_note_starttls_offer (no) โ€” log the hostname of a remote SMTP server that offers STARTTLS, when TLS is not already enabled for that server ๐Ÿ‘€
  • smtp_tls_policy_maps (empty) โ€” optional lookup tables with the Postfix SMTP client TLS security policy by next-hop destination; when a non-empty value is specified, this overrides the obsolete smtp_tls_per_site parameter โœจ
  • smtp_tls_mandatory_protocols (see postconf -d output) โ€” TLS protocols that the Postfix SMTP client will use with mandatory TLS encryption ๐ŸŒˆ
  • smtp_tls_scert_verifydepth (9) โ€” the verification depth for remote SMTP server certificates ๐Ÿง
  • smtp_tls_secure_cert_match (nexthop, dot-nexthop) โ€” how the Postfix SMTP client verifies the server certificate peername for the "secure" TLS security level ๐Ÿ›ก๏ธ
  • smtp_tls_session_cache_database (empty) โ€” name of the file containing the optional Postfix SMTP client TLS session cache ๐Ÿ’พ
  • smtp_tls_session_cache_timeout (3600s) โ€” the expiration time of Postfix SMTP client TLS session cache information โณ
  • smtp_tls_verify_cert_match (hostname) โ€” how the Postfix SMTP client verifies the server certificate peername for the "verify" TLS security level โœ…
  • 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 ๐Ÿ‘‘
  • 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 ๐Ÿซฅ

Available in in Postfix version 2.3..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.4 and later:

  • smtp_sasl_tls_verified_security_options ($smtp_sasl_tls_security_options) โ€” the SASL auth security options that the Postfix SMTP client uses for TLS encrypted SMTP sessions with a verified server certificate ๐Ÿ”

Available in Postfix version 2.5 and later:

  • smtp_tls_fingerprint_cert_match (empty) โ€” list of acceptable remote SMTP server certificate fingerprints for the "fingerprint" TLS security level (smtp_tls_security_level = fingerprint) ๐Ÿซ†
  • smtp_tls_fingerprint_digest (see postconf -d output) โ€” the message digest algorithm used to construct remote SMTP server certificate fingerprints ๐Ÿงฌ

Available in Postfix version 2.6 and later:

  • smtp_tls_protocols (see postconf -d output) โ€” TLS protocols that the Postfix SMTP client will use with opportunistic TLS encryption ๐ŸŒค๏ธ
  • smtp_tls_ciphers (medium) โ€” the minimum TLS cipher grade that the Postfix SMTP client will use with opportunistic TLS encryption ๐Ÿ’…
  • smtp_tls_eccert_file (empty) โ€” file with the Postfix SMTP client ECDSA certificate in PEM format ๐Ÿชช
  • smtp_tls_eckey_file ($smtp_tls_eccert_file) โ€” file with the Postfix SMTP client ECDSA private key in PEM format ๐Ÿ”

Available in Postfix version 2.7 and later:

  • smtp_tls_block_early_mail_reply (no) โ€” try to detect a mail hijacking attack based on a TLS protocol vulnerability (CVE-2009-3555), where an attacker prepends malicious HELO, MAIL, RCPT, DATA commands to a Postfix SMTP client TLS session ๐Ÿ˜ฑ

Available in Postfix version 2.8 and later:

  • tls_disable_workarounds (see postconf -d output) โ€” list or bit-mask of OpenSSL bug work-arounds to disable ๐Ÿ›

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:

  • smtp_tls_trust_anchor_file (empty) โ€” zero or more PEM-format files with trust-anchor certificates and/or public keys ๐Ÿ—‚๏ธ
  • smtp_tls_force_insecure_host_tlsa_lookup (no) โ€” lookup the associated DANE TLSA RRset even when a hostname is not an alias and its address records lie in an unsigned zone ๐Ÿ•ต๏ธ
  • tlsmgr_service_name (tlsmgr) โ€” the name of the tlsmgr(8) service entry in master.cf ๐Ÿ“‹

Available in Postfix version 3.0 and later:

  • smtp_tls_wrappermode (no) โ€” request that the Postfix SMTP client connects using the SUBMISSIONS/SMTPS protocol instead of using the STARTTLS command ๐Ÿ“ฎ

Available in Postfix version 3.1 and later:

  • smtp_tls_dane_insecure_mx_policy (see postconf -d output) โ€” the TLS policy for MX hosts with "secure" TLSA records when the nexthop destination security level is dane, but the MX record was found via an "insecure" MX lookup ๐Ÿค”

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:

  • smtp_tls_connection_reuse (no) โ€” try to make multiple deliveries per TLS-encrypted connection โ™ป๏ธ
  • smtp_tls_chain_files (empty) โ€” list of one or more PEM files, each holding one or more private keys directly followed by a corresponding certificate chain โ›“๏ธ
  • smtp_tls_servername (empty) โ€” optional name to send to the remote SMTP server in the TLS Server Name Indication (SNI) extension ๐Ÿท๏ธ

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 ๐Ÿ˜ด

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 ๐Ÿ›๏ธ

๐ŸŒˆ OBSOLETE STARTTLS CONTROLS ๐ŸŒˆ

ngl bestie these next ones are just here so old configs don't break ๐Ÿ’€ they only exist for compatibility with Postfix versions before 2.3, and support for these will be removed in a future release โš ๏ธ so don't go getting attached, fr fr.

  • smtp_use_tls (no) โ€” 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 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 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 hostname ๐Ÿ—บ๏ธ
  • smtp_tls_cipherlist (empty) โ€” obsolete Postfix < 2.3 control for the Postfix SMTP client TLS cipher list ๐Ÿ•ธ๏ธ

โœจ RESOURCE AND RATE CONTROLS โœจ

okay bestie these are the vibes that decide how long we wait and how much we tolerate before we ghost a server ๐Ÿ’… all of them are timeouts and limits, and yes you need to know every single one.

  • smtp_connect_timeout (default 30s) โ€” the Postfix SMTP client's time limit for actually completing a TCP connection. Or zero, which means "idk just use whatever built-in time limit the operating system has" ๐Ÿซถ
  • smtp_helo_timeout (default 300s) โ€” how long the Postfix SMTP client waits to send the HELO or EHLO command, and to get that very first response back from the remote SMTP server.
  • lmtp_lhlo_timeout (default 300s) โ€” same energy but for the Postfix LMTP client: the time limit for sending LHLO and for receiving the initial remote LMTP server response.
  • smtp_xforward_timeout (default 300s) โ€” the Postfix SMTP client's time limit for sending the XFORWARD command and for receiving the remote SMTP server's response.
  • smtp_mail_timeout (default 300s) โ€” the Postfix SMTP client's time limit for sending MAIL FROM and for receiving the remote SMTP server's response.
  • smtp_rcpt_timeout (default 300s) โ€” the Postfix SMTP client's time limit for sending the SMTP RCPT TO command and for receiving the remote SMTP server's response.
  • smtp_data_init_timeout (default 120s) โ€” the Postfix SMTP client's time limit for sending the SMTP DATA command and for receiving the remote SMTP server's response.
  • smtp_data_xfer_timeout (default 180s) โ€” the Postfix SMTP client's time limit for sending the actual SMTP message content.
  • smtp_data_done_timeout (default 600s) โ€” the Postfix SMTP client's time limit for sending that final SMTP . and for receiving the remote SMTP server's response.
  • smtp_quit_timeout (default 300s) โ€” the Postfix SMTP client's time limit for sending QUIT and for receiving the remote SMTP server's response.

Available in Postfix version 2.1 and later:

  • smtp_mx_address_limit (default 5) โ€” the maximum number of MX (mail exchanger) IP addresses that can come out of Postfix SMTP client mail exchanger lookups. Or zero, which is "no limit bestie, go feral".
  • smtp_mx_session_limit (default 2) โ€” the maximum number of SMTP sessions per delivery request before the Postfix SMTP client gives up or delivers to a fall-back relay host. Or zero, which again means no limit ๐Ÿซถ
  • smtp_rset_timeout (default 20s) โ€” the Postfix SMTP client's time limit for sending the RSET command and for receiving the remote SMTP server's response.

Available in Postfix version 2.2 and earlier:

  • lmtp_cache_connection (default yes) โ€” keep Postfix LMTP client connections open for up to $max_idle seconds.

Available in Postfix version 2.2 and later:

  • smtp_connection_cache_destinations (default empty) โ€” permanently enable SMTP connection caching for the destinations you list here. iconic, permanent, no take-backs โœจ
  • smtp_connection_cache_on_demand (default yes) โ€” temporarily enable SMTP connection caching while a destination has a high volume of mail sitting in the active queue.
  • smtp_connection_reuse_time_limit (default 300s) โ€” how long Postfix will keep reusing a single SMTP connection.
  • smtp_connection_cache_time_limit (default 2s) โ€” when SMTP connection caching is on, how long an unused SMTP client socket gets kept open before it's closed.

Available in Postfix version 2.3 and later:

  • connection_cache_protocol_timeout (default 5s) โ€” the time limit for connection cache connect, send, or receive operations.

Available in Postfix version 2.9 - 3.6:

  • smtp_per_record_deadline (default no) โ€” this one changes how the smtp_*_timeout time limits behave. Instead of a time limit per read or write system call, it becomes a time limit to send or receive a complete record โ€” that's an SMTP command line, SMTP response line, SMTP message content line, or TLS protocol message. whole record, one deadline, periodt ๐Ÿ’…

Available in Postfix version 2.11 and later:

  • smtp_connection_reuse_count_limit (default 0) โ€” when SMTP connection caching is enabled, how many times an SMTP session may be reused before it gets closed. Or zero, which is โ€” you guessed it โ€” no limit.

Available in Postfix version 3.4 and later:

  • smtp_tls_connection_reuse (default no) โ€” try to make multiple deliveries per TLS-encrypted connection. efficient queen behavior ๐Ÿ”ฅ

Available in Postfix version 3.7 and later:

  • smtp_per_request_deadline (default no) โ€” changes the behavior of the smtp_*_timeout time limits again, bestie. Instead of a time limit per plaintext or TLS read or write call, it becomes a combined time limit for sending a complete SMTP request and for receiving a complete SMTP response.
  • smtp_min_data_rate (default 500) โ€” the minimum plaintext data transfer rate in bytes/second for DATA requests, when deadlines are enabled with smtp_per_request_deadline.

Implemented in the qmgr(8) daemon:

  • transport_destination_concurrency_limit (default $default_destination_concurrency_limit) โ€” a transport-specific override for the default_destination_concurrency_limit parameter value, where transport is the master.cf name of the message delivery transport.
  • transport_destination_recipient_limit (default $default_destination_recipient_limit) โ€” a transport-specific override for the default_destination_recipient_limit parameter value, where transport is the master.cf name of the message delivery transport.

๐ŸŒˆ SMTPUTF8 CONTROLS ๐ŸŒˆ

preliminary SMTPUTF8 support made its debut with Postfix 3.0, and we've been unicode-pilled ever since ๐Ÿฆ‹

  • smtputf8_enable (default yes) โ€” enable preliminary SMTPUTF8 support for the protocols described in RFC 6531, RFC 6532, and RFC 6533.
  • smtputf8_autodetect_classes (default sendmail, verify) โ€” detect that a message requires SMTPUTF8 support for the specified mail origin classes.

Available in Postfix version 3.2 and later:

  • enable_idna2003_compatibility (default no) โ€” enable 'transitional' compatibility between IDNA2003 and IDNA2008, when converting UTF-8 domain names to and from the ASCII form that's used for DNS lookups.

๐Ÿ’€ TROUBLE SHOOTING CONTROLS ๐Ÿ’€

when things are lowkey falling apart, these are the knobs you turn ๐ŸŽ€

  • debug_peer_level (default 2) โ€” the increment in verbose logging level when a nexthop destination, remote client or server name, or network address matches a pattern given with the debug_peer_list parameter.
  • debug_peer_list (default empty) โ€” an 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 (default postmaster) โ€” the recipient of postmaster notifications about mail delivery problems that are caused by policy, resource, software, or protocol errors.
  • internal_mail_filter_classes (default empty) โ€” what categories of Postfix-generated mail are subject to before-queue content inspection by non_smtpd_milters, header_checks and body_checks.
  • notify_classes (default resource, software) โ€” the list of error classes that get reported to the postmaster.

๐ŸŽ€ MISCELLANEOUS CONTROLS ๐ŸŽ€

okay bestie this is the โœจrandom grab bagโœจ section, but every single one of these matters so we're going through ALL of them, no skipping, periodt ๐Ÿ’…

  • best_mx_transport (empty) โ€” the transport where the Postfix SMTP client should drop off mail when it catches that "mail loops back to myself" error condition ๐Ÿ˜ญ like when it's giving ouroboros
  • config_directory (see postconf -d output) โ€” where your main.cf and master.cf configuration files live by default ๐Ÿ 
  • daemon_timeout (18000s) โ€” how long a Postfix daemon process gets to handle a request before a built-in watchdog timer is like "nope, we're done here" and terminates it โฐ
  • delay_logging_resolution_limit (2) โ€” the max number of digits after the decimal point when logging sub-second delay values ๐Ÿ”ข
  • disable_dns_lookups (no) โ€” turn off DNS lookups in the Postfix SMTP and LMTP clients ๐Ÿ™ˆ
  • inet_interfaces (all) โ€” the local network interface addresses this mail system receives mail on ๐ŸŒ
  • inet_protocols (see postconf -d output) โ€” the Internet protocols Postfix will try to use when making or accepting connections ๐Ÿ›ฐ๏ธ
  • ipc_timeout (3600s) โ€” the time limit for sending or receiving info over an internal communication channel โŒ›
  • lmtp_assume_final (no) โ€” when a remote LMTP server announces it has no DSN support, assume it does final delivery, and send "delivered" delivery status notifications instead of "relayed" ๐Ÿ“ฌ
  • lmtp_tcp_port (24) โ€” the default TCP port the Postfix LMTP client connects to ๐Ÿ”Œ
  • max_idle (100s) โ€” the max time an idle Postfix daemon process waits for an incoming connection before it just terminates voluntarily, main character exit ๐Ÿšช
  • max_use (100) โ€” the max number of incoming connections a Postfix daemon process will service before terminating voluntarily ๐Ÿ”„
  • 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 ๐Ÿท๏ธ
  • proxy_interfaces (empty) โ€” the remote network interface addresses this mail system receives mail on by way of a proxy or network address translation 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 addresses with equal MX preference โš–๏ธ
  • smtp_bind_address (empty) โ€” 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 client should bind to when making an IPv6 connection ๐Ÿ“
  • smtp_helo_name ($myhostname) โ€” the hostname to send in the SMTP HELO or EHLO command ๐Ÿ‘‹
  • lmtp_lhlo_name ($myhostname) โ€” the hostname to send in the LMTP LHLO command ๐Ÿ‘‹
  • smtp_host_lookup (dns) โ€” what mechanisms the Postfix SMTP client uses to look up a host's IP address ๐Ÿ”
  • smtp_randomize_addresses (yes) โ€” randomize the order of equal-preference MX host addresses ๐Ÿ”€
  • 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 with Postfix 2.2 and earlier:

  • fallback_relay (empty) โ€” optional list of relay hosts for SMTP destinations that can't be found or that are unreachable ๐Ÿ†˜

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 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 stage that determines whether an email address is deliverable โœ…

Available with Postfix 3.1 and later:

  • lmtp_fallback_relay (empty) โ€” optional list of relay hosts for LMTP destinations that can't be found or that are unreachable ๐Ÿ†˜

Available with Postfix 3.2 and later:

  • smtp_tcp_port (smtp) โ€” the default TCP port that the Postfix SMTP client connects to ๐Ÿ”Œ

Available in Postfix 3.3 and later:

  • service_name (read-only) โ€” the master.cf service name of a Postfix daemon process ๐Ÿท๏ธ

Available in Postfix 3.7 and later:

  • smtp_bind_address_enforce (no) โ€” defer delivery when the Postfix SMTP client cannot apply the smtp_bind_address or smtp_bind_address6 setting ๐Ÿšซ

๐ŸŒธ SEE ALSO ๐ŸŒธ

bestie here's the reading list, it's giving syllabus ๐Ÿ“š


๐Ÿ“– README FILES ๐Ÿ“–

use postconf readme_directory or postconf html_directory to locate this info, fr fr ๐Ÿ”Ž

  • SASL_README, Postfix SASL howto
  • TLS_README, Postfix STARTTLS howto

โš–๏ธ LICENSE โš–๏ธ

The Secure Mailer license must be distributed with this software. no cap, it's required ๐Ÿ’ฏ


๐Ÿ‘‘ AUTHOR(S) ๐Ÿ‘‘

okay so these are the legends who built this, show some respect ๐Ÿ’œ

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

Command pipelining in cooperation with: Jon Ribbens Oaktree Internet Solutions Ltd., Internet House, Canal Basin, Coventry, CV1 4LY, United Kingdom.

SASL support originally by: Till Franke SuSE Rhein/Main AG 65760 Eschborn, Germany

TLS support originally by: Lutz Jaenicke BTU Cottbus Allgemeine Elektrotechnik Universitaetsplatz 3-4 D-03044 Cottbus, Germany

Revised TLS and SMTP connection cache support by: Victor Duchovni Morgan Stanley


and that's a wrap on the whole SMTP(8postfix) page bestie!! ๐Ÿซถโœจ this is the Postfix version of the manpage, dated at the bottom of the original as SMTP(8postfix) ๐Ÿ’… you ate this whole read, go hydrate ๐ŸŒธ๐Ÿ’–

๐Ÿ“ฆ where this page comes from