1POSTSCREEN(8) System Manager's Manual POSTSCREEN(8)
2
3
4
6 postscreen - Postfix zombie blocker
7
9 postscreen [generic Postfix daemon options]
10
12 The Postfix postscreen(8) server provides additional protection against
13 mail server overload. One postscreen(8) process handles multiple
14 inbound SMTP connections, and decides which clients may talk to a Post‐
15 fix SMTP server process. By keeping spambots away, postscreen(8)
16 leaves more SMTP server processes available for legitimate clients, and
17 delays 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, while MUA clients submit mail via the
22 submission service on 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 whitelist for clients that have
28 passed a number of tests. When an SMTP client IP address is
29 whitelisted, 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 every connec‐
34 tion to a Postfix SMTP server process, while excluding clients in
35 mynetworks from all tests (primarily, to avoid problems with non-stan‐
36 dard SMTP implementations in network appliances). This mode is useful
37 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
41 rejected mail with the client address, helo, sender and recipient
42 information.
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
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
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 3207 (STARTTLS command)
64 RFC 3461 (SMTP DSN Extension)
65 RFC 3463 (Enhanced Status Codes)
66 RFC 5321 (SMTP protocol, including multi-line 220 banners)
67
69 Problems and transactions are logged to syslogd(8).
70
72 The postscreen(8) built-in SMTP protocol engine currently does not
73 announce support for AUTH, XCLIENT or XFORWARD. If you need to make
74 these services available on port 25, then do not enable the optional
75 "after 220 server greeting" tests, and do not use DNSBLs that reject
76 traffic from dial-up and residential networks.
77
78 The optional "after 220 server greeting" tests involve postscreen(8)'s
79 built-in SMTP protocol engine. When these tests succeed, postscreen(8)
80 adds the client to the temporary whitelist, but it cannot not hand off
81 the "live" connection to a Postfix SMTP server process in the middle of
82 a session. Instead, postscreen(8) defers attempts to deliver mail with
83 a 4XX status, and waits for the client to disconnect. When the client
84 connects again, postscreen(8) will allow the client to talk to a Post‐
85 fix SMTP server process (provided that the whitelist status has not
86 expired). postscreen(8) mitigates the impact of this limitation by
87 giving the "after 220 server greeting" tests a long expiration time.
88
90 Changes to main.cf are not picked up automatically, as postscreen(8)
91 processes may run for several hours. Use the command "postfix reload"
92 after a configuration change.
93
94 The text below provides only a parameter summary. See postconf(5) for
95 more details including examples.
96
97 NOTE: Some postscreen(8) parameters implement stress-dependent behav‐
98 ior. This is supported only when the default parameter value is
99 stress-dependent (that is, it looks like ${stress?X}${stress:Y}, or it
100 is the $name of an smtpd parameter with a stress-dependent default).
101 Other parameters always evaluate as if the stress parameter value is
102 the empty string.
103
105 postscreen_command_filter ($smtpd_command_filter)
106 A mechanism to transform commands from remote SMTP clients.
107
108 postscreen_discard_ehlo_keyword_address_maps ($smtpd_discard_ehlo_key‐
109 word_address_maps)
110 Lookup tables, indexed by the remote SMTP client address, with
111 case insensitive lists of EHLO keywords (pipelining, starttls,
112 auth, etc.) that the postscreen(8) server will not send in the
113 EHLO response to a remote SMTP client.
114
115 postscreen_discard_ehlo_keywords ($smtpd_discard_ehlo_keywords)
116 A case insensitive list of EHLO keywords (pipelining, starttls,
117 auth, etc.) that the postscreen(8) server will not send in the
118 EHLO response to a remote SMTP client.
119
121 postscreen_expansion_filter (see 'postconf -d' output)
122 List of characters that are permitted in
123 postscreen_reject_footer attribute expansions.
124
125 postscreen_reject_footer ($smtpd_reject_footer)
126 Optional information that is appended after a 4XX or 5XX
127 postscreen(8) server response.
128
129 soft_bounce (no)
130 Safety net to keep mail queued that would otherwise be returned
131 to the sender.
132
134 Available in Postfix version 2.10 and later:
135
136 postscreen_upstream_proxy_protocol (empty)
137 The name of the proxy protocol used by an optional before-
138 postscreen proxy agent.
139
140 postscreen_upstream_proxy_timeout (5s)
141 The time limit for the proxy protocol specified with the
142 postscreen_upstream_proxy_protocol parameter.
143
145 This test is executed immediately after a remote SMTP client connects.
146 If a client is permanently whitelisted, the client will be handed off
147 immediately to a Postfix SMTP server process.
148
149 postscreen_access_list (permit_mynetworks)
150 Permanent white/blacklist for remote SMTP client IP addresses.
151
152 postscreen_blacklist_action (ignore)
153 The action that postscreen(8) takes when a remote SMTP client is
154 permanently blacklisted with the postscreen_access_list parame‐
155 ter.
156
158 When postscreen(8) is configured to monitor all primary and backup MX
159 addresses, it can refuse to whitelist clients that connect to a backup
160 MX address only. For small sites, this requires configuring primary and
161 backup MX addresses on the same MTA. Larger sites would have to share
162 the postscreen(8) cache between primary and backup MTAs, which would
163 introduce a common point of failure.
164
165 postscreen_whitelist_interfaces (static:all)
166 A list of local postscreen(8) server IP addresses where a non-
167 whitelisted remote SMTP client can obtain postscreen(8)'s tempo‐
168 rary whitelist status.
169
171 These tests are executed before the remote SMTP client receives the
172 "220 servername" greeting. If no tests remain after the successful com‐
173 pletion of this phase, the client will be handed off immediately to a
174 Postfix SMTP server process.
175
176 dnsblog_service_name (dnsblog)
177 The name of the dnsblog(8) service entry in master.cf.
178
179 postscreen_dnsbl_action (ignore)
180 The action that postscreen(8) takes when a remote SMTP client's
181 combined DNSBL score is equal to or greater than a threshold (as
182 defined with the postscreen_dnsbl_sites and
183 postscreen_dnsbl_threshold parameters).
184
185 postscreen_dnsbl_reply_map (empty)
186 A mapping from actual DNSBL domain name which includes a secret
187 password, to the DNSBL domain name that postscreen will reply
188 with when it rejects mail.
189
190 postscreen_dnsbl_sites (empty)
191 Optional list of DNS white/blacklist domains, filters and weight
192 factors.
193
194 postscreen_dnsbl_threshold (1)
195 The inclusive lower bound for blocking a remote SMTP client,
196 based on its combined DNSBL score as defined with the
197 postscreen_dnsbl_sites parameter.
198
199 postscreen_greet_action (ignore)
200 The action that postscreen(8) takes when a remote SMTP client
201 speaks before its turn within the time specified with the
202 postscreen_greet_wait parameter.
203
204 postscreen_greet_banner ($smtpd_banner)
205 The text in the optional "220-text..." server response that
206 postscreen(8) sends ahead of the real Postfix SMTP server's "220
207 text..." response, in an attempt to confuse bad SMTP clients so
208 that they speak before their turn (pre-greet).
209
210 postscreen_greet_wait (${stress?2}${stress:6}s)
211 The amount of time that postscreen(8) will wait for an SMTP
212 client to send a command before its turn, and for DNS blocklist
213 lookup results to arrive (default: up to 2 seconds under stress,
214 up to 6 seconds otherwise).
215
216 smtpd_service_name (smtpd)
217 The internal service that postscreen(8) hands off allowed con‐
218 nections to.
219
221 These tests are executed after the remote SMTP client receives the "220
222 servername" greeting. If a client passes all tests during this phase,
223 it will receive a 4XX response to RCPT TO commands until the client
224 hangs up. After this, the client will be allowed to talk directly to a
225 Postfix SMTP server process.
226
227 postscreen_bare_newline_action (ignore)
228 The action that postscreen(8) takes when a remote SMTP client
229 sends a bare newline character, that is, a newline not preceded
230 by carriage return.
231
232 postscreen_bare_newline_enable (no)
233 Enable "bare newline" SMTP protocol tests in the postscreen(8)
234 server.
235
236 postscreen_disable_vrfy_command ($disable_vrfy_command)
237 Disable the SMTP VRFY command in the postscreen(8) daemon.
238
239 postscreen_forbidden_commands ($smtpd_forbidden_commands)
240 List of commands that the postscreen(8) server considers in vio‐
241 lation of the SMTP protocol.
242
243 postscreen_helo_required ($smtpd_helo_required)
244 Require that a remote SMTP client sends HELO or EHLO before com‐
245 mencing a MAIL transaction.
246
247 postscreen_non_smtp_command_action (drop)
248 The action that postscreen(8) takes when a remote SMTP client
249 sends non-SMTP commands as specified with the postscreen_forbid‐
250 den_commands parameter.
251
252 postscreen_non_smtp_command_enable (no)
253 Enable "non-SMTP command" tests in the postscreen(8) server.
254
255 postscreen_pipelining_action (enforce)
256 The action that postscreen(8) takes when a remote SMTP client
257 sends multiple commands instead of sending one command and wait‐
258 ing for the server to respond.
259
260 postscreen_pipelining_enable (no)
261 Enable "pipelining" SMTP protocol tests in the postscreen(8)
262 server.
263
265 postscreen_cache_cleanup_interval (12h)
266 The amount of time between postscreen(8) cache cleanup runs.
267
268 postscreen_cache_map (btree:$data_directory/postscreen_cache)
269 Persistent storage for the postscreen(8) server decisions.
270
271 postscreen_cache_retention_time (7d)
272 The amount of time that postscreen(8) will cache an expired tem‐
273 porary whitelist entry before it is removed.
274
275 postscreen_bare_newline_ttl (30d)
276 The amount of time that postscreen(8) will use the result from a
277 successful "bare newline" SMTP protocol test.
278
279 postscreen_dnsbl_ttl (1h)
280 The amount of time that postscreen(8) will use the result from a
281 successful DNS blocklist test.
282
283 postscreen_greet_ttl (1d)
284 The amount of time that postscreen(8) will use the result from a
285 successful PREGREET test.
286
287 postscreen_non_smtp_command_ttl (30d)
288 The amount of time that postscreen(8) will use the result from a
289 successful "non_smtp_command" SMTP protocol test.
290
291 postscreen_pipelining_ttl (30d)
292 The amount of time that postscreen(8) will use the result from a
293 successful "pipelining" SMTP protocol test.
294
296 line_length_limit (2048)
297 Upon input, long lines are chopped up into pieces of at most
298 this length; upon delivery, long lines are reconstructed.
299
300 postscreen_client_connection_count_limit ($smtpd_client_connec‐
301 tion_count_limit)
302 How many simultaneous connections any remote SMTP client is
303 allowed to have with the postscreen(8) daemon.
304
305 postscreen_command_count_limit (20)
306 The limit on the total number of commands per SMTP session for
307 postscreen(8)'s built-in SMTP protocol engine.
308
309 postscreen_command_time_limit (${stress?10}${stress:300}s)
310 The time limit to read an entire command line with
311 postscreen(8)'s built-in SMTP protocol engine.
312
313 postscreen_post_queue_limit ($default_process_limit)
314 The number of clients that can be waiting for service from a
315 real Postfix SMTP server process.
316
317 postscreen_pre_queue_limit ($default_process_limit)
318 The number of non-whitelisted clients that can be waiting for a
319 decision whether they will receive service from a real Postfix
320 SMTP server process.
321
322 postscreen_watchdog_timeout (10s)
323 How much time a postscreen(8) process may take to respond to a
324 remote SMTP client command or to perform a cache operation
325 before it is terminated by a built-in watchdog timer.
326
328 postscreen_tls_security_level ($smtpd_tls_security_level)
329 The SMTP TLS security level for the postscreen(8) server; when a
330 non-empty value is specified, this overrides the obsolete param‐
331 eters postscreen_use_tls and postscreen_enforce_tls.
332
333 tlsproxy_service_name (tlsproxy)
334 The name of the tlsproxy(8) service entry in master.cf.
335
337 These parameters are supported for compatibility with smtpd(8) legacy
338 parameters.
339
340 postscreen_use_tls ($smtpd_use_tls)
341 Opportunistic TLS: announce STARTTLS support to remote SMTP
342 clients, but do not require that clients use TLS encryption.
343
344 postscreen_enforce_tls ($smtpd_enforce_tls)
345 Mandatory TLS: announce STARTTLS support to remote SMTP clients,
346 and require that clients use TLS encryption.
347
349 config_directory (see 'postconf -d' output)
350 The default location of the Postfix main.cf and master.cf con‐
351 figuration files.
352
353 delay_logging_resolution_limit (2)
354 The maximal number of digits after the decimal point when log‐
355 ging sub-second delay values.
356
357 command_directory (see 'postconf -d' output)
358 The location of all postfix administrative commands.
359
360 max_idle (100s)
361 The maximum amount of time that an idle Postfix daemon process
362 waits for an incoming connection before terminating voluntarily.
363
364 process_id (read-only)
365 The process ID of a Postfix command or daemon process.
366
367 process_name (read-only)
368 The process name of a Postfix command or daemon process.
369
370 syslog_facility (mail)
371 The syslog facility of Postfix logging.
372
373 syslog_name (see 'postconf -d' output)
374 The mail system name that is prepended to the process name in
375 syslog records, so that "smtpd" becomes, for example, "post‐
376 fix/smtpd".
377
379 smtpd(8), Postfix SMTP server
380 tlsproxy(8), Postfix TLS proxy server
381 dnsblog(8), DNS black/whitelist logger
382 syslogd(8), system logging
383
385 Use "postconf readme_directory" or "postconf html_directory" to locate
386 this information.
387 POSTSCREEN_README, Postfix Postscreen Howto
388
390 The Secure Mailer license must be distributed with this software.
391
393 This service was introduced with Postfix version 2.8.
394
395 Many ideas in postscreen(8) were explored in earlier work by Michael
396 Tokarev, in OpenBSD spamd, and in MailChannels Traffic Control.
397
399 Wietse Venema
400 IBM T.J. Watson Research
401 P.O. Box 704
402 Yorktown Heights, NY 10598, USA
403
404
405
406 POSTSCREEN(8)