SMTP(8postfix)
โจ 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:
domainnamedomainname: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 specifiedpathname. if the process runs chrooted, an absolute pathname is interpreted relative to the Postfix queue directory. (chroot says "your/is not my `/", iykyk)inet:hostnameinet:hostname:portinet:[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 aslmtpinservices(4). if no such service is found, thelmtp_tcp_portconfiguration parameter gets used instead (default value of24). 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, thetransport_destination_recipient_limitmust be1(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, thetransport_destination_recipient_limitmust be1(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
- RFC 821 (SMTP protocol)
- RFC 822 (ARPA Internet Text Messages)
- RFC 1651 (SMTP service extensions)
- RFC 1652 (8bit-MIME transport)
- RFC 1870 (Message Size Declaration)
- RFC 2033 (LMTP protocol)
- RFC 2034 (SMTP Enhanced Error Codes)
- RFC 2045 (MIME: Format of Internet Message Bodies)
- RFC 2046 (MIME: Media Types)
- RFC 2554 (AUTH command)
- RFC 2821 (SMTP protocol)
- RFC 2782 (SRV resource records)
- RFC 2920 (SMTP Pipelining)
- RFC 3207 (STARTTLS command)
- RFC 3461 (SMTP DSN Extension)
- RFC 3463 (Enhanced Status Codes)
- RFC 4954 (AUTH command)
- RFC 5321 (SMTP protocol)
- RFC 6531 (Internationalized SMTP)
- RFC 6533 (Internationalized Delivery Status Notifications)
- RFC 7672 (SMTP security via opportunistic DANE TLS)
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 withsmtp fixupmode 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 clientMAIL FROMandRCPT TOcommands 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 SMTPQUITcommand. 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 settingnomeans: 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) โ restrictedheader_checks(5)tables for the Postfix SMTP client.smtp_mime_header_checks(empty) โ restrictedmime_header_checks(5)tables for the Postfix SMTP client.smtp_nested_header_checks(empty) โ restrictednested_header_checks(5)tables for the Postfix SMTP client.smtp_body_checks(empty) โ restrictedbody_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 thesmtp_*_timeouttime 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 theMAIL FROMcommand 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 thesmtp(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 thesmtp_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 theservices(5)database. Fewer lookups, faster vibes โก
Available in Postfix version 3.7 and later:
smtp_per_request_deadline(no) โ changes how thesmtp_*_timeouttime 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 forDATArequests, when deadlines are enabled withsmtp_per_request_deadline.header_from_format(standard) โ the format of the Postfix-generatedFrom: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 of8BITMIMEformat to7BITformat. 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-standardXFORWARDcommand when the Postfix SMTP server EHLO response announcesXFORWARDsupport.
๐ 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 oneusername:passwordentry 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 withsmtp_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 withsmtp_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 ansmtp_sasl_auth_cache_nameentry before it is removed.smtp_sasl_auth_soft_bounce(yes) โ when a remote SMTP server rejects a SASL authentication request with a535reply 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 theMAIL FROMcommand 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 obsoletesmtp_tls_per_siteparameter โจsmtp_tls_mandatory_protocols(seepostconf -doutput) โ 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 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 ๐ซฅ
Available in in Postfix version 2.3..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.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(seepostconf -doutput) โ the message digest algorithm used to construct remote SMTP server certificate fingerprints ๐งฌ
Available in Postfix version 2.6 and later:
smtp_tls_protocols(seepostconf -doutput) โ 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 maliciousHELO,MAIL,RCPT,DATAcommands to a Postfix SMTP client TLS session ๐ฑ
Available in Postfix version 2.8 and later:
tls_disable_workarounds(seepostconf -doutput) โ 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 thetlsmgr(8)service entry inmaster.cf๐
Available in Postfix version 3.0 and later:
smtp_tls_wrappermode(no) โ request that the Postfix SMTP client connects using theSUBMISSIONS/SMTPSprotocol instead of using theSTARTTLScommand ๐ฎ
Available in Postfix version 3.1 and later:
smtp_tls_dane_insecure_mx_policy(seepostconf -doutput) โ the TLS policy for MX hosts with"secure"TLSA records when the nexthop destination security level isdane, but the MX record was found via an"insecure"MX lookup ๐ค
Available in Postfix version 3.2 and later:
tls_eecdh_auto_curves(seepostconf -doutput) โ 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(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 ๐๏ธ
๐ 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(default30s) โ 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(default300s) โ how long the Postfix SMTP client waits to send theHELOorEHLOcommand, and to get that very first response back from the remote SMTP server.lmtp_lhlo_timeout(default300s) โ same energy but for the Postfix LMTP client: the time limit for sendingLHLOand for receiving the initial remote LMTP server response.smtp_xforward_timeout(default300s) โ the Postfix SMTP client's time limit for sending theXFORWARDcommand and for receiving the remote SMTP server's response.smtp_mail_timeout(default300s) โ the Postfix SMTP client's time limit for sendingMAIL FROMand for receiving the remote SMTP server's response.smtp_rcpt_timeout(default300s) โ the Postfix SMTP client's time limit for sending the SMTPRCPT TOcommand and for receiving the remote SMTP server's response.smtp_data_init_timeout(default120s) โ the Postfix SMTP client's time limit for sending the SMTPDATAcommand and for receiving the remote SMTP server's response.smtp_data_xfer_timeout(default180s) โ the Postfix SMTP client's time limit for sending the actual SMTP message content.smtp_data_done_timeout(default600s) โ the Postfix SMTP client's time limit for sending that final SMTP.and for receiving the remote SMTP server's response.smtp_quit_timeout(default300s) โ the Postfix SMTP client's time limit for sendingQUITand for receiving the remote SMTP server's response.
Available in Postfix version 2.1 and later:
smtp_mx_address_limit(default5) โ 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(default2) โ 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(default20s) โ the Postfix SMTP client's time limit for sending theRSETcommand and for receiving the remote SMTP server's response.
Available in Postfix version 2.2 and earlier:
lmtp_cache_connection(defaultyes) โ keep Postfix LMTP client connections open for up to$max_idleseconds.
Available in Postfix version 2.2 and later:
smtp_connection_cache_destinations(defaultempty) โ permanently enable SMTP connection caching for the destinations you list here. iconic, permanent, no take-backs โจsmtp_connection_cache_on_demand(defaultyes) โ temporarily enable SMTP connection caching while a destination has a high volume of mail sitting in the active queue.smtp_connection_reuse_time_limit(default300s) โ how long Postfix will keep reusing a single SMTP connection.smtp_connection_cache_time_limit(default2s) โ 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(default5s) โ the time limit for connection cache connect, send, or receive operations.
Available in Postfix version 2.9 - 3.6:
smtp_per_record_deadline(defaultno) โ this one changes how thesmtp_*_timeouttime 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(default0) โ 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(defaultno) โ try to make multiple deliveries per TLS-encrypted connection. efficient queen behavior ๐ฅ
Available in Postfix version 3.7 and later:
smtp_per_request_deadline(defaultno) โ changes the behavior of thesmtp_*_timeouttime 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(default500) โ the minimum plaintext data transfer rate in bytes/second forDATArequests, when deadlines are enabled withsmtp_per_request_deadline.
Implemented in the qmgr(8) daemon:
transport_destination_concurrency_limit(default$default_destination_concurrency_limit) โ a transport-specific override for thedefault_destination_concurrency_limitparameter value, where transport is themaster.cfname of the message delivery transport.transport_destination_recipient_limit(default$default_destination_recipient_limit) โ a transport-specific override for thedefault_destination_recipient_limitparameter value, where transport is themaster.cfname 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(defaultyes) โ enable preliminary SMTPUTF8 support for the protocols described in RFC 6531, RFC 6532, and RFC 6533.smtputf8_autodetect_classes(defaultsendmail, 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(defaultno) โ 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(default2) โ the increment in verbose logging level when a nexthop destination, remote client or server name, or network address matches a pattern given with thedebug_peer_listparameter.debug_peer_list(defaultempty) โ 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(defaultpostmaster) โ the recipient of postmaster notifications about mail delivery problems that are caused by policy, resource, software, or protocol errors.internal_mail_filter_classes(defaultempty) โ what categories of Postfix-generated mail are subject to before-queue content inspection bynon_smtpd_milters,header_checksandbody_checks.notify_classes(defaultresource, 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 ouroborosconfig_directory(seepostconf -doutput) โ where yourmain.cfandmaster.cfconfiguration 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(seepostconf -doutput) โ 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 SMTPHELOorEHLOcommand ๐lmtp_lhlo_name($myhostname) โ the hostname to send in the LMTPLHLOcommand ๐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(seepostconf -doutput) โ 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) โ themaster.cfservice 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 thesmtp_bind_addressorsmtp_bind_address6setting ๐ซ
๐ธ SEE ALSO ๐ธ
bestie here's the reading list, it's giving syllabus ๐
generic(5), output address rewritingheader_checks(5), message header content inspectionbody_checks(5), body parts content inspectionqmgr(8), queue managerbounce(8), delivery status reportsscache(8), connection cache serverpostconf(5), configuration parametersmaster(5), generic daemon optionsmaster(8), process managertlsmgr(8), TLS session and PRNG managementpostlogd(8), Postfix loggingsyslogd(8), system logging
๐ README FILES ๐
use postconf readme_directory or postconf html_directory to locate this info, fr fr ๐
SASL_README, Postfix SASL howtoTLS_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
- ubuntu noble: postfix 3.8.6-1build2
- ubuntu noble: postfix 3.8.6-1ubuntu0.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms