POSTSCREEN(8postfix)
π POSTSCREEN π
okay bestie, so this is postscreen(8) from the Postfix fam β the zombie blocker. it's a manual page, it's long, it's giving "I read the whole thing so you don't have to." let's go π§
β¨ NAME β¨
postscreen β Postfix zombie blocker π§π«
πΈ SYNOPSIS πΈ
postscreen [generic Postfix daemon options]
π¦ DESCRIPTION π¦
so the Postfix postscreen(8) server is basically extra armor against mail server overload. one postscreen(8) process handles multiple inbound SMTP connections, and it decides which clients are even allowed to talk to a Postfix SMTP server process. by keeping the spambots away, postscreen(8) leaves more SMTP server processes free for the legit clients, and it delays the whole "server is overloaded" era from starting. queen behavior honestly π
heads up: this program should not be used on SMTP ports that receive mail from end-user clients (MUAs). not the vibe.
in a typical deployment, postscreen(8) handles the MX service on TCP port 25, and smtpd(8) receives mail from MUAs on the submission service (TCP port 587) which requires client authentication. alternatively, a site could set up a dedicated, non-postscreen, "port 25" server that provides submission service and client authentication, but no MX service. options, we love options π
postscreen(8) maintains a temporary allowlist for clients that have passed a number of tests. when an SMTP client IP address is allowlisted, postscreen(8) hands off the connection immediately to a Postfix SMTP server process. this minimizes the overhead for legitimate mail. iconic efficiency β¨
by default, postscreen(8) logs statistics and hands off each connection to a Postfix SMTP server process, while excluding clients in mynetworks from all tests (primarily, to avoid problems with non-standard SMTP implementations in network appliances). this default mode blocks no clients, and is useful for non-destructive testing. no cap, it's the "practice run" mode π
in a typical production setting, postscreen(8) is configured to reject mail from clients that fail one or more tests. postscreen(8) logs rejected mail with the client address, helo, sender and recipient information. receipts, but for rejections π
postscreen(8) is not an SMTP proxy; this is intentional. the purpose is to keep spambots away from Postfix SMTP server processes, while minimizing overhead for legitimate traffic. it's a bouncer, not a mail carrier πͺ
π SECURITY π
the postscreen(8) server is moderately security-sensitive. it talks to untrusted clients on the network. the process can be run chrooted at fixed low privilege. stay safe out there π«Ά
π STANDARDS π
- RFC 821 (SMTP protocol)
- RFC 1123 (Host requirements)
- RFC 1652 (8bit-MIME transport)
- RFC 1869 (SMTP service extensions)
- RFC 1870 (Message Size Declaration)
- RFC 1985 (ETRN command)
- RFC 2034 (SMTP Enhanced Status Codes)
- RFC 2821 (SMTP protocol)
- Not: RFC 2920 (SMTP Pipelining)
- RFC 3030 (CHUNKING without BINARYMIME)
- RFC 3207 (STARTTLS command)
- RFC 3461 (SMTP DSN Extension)
- RFC 3463 (Enhanced Status Codes)
- RFC 5321 (SMTP protocol, including multi-line 220 banners)
π©Ί DIAGNOSTICS π©Ί
problems and transactions are logged to syslogd(8) or postlogd(8). it tells on everything, respectfully π
π BUGS π
the postscreen(8) built-in SMTP protocol engine currently does not announce support for AUTH, XCLIENT or XFORWARD. so if you need to make these services available on port 25, then do not enable the optional "after 220 server greeting" tests. pick a lane bestie π
the optional "after 220 server greeting" tests may result in unexpected delivery delays from senders that retry email delivery from a different IP address. reason: after passing these tests a new client must disconnect, and reconnect from the same IP address before it can deliver mail. see POSTSCREEN_README, section "Tests after the 220 SMTP server greeting", for a discussion. it's giving "you may not pass go" π²
βοΈ CONFIGURATION PARAMETERS βοΈ
changes to main.cf are not picked up automatically, as postscreen(8) processes may run for several hours. use the command postfix reload after a configuration change. yes you have to reload, no you can't skip it π
the text below provides only a parameter summary. see postconf(5) for more details including examples.
NOTE: somepostscreen(8)parameters implement stress-dependent behavior. this is supported only when the default parameter value is stress-dependent (that is, it looks like${stress?{X}:{Y}}, or it is the$nameof an smtpd parameter with a stress-dependent default). other parameters always evaluate as if the stress parameter value is the empty string. read that twice, it matters π
π COMPATIBILITY CONTROLS π
postscreen_command_filter($smtpd_command_filter) β a mechanism to transform commands from remote SMTP clients.postscreen_discard_ehlo_keyword_address_maps($smtpd_discard_ehlo_keyword_address_maps) β lookup tables, indexed by the remote SMTP client address, with case insensitive lists of EHLO keywords (pipelining,starttls,auth, etc.) that thepostscreen(8)server will not send in the EHLO response to a remote SMTP client.postscreen_discard_ehlo_keywords($smtpd_discard_ehlo_keywords) β a case insensitive list of EHLO keywords (pipelining,starttls,auth, etc.) that thepostscreen(8)server will not send in the EHLO response to a remote SMTP client.
Available in Postfix version 3.1 and later:
dns_ncache_ttl_fix_enable(no) β enable a workaround for future libc incompatibility.
Available in Postfix version 3.4 and later:
postscreen_reject_footer_maps($smtpd_reject_footer_maps) β optional lookup table for information that is appended after a 4XX or 5XXpostscreen(8)server response.
Available in Postfix 3.6 and later:
respectful_logging(seepostconf -doutput) β avoid logging that implies white is better than black. π«Ά
π§ TROUBLE SHOOTING CONTROLS π§
postscreen_expansion_filter(seepostconf -doutput) β list of characters that are permitted inpostscreen_reject_footerattribute expansions.postscreen_reject_footer($smtpd_reject_footer) β optional information that is appended after a 4XX or 5XXpostscreen(8)server response.soft_bounce(no) β safety net to keep mail queued that would otherwise be returned to the sender.
π§ BEFORE-POSTSCREEN PROXY AGENT π§
Available in Postfix version 2.10 and later:
postscreen_upstream_proxy_protocol(empty) β the name of the proxy protocol used by an optional before-postscreen proxy agent.postscreen_upstream_proxy_timeout(5s) β the time limit for the proxy protocol specified with thepostscreen_upstream_proxy_protocolparameter.
π PERMANENT ALLOW/DENYLIST TEST π
this test is executed immediately after a remote SMTP client connects. if a client is permanently allowlisted, the client will be handed off immediately to a Postfix SMTP server process. fast pass, no queue π
postscreen_access_list(permit_mynetworks) β permanent allow/denylist for remote SMTP client IP addresses.postscreen_blacklist_action(ignore) β renamed topostscreen_denylist_actionin Postfix 3.6.
π’ MAIL EXCHANGER POLICY TESTS π’
when postscreen(8) is configured to monitor all primary and backup MX addresses, it can refuse to allowlist clients that connect to a backup MX address only. for small sites, this requires configuring primary and backup MX addresses on the same MTA. larger sites would have to share the postscreen(8) cache between primary and backup MTAs, which would introduce a common point of failure. sharing is caring but also risky, apparently π
postscreen_allowlist_interfaces(static:all) β a list of localpostscreen(8)server IP addresses where a non-allowlisted remote SMTP client can obtainpostscreen(8)'s temporary allowlist status.
β° BEFORE 220 GREETING TESTS β°
these tests are executed before the remote SMTP client receives the "220 servername" greeting. if no tests remain after the successful completion of this phase, the client will be handed off immediately to a Postfix SMTP server process. bye, you passed, go through β¨
dnsblog_service_name(dnsblog) β the name of thednsblog(8)service entry inmaster.cf.postscreen_dnsbl_action(ignore) β the action thatpostscreen(8)takes when a remote SMTP client's combined DNSBL score is equal to or greater than a threshold (as defined with thepostscreen_dnsbl_sitesandpostscreen_dnsbl_thresholdparameters).postscreen_dnsbl_reply_map(empty) β a mapping from an actual DNSBL domain name which includes a secret password, to the DNSBL domain name that postscreen will reply with when it rejects mail.postscreen_dnsbl_sites(empty) β optional list of patterns with DNS allow/denylist domains, filters and weight factors.postscreen_dnsbl_threshold(1) β the inclusive lower bound for blocking a remote SMTP client, based on its combined DNSBL score as defined with thepostscreen_dnsbl_sitesparameter.postscreen_greet_action(ignore) β the action thatpostscreen(8)takes when a remote SMTP client speaks before its turn within the time specified with thepostscreen_greet_waitparameter.postscreen_greet_banner($smtpd_banner) β the text in the optional "220-text..." server response thatpostscreen(8)sends ahead of the real Postfix SMTP server's "220 text..." response, in an attempt to confuse bad SMTP clients so that they speak before their turn (pre-greet). chaotic, but on purpose πpostscreen_greet_wait(normal: 6s, overload: 2s) β the amount of time thatpostscreen(8)will wait for an SMTP client to send a command before its turn, and for DNS blocklist lookup results to arrive (default: up to 2 seconds under stress, up to 6 seconds otherwise).smtpd_service_name(smtpd) β the internal service thatpostscreen(8)hands off allowed connections to.
Available in Postfix version 2.11 and later:
postscreen_dnsbl_whitelist_threshold(0) β renamed topostscreen_dnsbl_allowlist_thresholdin Postfix 3.6.
Available in Postfix version 3.0 and later:
postscreen_dnsbl_timeout(10s) β the time limit for DNSBL or DNSWL lookups.
Available in Postfix version 3.6 and later:
postscreen_denylist_action(ignore) β the action thatpostscreen(8)takes when a remote SMTP client is permanently denylisted with thepostscreen_access_listparameter.postscreen_allowlist_interfaces(static:all) β a list of localpostscreen(8)server IP addresses where a non-allowlisted remote SMTP client can obtainpostscreen(8)'s temporary allowlist status.postscreen_dnsbl_allowlist_threshold(0) β allow a remote SMTP client to skip "before" and "after 220 greeting" protocol tests, based on its combined DNSBL score as defined with thepostscreen_dnsbl_sitesparameter.
part 1 done, and there's more coming bestie β don't go anywhere π
β¨ AFTER 220 GREETING TESTS β¨
okay so these tests? they run after the remote SMTP client already got the "220 servername" greeting π If a client manages to pass every single test in this phase, it gets a 4XX response to all RCPT TO commands. then after the client reconnects, it's allowed to talk directly to a real Postfix SMTP server process. iconic behavior tbh π
postscreen_bare_newline_action(default:ignore) β the action thatpostscreen(8)takes when a remote SMTP client sends a bare newline character, meaning a newline that is not preceded by a carriage return. bestie that's just rude πpostscreen_bare_newline_enable(default:no) β turn on the"bare newline"SMTP protocol tests inside thepostscreen(8)server.postscreen_disable_vrfy_command(default:$disable_vrfy_command) β disables the SMTPVRFYcommand in thepostscreen(8)daemon.postscreen_forbidden_commands(default:$smtpd_forbidden_commands) β the list of commands that thepostscreen(8)server considers a violation of the SMTP protocol. π«postscreen_helo_required(default:$smtpd_helo_required) β requires that a remote SMTP client sendsHELOorEHLObefore it starts aMAILtransaction. no skipping the intros, we're not animals β¨postscreen_non_smtp_command_action(default:drop) β the actionpostscreen(8)takes when a remote SMTP client sends non-SMTP commands, as specified with thepostscreen_forbidden_commandsparameter.postscreen_non_smtp_command_enable(default:no) β turn on the"non-SMTP command"tests in thepostscreen(8)server.postscreen_pipelining_action(default:enforce) β the actionpostscreen(8)takes when a remote SMTP client sends multiple commands instead of sending one command and waiting for the server to respond. patience is a virtue, bestie πpostscreen_pipelining_enable(default:no) β turn on the"pipelining"SMTP protocol tests in thepostscreen(8)server.
π CACHE CONTROLS π
postscreen_cache_cleanup_interval(default:12h) β how much time passes betweenpostscreen(8)cache cleanup runs. self-care for your cache πpostscreen_cache_map(default:btree:$data_directory/postscreen_cache) β the persistent storage where thepostscreen(8)server keeps its decisions.postscreen_cache_retention_time(default:7d) β how longpostscreen(8)will cache an expired temporary allowlist entry before it finally gets removed.postscreen_bare_newline_ttl(default:30d) β how longpostscreen(8)will use the result from a successful"bare newline"SMTP protocol test.postscreen_dnsbl_max_ttl(default:${postscreen_dnsbl_ttl?{$postscreen_dnsbl_ttl}:{1}}h) β the maximum amount of time thatpostscreen(8)will use the result from a successful DNS-based reputation test before a client IP address has to pass that test all over again.postscreen_dnsbl_min_ttl(default:60s) β the minimum amount of time thatpostscreen(8)will use the result from a successful DNS-based reputation test before a client IP address has to pass that test again.postscreen_greet_ttl(default:1d) β how longpostscreen(8)will use the result from a successfulPREGREETtest.postscreen_non_smtp_command_ttl(default:30d) β how longpostscreen(8)will use the result from a successful"non_smtp_command"SMTP protocol test.postscreen_pipelining_ttl(default:30d) β how longpostscreen(8)will use the result from a successful"pipelining"SMTP protocol test.
π RESOURCE CONTROLS π
line_length_limit(default:2048) β on input, long lines get chopped up into pieces of at most this length; on delivery, long lines get reconstructed. βοΈpostscreen_client_connection_count_limit(default:$smtpd_client_connection_count_limit) β how many simultaneous connections any remote SMTP client is allowed to have with thepostscreen(8)daemon.postscreen_command_count_limit(default:20) β the limit on the total number of commands per SMTP session forpostscreen(8)'s built-in SMTP protocol engine.postscreen_command_time_limit(default:normal: 300s, overload: 10s) β the time limit for reading an entire command line withpostscreen(8)'s built-in SMTP protocol engine.postscreen_post_queue_limit(default:$default_process_limit) β the number of clients that can be waiting for service from a real Postfix SMTP server process.postscreen_pre_queue_limit(default:$default_process_limit) β the number of non-allowlisted clients that can be waiting for a decision on whether they'll receive service from a real Postfix SMTP server process.postscreen_watchdog_timeout(default:10s) β how much time apostscreen(8)process may take to respond to a remote SMTP client command, or to perform a cache operation, before a built-in watchdog timer terminates it. β° rude but necessary
π STARTTLS CONTROLS π
postscreen_tls_security_level(default:$smtpd_tls_security_level) β the SMTP TLS security level for thepostscreen(8)server; when a non-empty value is specified, this overrides the obsolete parameterspostscreen_use_tlsandpostscreen_enforce_tls.tlsproxy_service_name(default:tlsproxy) β the name of thetlsproxy(8)service entry inmaster.cf.
π OBSOLETE STARTTLS SUPPORT CONTROLS π
these parameters are supported for compatibility with smtpd(8) legacy parameters. old but we keep them around, yk how it is π
postscreen_use_tls(default:$smtpd_use_tls) β opportunistic TLS: announceSTARTTLSsupport to remote SMTP clients, but do not require that clients use TLS encryption.postscreen_enforce_tls(default:$smtpd_enforce_tls) β mandatory TLS: announceSTARTTLSsupport to remote SMTP clients, and require that clients use TLS encryption.
π MISCELLANEOUS CONTROLS π
config_directory(default:see 'postconf -d' output) β the default location of the Postfixmain.cfandmaster.cfconfiguration files.delay_logging_resolution_limit(default:2) β the maximal number of digits after the decimal point when logging sub-second delay values.command_directory(default:see 'postconf -d' output) β the location of all postfix administrative commands.max_idle(default:100s) β the maximum amount of time that an idle Postfix daemon process waits for an incoming connection before terminating voluntarily. it's giving "i'm heading out, love u" π¦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(default:mail) β the syslog facility of Postfix logging.syslog_name(default:see 'postconf -d' output) β a prefix that's prepended to the process name in syslog records, so that, for example,"smtpd"becomes"prefix/smtpd".
Available in Postfix 3.3 and later:
service_name(read-only) β themaster.cfservice name of a Postfix daemon process.
Available in Postfix 3.5 and later:
info_log_address_format(default:external) β the email address form that will be used in non-debug logging (info, warning, etc.).
π¦ SEE ALSO π¦
smtpd(8), Postfix SMTP servertlsproxy(8), Postfix TLS proxy serverdnsblog(8), DNS allow/denylist loggerpostlogd(8), Postfix loggingsyslogd(8), system logging
π README FILES π
use "postconf readme_directory" or "postconf html_directory" to locate this information.
POSTSCREEN_README, Postfix Postscreen Howto
π LICENSE π
The Secure Mailer license must be distributed with this software.
πΈ HISTORY πΈ
This service was introduced with Postfix version 2.8.
Many ideas in postscreen(8) were explored in earlier work by Michael Tokarev, in OpenBSD spamd, and in MailChannels Traffic Control. giving credit where credit is due, we love to see it π
π 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
okay bestie that's a wrap on POSTSCREEN(8postfix) πβ¨ this page comes from the Postfix source tree and carries its own version/date stamp in the footer down there β you know the vibe, iykyk π go forth and filter those zombies, you absolute icon ππ¦
π¦ 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