1POSTSCREEN(8)               System Manager's Manual              POSTSCREEN(8)
2
3
4

NAME

6       postscreen - Postfix zombie blocker
7

SYNOPSIS

9       postscreen [generic Postfix daemon options]
10

DESCRIPTION

12       The Postfix postscreen(8) server provides additional protection against
13       mail server overload. One postscreen(8) process  handles  multiple  in‐
14       bound SMTP connections, and decides which clients may talk to a Postfix
15       SMTP server process.  By keeping spambots  away,  postscreen(8)  leaves
16       more SMTP server processes available for legitimate clients, and delays
17       the onset of server overload conditions.
18
19       This program should not be used on SMTP ports that  receive  mail  from
20       end-user clients (MUAs). In a typical deployment, postscreen(8) handles
21       the MX service on TCP port 25, and smtpd(8) receives mail from MUAs  on
22       the submission service (TCP port 587) which requires client authentica‐
23       tion.  Alternatively, a site could set up a dedicated,  non-postscreen,
24       "port  25" server that provides submission service and client authenti‐
25       cation, but no MX service.
26
27       postscreen(8) maintains a temporary allowlist  for  clients  that  have
28       passed  a  number  of  tests.   When  an  SMTP client IP address is al‐
29       lowlisted, postscreen(8) hands off  the  connection  immediately  to  a
30       Postfix SMTP server process. This minimizes the overhead for legitimate
31       mail.
32
33       By default, postscreen(8) logs statistics and hands off each connection
34       to a Postfix SMTP server process, while excluding clients in mynetworks
35       from all tests (primarily, to avoid problems with non-standard SMTP im‐
36       plementations  in  network  appliances).   This  default mode blocks no
37       clients, and is useful for non-destructive testing.
38
39       In a typical production setting, postscreen(8) is configured to  reject
40       mail  from  clients that fail one or more tests. postscreen(8) logs re‐
41       jected mail with the client address, helo, sender and recipient  infor‐
42       mation.
43
44       postscreen(8)  is  not an SMTP proxy; this is intentional.  The purpose
45       is to keep spambots away from Postfix SMTP server processes, while min‐
46       imizing overhead for legitimate traffic.
47

SECURITY

49       The postscreen(8) server is moderately security-sensitive.  It talks to
50       untrusted clients on the network. The process can be  run  chrooted  at
51       fixed low privilege.
52

STANDARDS

54       RFC 821 (SMTP protocol)
55       RFC 1123 (Host requirements)
56       RFC 1652 (8bit-MIME transport)
57       RFC 1869 (SMTP service extensions)
58       RFC 1870 (Message Size Declaration)
59       RFC 1985 (ETRN command)
60       RFC 2034 (SMTP Enhanced Status Codes)
61       RFC 2821 (SMTP protocol)
62       Not: RFC 2920 (SMTP Pipelining)
63       RFC 3030 (CHUNKING without BINARYMIME)
64       RFC 3207 (STARTTLS command)
65       RFC 3461 (SMTP DSN Extension)
66       RFC 3463 (Enhanced Status Codes)
67       RFC 5321 (SMTP protocol, including multi-line 220 banners)
68

DIAGNOSTICS

70       Problems and transactions are logged to syslogd(8) or postlogd(8).
71

BUGS

73       The  postscreen(8) built-in SMTP protocol engine currently does not an‐
74       nounce support for AUTH, XCLIENT or XFORWARD.   If  you  need  to  make
75       these  services  available  on port 25, then do not enable the optional
76       "after 220 server greeting" tests.
77
78       The optional "after 220 server greeting" tests may result in unexpected
79       delivery delays from senders that retry email delivery from a different
80       IP address.  Reason: after passing these tests a new client  must  dis‐
81       connect,  and  reconnect from the same IP address before it can deliver
82       mail. See POSTSCREEN_README, section "Tests after the 220  SMTP  server
83       greeting", for a discussion.
84

CONFIGURATION PARAMETERS

86       Changes  to  main.cf  are not picked up automatically, as postscreen(8)
87       processes may run for several hours.  Use the command "postfix  reload"
88       after a configuration change.
89
90       The  text  below provides only a parameter summary. See postconf(5) for
91       more details including examples.
92
93       NOTE: Some postscreen(8) parameters implement  stress-dependent  behav‐
94       ior.   This  is  supported  only  when  the  default parameter value is
95       stress-dependent (that is, it looks like ${stress?{X}:{Y}},  or  it  is
96       the  $name  of  an  smtpd  parameter  with a stress-dependent default).
97       Other parameters always evaluate as if the stress  parameter  value  is
98       the empty string.
99

COMPATIBILITY CONTROLS

101       postscreen_command_filter ($smtpd_command_filter)
102              A mechanism to transform commands from remote SMTP clients.
103
104       postscreen_discard_ehlo_keyword_address_maps  ($smtpd_discard_ehlo_key‐
105       word_address_maps)
106              Lookup tables, indexed by the remote SMTP client  address,  with
107              case  insensitive  lists of EHLO keywords (pipelining, starttls,
108              auth, etc.) that the postscreen(8) server will not send  in  the
109              EHLO response to a remote SMTP client.
110
111       postscreen_discard_ehlo_keywords ($smtpd_discard_ehlo_keywords)
112              A  case insensitive list of EHLO keywords (pipelining, starttls,
113              auth, etc.) that the postscreen(8) server will not send  in  the
114              EHLO response to a remote SMTP client.
115
116       Available in Postfix version 3.1 and later:
117
118       dns_ncache_ttl_fix_enable (no)
119              Enable a workaround for future libc incompatibility.
120
121       Available in Postfix version 3.4 and later:
122
123       postscreen_reject_footer_maps ($smtpd_reject_footer_maps)
124              Optional  lookup  table for information that is appended after a
125              4XX or 5XX postscreen(8) server response.
126
127       Available in Postfix 3.6 and later:
128
129       respectful_logging (see 'postconf -d' output)
130              Avoid logging that implies white is better than black.
131

TROUBLE SHOOTING CONTROLS

133       postscreen_expansion_filter (see 'postconf -d' output)
134              List  of  characters  that  are  permitted   in   postscreen_re‐
135              ject_footer attribute expansions.
136
137       postscreen_reject_footer ($smtpd_reject_footer)
138              Optional  information  that  is  appended  after  a  4XX  or 5XX
139              postscreen(8) server response.
140
141       soft_bounce (no)
142              Safety net to keep mail queued that would otherwise be  returned
143              to the sender.
144

BEFORE-POSTSCREEN PROXY AGENT

146       Available in Postfix version 2.10 and later:
147
148       postscreen_upstream_proxy_protocol (empty)
149              The  name  of  the  proxy  protocol  used  by  an  optional  be‐
150              fore-postscreen proxy agent.
151
152       postscreen_upstream_proxy_timeout (5s)
153              The time  limit  for  the  proxy  protocol  specified  with  the
154              postscreen_upstream_proxy_protocol parameter.
155

PERMANENT ALLOW/DENYLIST TEST

157       This  test is executed immediately after a remote SMTP client connects.
158       If a client is permanently allowlisted, the client will be  handed  off
159       immediately to a Postfix SMTP server process.
160
161       postscreen_access_list (permit_mynetworks)
162              Permanent allow/denylist for remote SMTP client IP addresses.
163
164       postscreen_blacklist_action (ignore)
165              Renamed to postscreen_denylist_action in Postfix 3.6.
166

MAIL EXCHANGER POLICY TESTS

168       When  postscreen(8)  is configured to monitor all primary and backup MX
169       addresses, it can refuse to allowlist clients that connect to a  backup
170       MX address only. For small sites, this requires configuring primary and
171       backup MX addresses on the same MTA. Larger sites would have  to  share
172       the  postscreen(8)  cache  between primary and backup MTAs, which would
173       introduce a common point of failure.
174
175       postscreen_whitelist_interfaces (static:all)
176              Renamed to postscreen_allowlist_interfaces in Postfix 3.6.
177

BEFORE 220 GREETING TESTS

179       These tests are executed before the remote  SMTP  client  receives  the
180       "220 servername" greeting. If no tests remain after the successful com‐
181       pletion of this phase, the client will be handed off immediately  to  a
182       Postfix SMTP server process.
183
184       dnsblog_service_name (dnsblog)
185              The name of the dnsblog(8) service entry in master.cf.
186
187       postscreen_dnsbl_action (ignore)
188              The  action that postscreen(8) takes when a remote SMTP client's
189              combined DNSBL score is equal to or greater than a threshold (as
190              defined       with      the      postscreen_dnsbl_sites      and
191              postscreen_dnsbl_threshold parameters).
192
193       postscreen_dnsbl_reply_map (empty)
194              A mapping from actual DNSBL domain name which includes a  secret
195              password,  to  the  DNSBL domain name that postscreen will reply
196              with when it rejects mail.
197
198       postscreen_dnsbl_sites (empty)
199              Optional list of DNS allow/denylist domains, filters and  weight
200              factors.
201
202       postscreen_dnsbl_threshold (1)
203              The  inclusive  lower  bound  for blocking a remote SMTP client,
204              based  on  its  combined  DNSBL  score  as  defined   with   the
205              postscreen_dnsbl_sites parameter.
206
207       postscreen_greet_action (ignore)
208              The  action  that  postscreen(8) takes when a remote SMTP client
209              speaks before its  turn  within  the  time  specified  with  the
210              postscreen_greet_wait parameter.
211
212       postscreen_greet_banner ($smtpd_banner)
213              The  text  in  the  optional  "220-text..." server response that
214              postscreen(8) sends ahead of the real Postfix SMTP server's "220
215              text..."  response, in an attempt to confuse bad SMTP clients so
216              that they speak before their turn (pre-greet).
217
218       postscreen_greet_wait (normal: 6s, overload: 2s)
219              The amount of time that postscreen(8)  will  wait  for  an  SMTP
220              client  to send a command before its turn, and for DNS blocklist
221              lookup results to arrive (default: up to 2 seconds under stress,
222              up to 6 seconds otherwise).
223
224       smtpd_service_name (smtpd)
225              The  internal  service that postscreen(8) hands off allowed con‐
226              nections to.
227
228       Available in Postfix version 2.11 and later:
229
230       postscreen_dnsbl_whitelist_threshold (0)
231              Renamed to postscreen_dnsbl_allowlist_threshold in Postfix 3.6.
232
233       Available in Postfix version 3.0 and later:
234
235       postscreen_dnsbl_timeout (10s)
236              The time limit for DNSBL or DNSWL lookups.
237
238       Available in Postfix version 3.6 and later:
239
240       postscreen_denylist_action (ignore)
241              The action that postscreen(8) takes when a remote SMTP client is
242              permanently  denylisted  with the postscreen_access_list parame‐
243              ter.
244
245       postscreen_allowlist_interfaces (static:all)
246              A list of  local  postscreen(8)  server  IP  addresses  where  a
247              non-allowlisted  remote  SMTP  client can obtain postscreen(8)'s
248              temporary allowlist status.
249
250       postscreen_dnsbl_allowlist_threshold (0)
251              Allow a remote SMTP client  to  skip  "before"  and  "after  220
252              greeting"  protocol  tests, based on its combined DNSBL score as
253              defined with the postscreen_dnsbl_sites parameter.
254

AFTER 220 GREETING TESTS

256       These tests are executed after the remote SMTP client receives the "220
257       servername"  greeting.  If a client passes all tests during this phase,
258       it will receive a 4XX response to  all  RCPT  TO  commands.  After  the
259       client  reconnects,  it  will  be allowed to talk directly to a Postfix
260       SMTP server process.
261
262       postscreen_bare_newline_action (ignore)
263              The action that postscreen(8) takes when a  remote  SMTP  client
264              sends  a bare newline character, that is, a newline not preceded
265              by carriage return.
266
267       postscreen_bare_newline_enable (no)
268              Enable "bare newline" SMTP protocol tests in  the  postscreen(8)
269              server.
270
271       postscreen_disable_vrfy_command ($disable_vrfy_command)
272              Disable the SMTP VRFY command in the postscreen(8) daemon.
273
274       postscreen_forbidden_commands ($smtpd_forbidden_commands)
275              List of commands that the postscreen(8) server considers in vio‐
276              lation of the SMTP protocol.
277
278       postscreen_helo_required ($smtpd_helo_required)
279              Require that a remote SMTP client sends HELO or EHLO before com‐
280              mencing a MAIL transaction.
281
282       postscreen_non_smtp_command_action (drop)
283              The  action  that  postscreen(8) takes when a remote SMTP client
284              sends non-SMTP commands as specified with the postscreen_forbid‐
285              den_commands parameter.
286
287       postscreen_non_smtp_command_enable (no)
288              Enable "non-SMTP command" tests in the postscreen(8) server.
289
290       postscreen_pipelining_action (enforce)
291              The  action  that  postscreen(8) takes when a remote SMTP client
292              sends multiple commands instead of sending one command and wait‐
293              ing for the server to respond.
294
295       postscreen_pipelining_enable (no)
296              Enable  "pipelining"  SMTP  protocol  tests in the postscreen(8)
297              server.
298

CACHE CONTROLS

300       postscreen_cache_cleanup_interval (12h)
301              The amount of time between postscreen(8) cache cleanup runs.
302
303       postscreen_cache_map (btree:$data_directory/postscreen_cache)
304              Persistent storage for the postscreen(8) server decisions.
305
306       postscreen_cache_retention_time (7d)
307              The amount of time that postscreen(8) will cache an expired tem‐
308              porary allowlist entry before it is removed.
309
310       postscreen_bare_newline_ttl (30d)
311              The amount of time that postscreen(8) will use the result from a
312              successful "bare newline" SMTP protocol test.
313
314       postscreen_dnsbl_max_ttl
315       (${postscreen_dnsbl_ttl?{$postscreen_dnsbl_ttl}:{1}}h)
316              The  maximum  amount of time that postscreen(8) will use the re‐
317              sult from a successful DNS-based reputation test before a client
318              IP address is required to pass that test again.
319
320       postscreen_dnsbl_min_ttl (60s)
321              The  minimum  amount of time that postscreen(8) will use the re‐
322              sult from a successful DNS-based reputation test before a client
323              IP address is required to pass that test again.
324
325       postscreen_greet_ttl (1d)
326              The amount of time that postscreen(8) will use the result from a
327              successful PREGREET test.
328
329       postscreen_non_smtp_command_ttl (30d)
330              The amount of time that postscreen(8) will use the result from a
331              successful "non_smtp_command" SMTP protocol test.
332
333       postscreen_pipelining_ttl (30d)
334              The amount of time that postscreen(8) will use the result from a
335              successful "pipelining" SMTP protocol test.
336

RESOURCE CONTROLS

338       line_length_limit (2048)
339              Upon input, long lines are chopped up into  pieces  of  at  most
340              this length; upon delivery, long lines are reconstructed.
341
342       postscreen_client_connection_count_limit         ($smtpd_client_connec‐
343       tion_count_limit)
344              How many simultaneous connections any remote SMTP client is  al‐
345              lowed to have with the postscreen(8) daemon.
346
347       postscreen_command_count_limit (20)
348              The  limit  on the total number of commands per SMTP session for
349              postscreen(8)'s built-in SMTP protocol engine.
350
351       postscreen_command_time_limit (normal: 300s, overload: 10s)
352              The  time  limit  to  read   an   entire   command   line   with
353              postscreen(8)'s built-in SMTP protocol engine.
354
355       postscreen_post_queue_limit ($default_process_limit)
356              The  number  of  clients  that can be waiting for service from a
357              real Postfix SMTP server process.
358
359       postscreen_pre_queue_limit ($default_process_limit)
360              The number of non-allowlisted clients that can be waiting for  a
361              decision  whether  they will receive service from a real Postfix
362              SMTP server process.
363
364       postscreen_watchdog_timeout (10s)
365              How much time a postscreen(8) process may take to respond  to  a
366              remote  SMTP  client command or to perform a cache operation be‐
367              fore it is terminated by a built-in watchdog timer.
368

STARTTLS CONTROLS

370       postscreen_tls_security_level ($smtpd_tls_security_level)
371              The SMTP TLS security level for the postscreen(8) server; when a
372              non-empty value is specified, this overrides the obsolete param‐
373              eters postscreen_use_tls and postscreen_enforce_tls.
374
375       tlsproxy_service_name (tlsproxy)
376              The name of the tlsproxy(8) service entry in master.cf.
377

OBSOLETE STARTTLS SUPPORT CONTROLS

379       These parameters are supported for compatibility with  smtpd(8)  legacy
380       parameters.
381
382       postscreen_use_tls ($smtpd_use_tls)
383              Opportunistic  TLS:  announce  STARTTLS  support  to remote SMTP
384              clients, but do not require that clients use TLS encryption.
385
386       postscreen_enforce_tls ($smtpd_enforce_tls)
387              Mandatory TLS: announce STARTTLS support to remote SMTP clients,
388              and require that clients use TLS encryption.
389

MISCELLANEOUS CONTROLS

391       config_directory (see 'postconf -d' output)
392              The  default  location of the Postfix main.cf and master.cf con‐
393              figuration files.
394
395       delay_logging_resolution_limit (2)
396              The maximal number of digits after the decimal point  when  log‐
397              ging sub-second delay values.
398
399       command_directory (see 'postconf -d' output)
400              The location of all postfix administrative commands.
401
402       max_idle (100s)
403              The  maximum  amount of time that an idle Postfix daemon process
404              waits for an incoming connection before terminating voluntarily.
405
406       process_id (read-only)
407              The process ID of a Postfix command or daemon process.
408
409       process_name (read-only)
410              The process name of a Postfix command or daemon process.
411
412       syslog_facility (mail)
413              The syslog facility of Postfix logging.
414
415       syslog_name (see 'postconf -d' output)
416              A prefix that  is  prepended  to  the  process  name  in  syslog
417              records, so that, for example, "smtpd" becomes "prefix/smtpd".
418
419       Available in Postfix 3.3 and later:
420
421       service_name (read-only)
422              The master.cf service name of a Postfix daemon process.
423
424       Available in Postfix 3.5 and later:
425
426       info_log_address_format (external)
427              The  email  address  form that will be used in non-debug logging
428              (info, warning, etc.).
429

SEE ALSO

431       smtpd(8), Postfix SMTP server
432       tlsproxy(8), Postfix TLS proxy server
433       dnsblog(8), DNS allow/denylist logger
434       postlogd(8), Postfix logging
435       syslogd(8), system logging
436

README FILES

438       Use "postconf readme_directory" or "postconf html_directory" to  locate
439       this information.
440       POSTSCREEN_README, Postfix Postscreen Howto
441

LICENSE

443       The Secure Mailer license must be distributed with this software.
444

HISTORY

446       This service was introduced with Postfix version 2.8.
447
448       Many  ideas  in  postscreen(8) were explored in earlier work by Michael
449       Tokarev, in OpenBSD spamd, and in MailChannels Traffic Control.
450

AUTHOR(S)

452       Wietse Venema
453       IBM T.J. Watson Research
454       P.O. Box 704
455       Yorktown Heights, NY 10598, USA
456
457       Wietse Venema
458       Google, Inc.
459       111 8th Avenue
460       New York, NY 10011, USA
461
462
463
464                                                                 POSTSCREEN(8)
Impressum