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 ๐Ÿ“œ

๐Ÿฉบ 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: Some postscreen(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 $name of an smtpd parameter 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 the postscreen(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 the postscreen(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 5XX postscreen(8) server response.

Available in Postfix 3.6 and later:

  • respectful_logging (see postconf -d output) โ€” avoid logging that implies white is better than black. ๐Ÿซถ

๐Ÿ”ง TROUBLE SHOOTING CONTROLS ๐Ÿ”ง

  • postscreen_expansion_filter (see postconf -d output) โ€” list of characters that are permitted in postscreen_reject_footer attribute expansions.
  • postscreen_reject_footer ($smtpd_reject_footer) โ€” optional information that is appended after a 4XX or 5XX postscreen(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 the postscreen_upstream_proxy_protocol parameter.

๐Ÿšช 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 to postscreen_denylist_action in 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 local postscreen(8) server IP addresses where a non-allowlisted remote SMTP client can obtain postscreen(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 the dnsblog(8) service entry in master.cf.
  • postscreen_dnsbl_action (ignore) โ€” the action that postscreen(8) takes when a remote SMTP client's combined DNSBL score is equal to or greater than a threshold (as defined with the postscreen_dnsbl_sites and postscreen_dnsbl_threshold parameters).
  • 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 the postscreen_dnsbl_sites parameter.
  • postscreen_greet_action (ignore) โ€” the action that postscreen(8) takes when a remote SMTP client speaks before its turn within the time specified with the postscreen_greet_wait parameter. ๐Ÿ˜ค
  • postscreen_greet_banner ($smtpd_banner) โ€” the text in the optional "220-text..." server response that postscreen(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 that postscreen(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 that postscreen(8) hands off allowed connections to.

Available in Postfix version 2.11 and later:

  • postscreen_dnsbl_whitelist_threshold (0) โ€” renamed to postscreen_dnsbl_allowlist_threshold in 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 that postscreen(8) takes when a remote SMTP client is permanently denylisted with the postscreen_access_list parameter.
  • postscreen_allowlist_interfaces (static:all) โ€” a list of local postscreen(8) server IP addresses where a non-allowlisted remote SMTP client can obtain postscreen(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 the postscreen_dnsbl_sites parameter. โœจ

๐Ÿ™ˆ 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 that postscreen(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 the postscreen(8) server. โœจ
  • postscreen_disable_vrfy_command (default: $disable_vrfy_command) โ€” disables the SMTP VRFY command in the postscreen(8) daemon. not today, VRFY. ๐Ÿ’€
  • postscreen_forbidden_commands (default: $smtpd_forbidden_commands) โ€” the list of commands that the postscreen(8) server considers to be in violation of the SMTP protocol.
  • postscreen_helo_required (default: $smtpd_helo_required) โ€” requires that a remote SMTP client sends HELO or EHLO before it starts a MAIL transaction. no skipping the intro, bestie. ๐Ÿซถ
  • postscreen_non_smtp_command_action (default: drop) โ€” the action that postscreen(8) takes when a remote SMTP client sends non-SMTP commands as specified with the postscreen_forbidden_commands parameter.
  • postscreen_non_smtp_command_enable (default: no) โ€” enables the "non-SMTP command" tests in the postscreen(8) server.
  • postscreen_pipelining_action (default: enforce) โ€” the action that postscreen(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 the postscreen(8) server.

๐ŸŽ€ CACHE CONTROLS ๐Ÿ’–

  • postscreen_cache_cleanup_interval (default: 12h) โ€” how much time passes between postscreen(8) cache cleanup runs.
  • postscreen_cache_map (default: btree:$data_directory/postscreen_cache) โ€” the persistent storage for the postscreen(8) server's decisions. it remembers everything, iykyk. โœจ
  • postscreen_cache_retention_time (default: 7d) โ€” the amount of time that postscreen(8) will cache an expired temporary allowlist entry before it gets removed.
  • postscreen_bare_newline_ttl (default: 30d) โ€” the amount of time that postscreen(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 that postscreen(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 that postscreen(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 that postscreen(8) remembers that a client IP address passed a PREGREET test, before it's required to pass that test again.
  • postscreen_non_smtp_command_ttl (default: 30d) โ€” the amount of time that postscreen(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 that postscreen(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 the postscreen(8) daemon.
  • postscreen_command_count_limit (default: 20) โ€” the limit on the total number of commands per SMTP session for postscreen(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 with postscreen(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 a postscreen(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 the postscreen(8) server; when a non-empty value is specified, this overrides the obsolete parameters postscreen_use_tls and postscreen_enforce_tls.
  • tlsproxy_service_name (default: tlsproxy) โ€” the name of the tlsproxy(8) service entry in master.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: announces STARTTLS support to remote SMTP clients, but does not require that clients use TLS encryption.
  • postscreen_enforce_tls (default: $smtpd_enforce_tls) โ€” mandatory TLS: announces STARTTLS support to remote SMTP clients, and requires that clients use TLS encryption.

๐Ÿฆ‹ MISCELLANEOUS CONTROLS ๐Ÿ“

  • config_directory (default: see postconf -d output) โ€” the default location of the Postfix main.cf and master.cf configuration files.
  • delay_logging_resolution_limit (default: 2) โ€” the maximal number of digits after the decimal point when logging 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 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: see postconf -d output) โ€” 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) โ€” the master.cf service 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 ๐Ÿ’œ


๐Ÿ“š 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