POSTSCREEN(8)
๐ postscreen(8) ๐
okay bestie, welcome to the System Manager's Manual page for postscreen โ the Postfix zombie blocker ๐งโโ๏ธ๐ซ (yes that's literally what the NAME section says and no I'm not being dramatic, it's in the docs)
โจ NAME โจ
postscreen โ Postfix zombie blocker ๐
โจ SYNOPSIS โจ
postscreen [generic Postfix daemon options]
โจ DESCRIPTION โจ
so the tea is: the Postfix postscreen(8) server gives you extra protection against mail server overload. One single postscreen(8) process handles a whole bunch of inbound SMTP connections at once, 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 legitimate clients, and it delays the onset of server overload conditions. iconic behavior honestly ๐ซถ
โ ๏ธ do NOT use this program on SMTP ports that receive mail from end-user clients (MUAs). 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.
postscreen(8) maintains a temporary allowlist for clients that have passed a number of tests. When an SMTP client IP address gets allowlisted, postscreen(8) hands off the connection immediately to a Postfix SMTP server process. This minimizes the overhead for legitimate mail. slay โจ
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 it's useful for non-destructive testing. lowkey the safe mode, love that for us ๐ธ
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, basically ๐
postscreen(8) is not an SMTP proxy โ and this is intentional. The purpose is to keep spambots away from Postfix SMTP server processes, while minimizing overhead for legitimate traffic. periodt.
๐ก๏ธ 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. ๐ซถ
๐ 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). if something's wrong bestie, it WILL tell you ๐
๐ BUGS ๐
The postscreen(8) built-in SMTP protocol engine currently does not announce support for AUTH, XCLIENT or XFORWARD. If you need to make these services available on port 25, then do not enable the optional "after 220 server greeting" tests. ๐
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. ๐ญ
โ๏ธ CONFIGURATION PARAMETERS โ๏ธ
Changes to main.cf are not picked up automatically, because postscreen(8) processes may run for several hours. Use the command postfix reload after a configuration change. fr fr, don't forget the reload ๐
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 ansmtpdparameter with a stress-dependent default). Other parameters always evaluate as if the stress parameter value is the empty string. ๐ง
๐ซ COMPATIBILITY CONTROLS ๐ซ
postscreen_command_filter($smtpd_command_filter) โ a whole 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. โก
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. ๐
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. โจ
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). chaos as a strategy, obsessed ๐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. โจ
๐ AFTER 220 GREETING TESTS โจ
okay so these tests happen after the remote SMTP client has already received its "220 servername" greeting. If a client passes every test in this phase, it will get a 4XX response to all RCPT TO commands โ and then, when it reconnects, it's allowed to talk directly to a real Postfix SMTP server process. glow-up arc fr. ๐
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. ๐postscreen_bare_newline_enable(default:no) โ turns on the "bare newline" SMTP protocol tests in thepostscreen(8)server. โจpostscreen_disable_vrfy_command(default:$disable_vrfy_command) โ disables the SMTPVRFYcommand in thepostscreen(8)daemon. not today,VRFY. ๐postscreen_forbidden_commands(default:$smtpd_forbidden_commands) โ the list of commands that thepostscreen(8)server considers to be in 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 intro, bestie. ๐ซถpostscreen_non_smtp_command_action(default:drop) โ the action thatpostscreen(8)takes when a remote SMTP client sends non-SMTP commands as specified with thepostscreen_forbidden_commandsparameter.postscreen_non_smtp_command_enable(default:no) โ enables the "non-SMTP command" tests in thepostscreen(8)server.postscreen_pipelining_action(default:enforce) โ the action thatpostscreen(8)takes when a remote SMTP client sends multiple commands at once instead of sending one command and waiting for the server to respond. rude behavior honestly ๐ญpostscreen_pipelining_enable(default:no) โ enables 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.postscreen_cache_map(default:btree:$data_directory/postscreen_cache) โ the persistent storage for thepostscreen(8)server's decisions. it remembers everything, iykyk. โจpostscreen_cache_retention_time(default:7d) โ the amount of time thatpostscreen(8)will cache an expired temporary allowlist entry before it gets removed.postscreen_bare_newline_ttl(default:30d) โ the amount of time thatpostscreen(8)remembers that a client IP address passed a "bare newline" SMTP protocol test, before that address is required to pass that test again.postscreen_dnsbl_max_ttl(default:${postscreen_dnsbl_ttl?{$postscreen_dnsbl_ttl}:{1}}h) โ the maximum amount of time thatpostscreen(8)remembers that a client IP address passed a DNS-based reputation test, before it's required to pass that test again.postscreen_dnsbl_min_ttl(default:60s) โ the minimum amount of time thatpostscreen(8)remembers that a client IP address passed a DNS-based reputation test, before it's required to pass that test again.postscreen_greet_ttl(default:1d) โ the amount of time thatpostscreen(8)remembers that a client IP address passed aPREGREETtest, before it's required to pass that test again.postscreen_non_smtp_command_ttl(default:30d) โ the amount of time thatpostscreen(8)remembers that a client IP address passed a"non_smtp_command"SMTP protocol test, before it's required to pass that test again.postscreen_pipelining_ttl(default:30d) โ the amount of time thatpostscreen(8)remembers that a client IP address passed a"pipelining"SMTP protocol test, before it's required to pass that test again.
๐ฅ 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. girl math: cut it up, put it back. โจpostscreen_client_connection_count_limit(default:$smtpd_client_connection_count_limit) โ how many simultaneous connections any single 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 to read 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 it gets terminated by a built-in watchdog timer. the watchdog said times up bestie ๐
๐ 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. living in the past but make it functional. โจ
postscreen_use_tls(default:$smtpd_use_tls) โ opportunistic TLS: announcesSTARTTLSsupport to remote SMTP clients, but does not require that clients use TLS encryption.postscreen_enforce_tls(default:$smtpd_enforce_tls) โ mandatory TLS: announcesSTARTTLSsupport to remote SMTP clients, and requires that clients use TLS encryption.
๐ฆ MISCELLANEOUS CONTROLS ๐
config_directory(default: seepostconf -doutput) โ 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 delay values.command_directory(default: seepostconf -doutput) โ 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 setting a boundary, we love that for it. ๐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: seepostconf -doutput) โ a prefix that's prepended to the process name in syslog records, so that, for example,"smtpd"becomes"prefix/smtpd". it's giving โจpersonal brandingโจ
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. periodt.
โญ HISTORY ๐ฆ
this service was introduced with Postfix version 2.8. iconic from day one, no cap.
many ideas in postscreen(8) were explored in earlier work by Michael Tokarev, in OpenBSD spamd, and in MailChannels Traffic Control.
๐ 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
Wietse Venema porcupine.org
okay bestie that's the whole POSTSCREEN(8) page, absolutely ate and left no crumbs ๐
โจ โ it's from the Postfix manual pages (that's the source and version up in the footer, alongside the date, mwah ๐), and honestly? main character documentation energy. go forth and postscreen responsibly. ๐ซถ๐
๐ฆ where this page comes from
- alpine 3.24: postfix-doc 3.11.7-r0 ยท IPL-1.0 EPL-2.0
- arch rolling: postfix 3.11.7-1 ยท EPL-2.0 OR IPL-1.0 AND BSD-4-Clause-UC
- nixos 26.05: postfix 3.11.7
- nixpkgs unstable: postfix 3.11.7
- ubuntu stonking: postfix 3.11.7-1ubuntu2
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms