autoupdate
[postfix-master.git] / postfix-master / OVERVIEW.html
blob0f55aa157f03c69e5bab94defbfba3a076064904
1 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
4 <html>
6 <head>
8 <title>Postfix Architecture Overview </title>
10 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
12 </head>
14 <body>
16 <h1> <img src="postfix-logo.jpg" width="203" height="98" ALT="">Postfix
17 Architecture Overview </h1>
19 <hr>
21 <h2> Introduction </h2>
23 <p> This document presents an overview of the Postfix architecture,
24 and provides pointers to descriptions of every Postfix command
25 or server program. The text gives the general context in which
26 each command or server program is used, and provides pointers to
27 documents with specific usage examples and background information.
28 </p>
30 <p> Topics covered by this document: </p>
32 <ul>
34 <li> <a href="#receiving"> How Postfix receives mail </a>
36 <li> <a href="#delivering"> How Postfix delivers mail </a>
38 <li> <a href="#behind"> Postfix behind the scenes </a>
40 <li> <a href="#commands"> Postfix support commands </a>
42 </ul>
44 <h2><a name="receiving"> How Postfix receives mail </a> </h2>
46 <p> When a message enters the Postfix mail system, the first stop
47 on the inside is the <a href="QSHAPE_README.html#incoming_queue">incoming queue</a>. The figure below shows the
48 main processes that are involved with new mail. Names followed by
49 a number are Postfix commands or server programs, while unnumbered
50 names inside shaded areas represent Postfix queues. </p>
52 <blockquote>
54 <table>
56 <tr>
58 <td colspan="4"> </td>
60 <td bgcolor="#f0f0ff" align="center"> <a href="trivial-rewrite.8.html">trivial-<br>rewrite(8)</a> </td>
62 </tr>
64 <tr>
66 <td> Network </td> <td> <tt> -&gt; </tt> </td>
68 <td bgcolor="#f0f0ff" align="center" valign="middle"> <a href="smtpd.8.html">smtpd(8)</a>
69 </td>
71 <td> </td>
73 <td rowspan="2" align="center"> <table> <tr> <td align="center">
74 ^<br> <tt> | </tt> </td> <td align="center"> <tt> |<br> v </tt>
75 </td> </tr> </table> </td>
77 </tr>
79 <tr>
81 <td colspan="3"> </td> <td> <tt> \ </tt> </td>
83 </tr>
85 <tr>
87 <td> Network </td> <td> <tt> -&gt; </tt> </td>
89 <td bgcolor="#f0f0ff" align="center" valign="middle"> <a href="qmqpd.8.html">qmqpd(8)</a>
90 </td>
92 <td> <tt> -&gt; </tt> </td>
94 <td bgcolor="#f0f0ff" align="center" valign="middle"> <a href="cleanup.8.html">cleanup(8)</a>
95 </td>
97 <td> <tt> -&gt; </tt> </td>
99 <td bgcolor="#f0f0ff" align="center" valign="middle"> <a
100 href="QSHAPE_README.html#incoming_queue"> incoming </a> </td>
102 </tr>
104 <tr>
106 <td colspan="3"> </td> <td> <tt> / </tt> </td>
108 </tr>
110 <tr>
112 <td colspan="2"> </td>
114 <td bgcolor="#f0f0ff" align="center" valign="middle"> <a href="pickup.8.html">pickup(8)</a>
115 </td>
117 <td> <tt> &lt;- </tt> </td>
119 <td bgcolor="#f0f0ff" align="center" valign="middle"> <a
120 href="QSHAPE_README.html#maildrop_queue"> maildrop </a> </td>
122 </tr>
124 <tr>
126 <td colspan="4" align="center"> </td>
128 <td align="center"> ^<br> <tt> | </tt> </td>
130 </tr>
132 <tr>
134 <td> Local </td> <td> <tt> -&gt; </tt> </td>
136 <td bgcolor="#f0f0ff" align="center" valign="middle"> <a href="sendmail.1.html">sendmail(1)</a>
137 </td>
139 <td> <tt> -&gt; </tt> </td>
141 <td bgcolor="#f0f0ff" align="center" valign="middle"> <a href="postdrop.1.html">postdrop(1)</a>
142 </td>
144 </tr>
146 </table>
148 </blockquote>
150 <ul>
152 <li> <p> Network mail enters Postfix via the <a href="smtpd.8.html">smtpd(8)</a> or <a href="qmqpd.8.html">qmqpd(8)</a>
153 servers. These servers remove the SMTP or QMQP protocol encapsulation,
154 enforce some sanity checks to protect Postfix, and give the sender,
155 recipients and message content to the <a href="cleanup.8.html">cleanup(8)</a> server. The
156 <a href="smtpd.8.html">smtpd(8)</a> server can be configured to block unwanted mail, as
157 described in the <a href="SMTPD_ACCESS_README.html">SMTPD_ACCESS_README</a> document. </p>
159 <li> <p> Local submissions are received with the Postfix <a href="sendmail.1.html">sendmail(1)</a>
160 compatibility command, and are queued in the <a href="QSHAPE_README.html#maildrop_queue">maildrop queue</a> by
161 the privileged <a href="postdrop.1.html">postdrop(1)</a> command. This arrangement even works
162 while the Postfix mail system is not running. The local <a href="pickup.8.html">pickup(8)</a>
163 server picks up local submissions, enforces some sanity checks to
164 protect Postfix, and gives the sender, recipients and message
165 content to the <a href="cleanup.8.html">cleanup(8)</a> server. </p>
167 <li> <p> Mail from internal sources is given directly to the
168 <a href="cleanup.8.html">cleanup(8)</a> server. These sources are not shown in the figure, and
169 include: mail that is forwarded by the <a href="local.8.html">local(8)</a> delivery agent (see
170 next section), messages that are returned to the sender by the
171 <a href="bounce.8.html">bounce(8)</a> server (see second-next section), and postmaster
172 notifications about problems with Postfix. </p>
174 <li> <p> The <a href="cleanup.8.html">cleanup(8)</a> server implements the final processing
175 stage before mail is queued. It adds missing From: and other message
176 headers, and transforms addresses as described in the
177 <a href="ADDRESS_REWRITING_README.html">ADDRESS_REWRITING_README</a>
178 document. Optionally, the <a href="cleanup.8.html">cleanup(8)</a> server can be configured to
179 do light-weight content inspection with regular expressions as
180 described in the <a href="BUILTIN_FILTER_README.html">BUILTIN_FILTER_README</a> document. The <a href="cleanup.8.html">cleanup(8)</a>
181 server places the result as a single file into the <a href="QSHAPE_README.html#incoming_queue">incoming queue</a>,
182 and notifies the queue manager (see next section) of the arrival
183 of new mail. </p>
185 <li> <p> The <a href="trivial-rewrite.8.html">trivial-rewrite(8)</a> server rewrites addresses to the
186 standard "user@fully.qualified.domain" form, as described in the
187 <a href="ADDRESS_REWRITING_README.html">ADDRESS_REWRITING_README</a> document. Postfix currently does not
188 implement a rewriting language, but a lot can be done via table
189 lookups and, if need be, regular expressions. </p>
191 </ul>
193 <h2> <a name="delivering"> How Postfix delivers mail </a> </h2>
195 <p> Once a message has reached the <a href="QSHAPE_README.html#incoming_queue">incoming queue</a> the next step is
196 to deliver it. The figure shows the main components of the Postfix
197 mail delivery apparatus. Names followed by a number are Postfix
198 commands or server programs, while unnumbered names inside shaded
199 areas represent Postfix queues. </p>
201 <blockquote>
203 <table>
205 <tr>
207 <td rowspan="2" colspan="4"> </td>
209 <td rowspan="2" bgcolor="#f0f0ff" align="center"> <a href="trivial-rewrite.8.html">trivial-<br>rewrite(8)</a>
210 </td>
212 <td> </td>
214 <td bgcolor="#f0f0ff" align="center"> <a href="smtp.8.html">smtp(8)</a> </td>
216 <td> <tt> -&gt; </tt> </td> <td> Network </td>
218 </tr>
220 <tr>
222 <td align="right"> <tt> / </tt> </td>
224 </tr>
226 <tr>
228 <td rowspan="2" colspan="4"> </td>
230 <td rowspan="2" align="center"> <table> <tr> <td align="center">
231 ^<br> <tt> | </tt> </td> <td align="center"> <tt> |<br> v </tt>
232 </td> </tr> </table> </td>
234 <td align="right"> <tt> - </tt> </td>
236 <td bgcolor="#f0f0ff" align="center"> <a href="lmtp.8.html">lmtp(8)</a> </td>
238 <td> <tt> -&gt; </tt> </td> <td> Network </td>
240 </tr>
242 <tr>
244 <td align="left"> <tt> / </tt> </td>
246 </tr>
248 <tr>
250 <td bgcolor="#f0f0ff" align="center"> <a
251 href="QSHAPE_README.html#incoming_queue"> incoming </a> </td>
253 <td> <tt> -&gt; </tt> </td>
255 <td bgcolor="#f0f0ff" align="center"> <a
256 href="QSHAPE_README.html#active_queue"> active </a> </td>
258 <td> <tt> -&gt; </tt> </td>
260 <td bgcolor="#f0f0ff" align="center"> <a href="qmgr.8.html">qmgr(8)</a> </td>
262 <td align="right"> <tt> --- </tt> </td>
264 <td bgcolor="#f0f0ff" align="center"> <a href="local.8.html">local(8)</a> </td>
266 <td> <tt> -&gt; </tt> </td> <td> File, command </td>
268 </tr>
270 <tr>
272 <td rowspan="2" colspan="2"> </td>
274 <td rowspan="2" align="center"> <table> <tr> <td align="center">
275 ^<br> <tt> | </tt> </td> <td align="center"> <tt> |<br> v </tt>
276 </td> </tr> </table> </td>
278 <td rowspan="2" colspan="2"> </td>
280 <td align="left"> <tt> \ </tt> </td>
282 </tr>
284 <tr>
286 <td align="right"> <tt> - </tt> </td>
288 <td bgcolor="#f0f0ff" align="center"> <a href="virtual.8.html">virtual(8)</a> </td>
290 <td> <tt> -&gt; </tt> </td> <td> File </td>
292 </tr>
294 <tr>
296 <td colspan="2"> </td>
298 <td bgcolor="#f0f0ff" align="center"> <a
299 href="QSHAPE_README.html#deferred_queue"> deferred </a> </td>
301 <td colspan="2"> </td>
303 <td align="right"> <tt> \ </tt> </td>
305 </tr>
307 <tr>
309 <td colspan="6">
311 <td bgcolor="#f0f0ff" align="center"> <a href="pipe.8.html">pipe(8)</a> </td>
313 <td> <tt> -&gt; </tt> </td> <td> Command </td>
315 </tr>
317 </table>
319 </blockquote>
321 <ul>
323 <li> <p> The queue manager (the <a href="qmgr.8.html">qmgr(8)</a> server process in the
324 figure) is the heart of Postfix mail delivery. It contacts the
325 <a href="smtp.8.html">smtp(8)</a>, <a href="lmtp.8.html">lmtp(8)</a>, <a href="local.8.html">local(8)</a>, <a href="virtual.8.html">virtual(8)</a>, <a href="pipe.8.html">pipe(8)</a>, <a href="discard.8.html">discard(8)</a> or
326 <a href="error.8.html">error(8)</a> delivery agents, and sends a delivery request for one
327 or more recipient addresses. The <a href="discard.8.html">discard(8)</a> and <a href="error.8.html">error(8)</a> delivery
328 agents are special: they discard or bounce all mail, and are not
329 shown in the figure above. </p>
331 <p> The queue manager maintains a small <a href="QSHAPE_README.html#active_queue">active queue</a> with the
332 messages that it has opened for delivery. The <a href="QSHAPE_README.html#active_queue">active queue</a> acts as
333 a limited window on potentially large <a href="QSHAPE_README.html#incoming_queue">incoming</a> or <a href="QSHAPE_README.html#deferred_queue">deferred queues</a>.
334 The limited <a href="QSHAPE_README.html#active_queue">active queue</a> prevents the queue manager from running
335 out of memory under heavy load. </p>
337 <p> The queue manager maintains a separate <a href="QSHAPE_README.html#deferred_queue">deferred queue</a> for mail
338 that cannot be delivered, so that a large mail backlog will not
339 slow down normal queue accesses. The queue manager's strategy for
340 delayed mail delivery attempts is described in the <a href="QSHAPE_README.html">QSHAPE_README</a>
341 and <a href="TUNING_README.html">TUNING_README</a> documents. </p>
343 <li> <p> The <a href="trivial-rewrite.8.html">trivial-rewrite(8)</a> server resolves each recipient
344 address according to its local or remote address class, as defined
345 in the <a href="ADDRESS_CLASS_README.html">ADDRESS_CLASS_README</a> document. Additional routing information
346 can be specified with the optional <a href="transport.5.html">transport(5)</a> table. The
347 <a href="trivial-rewrite.8.html">trivial-rewrite(8)</a> server optionally queries the <a href="relocated.5.html">relocated(5)</a> table
348 for recipients whose address has changed; mail for such recipients is
349 returned to the sender with an explanation. </p>
351 <li> <p> The <a href="smtp.8.html">smtp(8)</a> client looks up a list of mail exchangers for
352 the destination host, sorts the list by preference, and tries each
353 server in turn until it finds a server that responds. It then
354 encapsulates the sender, recipient and message content as required
355 by the SMTP protocol; this includes conversion of 8-bit MIME to
356 7-bit encoding. </p>
358 <li> <p> The <a href="lmtp.8.html">lmtp(8)</a> client speaks a protocol similar to SMTP that
359 is optimized for delivery to mailbox servers such as Cyrus. The
360 advantage of this setup is that one Postfix machine can feed multiple
361 mailbox servers over LMTP. The opposite is true as well: one
362 mailbox server can be fed over LMTP by multiple Postfix machines.
363 </p>
365 <li> <p> The <a href="local.8.html">local(8)</a> delivery agent understands UNIX-style mailboxes,
366 qmail-compatible maildir files, Sendmail-style system-wide <a href="aliases.5.html">aliases(5)</a>
367 databases, and Sendmail-style per-user .forward files. Multiple
368 local delivery agents can be run in parallel, but parallel delivery
369 to the same user is usually limited. </p>
371 <p> The <a href="local.8.html">local(8)</a> delivery agent has hooks for alternative forms of
372 local delivery: you can configure it to deliver to mailbox files
373 in user home directories, you can configure it to delegate mailbox
374 delivery to an external command such as procmail, or you can delegate
375 delivery to a different Postfix delivery agent. </p>
377 <li> <p> The <a href="virtual.8.html">virtual(8)</a> delivery agent is a bare-bones delivery
378 agent that delivers to UNIX-style mailbox or qmail-style maildir
379 files only. This delivery agent can deliver mail for multiple
380 domains, which makes it especially suitable for hosting lots of
381 small domains on a single machine. This is described in the
382 <a href="VIRTUAL_README.html">VIRTUAL_README</a> document. </p>
384 <li> <p> The <a href="pipe.8.html">pipe(8)</a> mailer is the outbound interface to other mail
385 processing systems (the Postfix <a href="sendmail.1.html">sendmail(1)</a> command being the
386 inbound interface). The interface is UNIX compatible: it provides
387 information on the command line and on the standard input stream,
388 and expects a process exit status code as defined in &lt;sysexits.h&gt;.
389 Examples of delivery via the <a href="pipe.8.html">pipe(8)</a> mailer are in the <a href="MAILDROP_README.html">MAILDROP_README</a>
390 and <a href="UUCP_README.html">UUCP_README</a> documents.
392 </ul>
394 <h2> <a name="behind"> Postfix behind the scenes </a> </h2>
396 <p> The previous sections gave an overview of how Postfix server
397 processes send and receive mail. These server processes rely on
398 other server processes that do things behind the scenes. The text
399 below attempts to visualize each service in its own context. As
400 before, names followed by a number are Postfix commands or server
401 programs, while unnumbered names inside shaded areas represent
402 Postfix queues. </p>
404 <ul>
406 <li> <p> The resident <a href="master.8.html">master(8)</a> server is the supervisor that keeps
407 an eye on the well-being of the Postfix mail system. It is typically
408 started at system boot time with the "postfix start" command, and
409 keeps running until the system goes down. The <a href="master.8.html">master(8)</a> server is
410 responsible for starting Postfix server processes to receive and
411 deliver mail, and for restarting servers that terminate prematurely
412 because of some problem. The <a href="master.8.html">master(8)</a> server is also responsible
413 for enforcing the server process count limits as specified in the
414 <a href="master.5.html"><b>master.cf</b></a> configuration file. The picture below gives the
415 program hierarchy when Postfix is started up. Only some of the mail
416 handling daemon processes are shown. </p>
418 <table>
420 <tr> <td colspan="2"> </td> <td align="center" bgcolor="#f0f0ff">
421 <a href="postfix.1.html">postfix(1)</a> </td> </tr>
423 <tr> <td colspan="2"> </td> <td align="center"> |<br> |</td> </tr>
425 <tr> <td colspan="2"> </td> <td align="center" bgcolor="#f0f0ff">
426 postfix-script(1) </td> </tr>
428 <tr> <td> </td> <td> <table> <tr> <td> </td> <td> / </td> </tr>
429 <tr> <td> / </td> <td> </td> </tr> </table> </td> <td align="center">
430 |<br> |</td> <td> <table> <tr> <td> \ </td> <td> </td> </tr> <tr>
431 <td> </td> <td> \ </td> </tr> </table> </td> </tr>
433 <tr> <td align="center" bgcolor="#f0f0ff"> <a href="postsuper.1.html">postsuper(1)</a> </td> <td>
434 </td> <td align="center" bgcolor="#f0f0ff"> <a href="master.8.html">master(8)</a> </td> <td>
435 </td> <td align="center" bgcolor="#f0f0ff"> <a href="postlog.1.html">postlog(1)</a> </td> </tr>
437 <tr> <td> </td> <td> <table> <tr> <td> </td> <td> / </td> </tr>
438 <tr> <td> / </td> <td> </td> </tr> </table> </td> <td align="center">
439 |<br> |</td> <td> <table> <tr> <td> \ </td> <td> </td> </tr> <tr>
440 <td> </td> <td> \ </td> </tr> </table> </td> </tr>
442 <tr> <td align="center" bgcolor="#f0f0ff"> <a href="smtpd.8.html">smtpd(8)</a> </td> <td>
443 </td> <td align="center" bgcolor="#f0f0ff"> <a href="qmgr.8.html">qmgr(8)</a> </td> <td>
444 </td> <td align="center" bgcolor="#f0f0ff"> <a href="local.8.html">local(8)</a> </td> </tr>
446 </table>
448 <li> <p> The <a href="anvil.8.html">anvil(8)</a> server implements client connection and
449 request rate
450 limiting for all <a href="smtpd.8.html">smtpd(8)</a> servers. The <a href="TUNING_README.html">TUNING_README</a> document
451 provides guidance for dealing with mis-behaving SMTP clients. The
452 <a href="anvil.8.html">anvil(8)</a> service is available in Postfix version 2.2 and later.
453 </p>
455 <table>
457 <tr> <td> Network </td> <td> <tt> -&gt; </tt> </td> <td align="center"
458 bgcolor="#f0f0ff"> <br> <a href="smtpd.8.html">smtpd(8)</a><br><br> </td> <td> <tt> &lt;-&gt;
459 </tt> </td> <td align="center" bgcolor="#f0f0ff"> <br> <a href="anvil.8.html">anvil(8)</a><br><br>
460 </td> </tr>
462 </table>
464 <li> <p> The <a href="bounce.8.html">bounce(8)</a>, <a href="defer.8.html">defer(8)</a> and <a href="trace.8.html">trace(8)</a> services each maintain
465 their own queue directory trees with per-message logfiles. Postfix
466 uses this information when sending "failed", "delayed" or "success"
467 delivery status notifications to the sender. </p>
469 <p> The <a href="trace.8.html">trace(8)</a> service also implements support for the Postfix
470 "sendmail
471 -bv" and "sendmail -v" commands which produce reports about how
472 Postfix delivers mail, and is available with Postfix version 2.1
473 and later. See <a href="DEBUG_README.html#trace_mail"> DEBUG_README
474 </a> for examples. </p>
476 <table>
478 <tr> <td align="center" bgcolor="#f0f0ff"> <a href="cleanup.8.html">cleanup(8)</a> </td> <td
479 valign="middle"> <tt> -&gt; </tt> </td> <td align="center"
480 bgcolor="#f0f0ff"> <a href="qmgr.8.html">qmgr(8)</a><br> Postfix<br> queue </td> <td
481 valign="middle"> <tt> -&gt; </tt> </td> <td align="center"
482 bgcolor="#f0f0ff"> Delivery<br> agents</td> </tr>
484 <tr> <td align="center"> ^<br> <tt> | </tt> </td> <td> </td> <td
485 align="center"> <tt> |<br> v </tt> </td> <td> </td> <td align="center">
486 <tt> |<br> v </tt> </td> </tr>
488 <tr> <td align="center"> (Non-)<br> delivery<br> notice </td> <td
489 valign="middle"> <tt> &lt;- </tt> </td> <td align="center"
490 bgcolor="#f0f0ff"> <a href="bounce.8.html">bounce(8)</a><br> <a href="defer.8.html">defer(8)</a><br> <a href="trace.8.html">trace(8)</a> </td> <td
491 valign="middle"> <tt> &lt;- </tt> </td> <td align="center"> Queue
492 id,<br> recipient,<br> status</td> </tr>
494 <tr> <td colspan="2"> </td> <td align="center"> <table> <tr> <td
495 align="center"> ^<br> <tt> | </tt> </td> <td align="center"> <tt>
496 |<br> v </tt> </td> </tr> </table> </td> </tr>
498 <tr> <td colspan="2"> </td> <td align="center" bgcolor="#f0f0ff">
499 Per- <br> message<br> logfiles </td> </tr>
501 </table>
503 <li> <p> The <a href="flush.8.html">flush(8)</a> servers maintain per-destination logs and
504 implement both ETRN and "sendmail -qRdestination", as described
505 in the <a href="ETRN_README.html">ETRN_README</a> document. This moves selected queue files from
506 the <a href="QSHAPE_README.html#deferred_queue">deferred queue</a> back to the <a href="QSHAPE_README.html#incoming_queue">incoming queue</a> and requests their
507 delivery. The <a href="flush.8.html">flush(8)</a> service is available with Postfix version
508 1.0 and later. </p>
510 <table>
512 <tr> <td colspan="4"> </td> <td align="center" bgcolor="#f0f0ff">
513 <a href="QSHAPE_README.html#incoming_queue"> incoming </a><br>^
514 <br><a href="QSHAPE_README.html#deferred_queue"> deferred </a>
515 </td> </tr>
517 <tr> <td colspan="4"> </td> <td align="center"> ^<br> |</td> </tr>
519 <tr> <td align="center" bgcolor="#f0f0ff"> <a href="smtpd.8.html">smtpd(8)</a><br> <a href="sendmail.1.html">sendmail(1)</a><br>
520 <a href="postqueue.1.html">postqueue(1)</a> </td> <td> <tt> - </tt> </td> <td align="center">
521 Destination<br> to flush</td> <td> <tt> -&gt; </tt> </td> <td
522 align="center" bgcolor="#f0f0ff"> <a href="flush.8.html">flush(8)</a> </td> <td> <tt> &lt;-
523 </tt> </td> <td align="center"> Deferred<br> destination,<br> queue
524 id </td> <td> <tt> - </tt> </td> <td align="center" bgcolor="#f0f0ff">
525 Delivery<br> agents,<br> <a href="qmgr.8.html">qmgr(8)</a> </td> </tr>
527 <tr> <td colspan="4"> </td> <td align="center"> <table> <tr> <td
528 align="center"> ^<br> <tt> | </tt> </td> <td align="center"> <tt>
529 |<br> v </tt> </td> </tr> </table> </td> </tr>
531 <tr> <td colspan="4"> </td> <td align="center"> Per-dest-<br>
532 ination<br> logs </td> </tr>
534 </table>
536 <li> <p> The <a href="proxymap.8.html">proxymap(8)</a> servers provide read-only and read-write
537 table lookup
538 service to Postfix processes. This overcomes chroot restrictions,
539 reduces the number of open lookup tables by sharing one open
540 table among multiple processes, and implements single-updater
541 tables. </p>
543 <li> <p> The <a href="scache.8.html">scache(8)</a> server maintains the connection cache for
544 the Postfix <a href="smtp.8.html">smtp(8)</a> client. When connection caching is enabled for
545 selected destinations, the <a href="smtp.8.html">smtp(8)</a> client does not disconnect
546 immediately after a mail transaction, but gives the connection to
547 the connection cache server which keeps the connection open for a
548 limited amount of time. The <a href="smtp.8.html">smtp(8)</a> client continues with some
549 other mail delivery request. Meanwhile, any <a href="smtp.8.html">smtp(8)</a> process can
550 ask the <a href="scache.8.html">scache(8)</a> server for that cached connection and reuse it
551 for mail delivery. As a safety measure, Postfix limits the number
552 of times that a connection may be reused. </p>
554 <p> When delivering mail to a destination with multiple mail servers,
555 connection caching can help to skip over a non-responding server,
556 and thus dramatically speed up delivery. SMTP connection caching
557 is available in Postfix version 2.2 and later. More information
558 about this feature is in the <a href="CONNECTION_CACHE_README.html">CONNECTION_CACHE_README</a> document. </p>
560 <table>
562 <tr> <td> </td> <td> <tt> /-- </tt> </td> <td align="center"
563 colspan="3" bgcolor="#f0f0ff"> <a href="smtp.8.html">smtp(8)</a> </td> <td colspan="2"> <tt>
564 --&gt; </tt> Internet </td> </tr>
566 <tr> <td align="center" bgcolor="#f0f0ff"> <a href="qmgr.8.html">qmgr(8)</a> </td> <td> </td>
567 <td align="center" rowspan="3"> &nbsp; </td> <td align="center"
568 rowspan="3"><tt>|<br>|<br>|<br>|<br>v</tt></td> <td> &nbsp; </td>
569 </tr>
571 <tr> <td> </td> <td> <tt> \-- </tt> </td> <td align="center"
572 colspan="2" bgcolor="#f0f0ff"> <a href="smtp.8.html">smtp(8)</a> </td> <td align="left"> <tt>
573 --&gt; </tt> Internet </td> </tr>
575 <tr> <td colspan="3"> </td> <td align="center"><tt>^<br>|</tt></td>
576 <td> &nbsp; </td> </tr>
578 <tr> <td colspan="3"> </td> <td align="center" colspan="3"
579 bgcolor="#f0f0ff"> <a href="scache.8.html">scache(8)</a> </td> </tr>
581 </table>
583 <li> <p> The <a href="showq.8.html">showq(8)</a> servers list the Postfix queue status. This
584 is the queue listing service that does the work for the <a href="mailq.1.html">mailq(1)</a>
585 and <a href="postqueue.1.html">postqueue(1)</a> commands. </p>
587 <table>
589 <tr> <td> Output </td> <td> <tt> &lt;- </tt> </td> <td align="center"
590 bgcolor="#f0f0ff"> <a href="mailq.1.html">mailq(1)</a><br>
592 <a href="postqueue.1.html"> post-<br>queue(1) </a> <br> </td> <td>
593 <tt> &lt;- </tt> </td> <td align="center" valign="middle"
594 bgcolor="#f0f0ff"> <a href="showq.8.html">showq(8)</a> </td> <td> <tt> &lt;- </tt></td> <td
595 align="center" valign="middle" bgcolor="#f0f0ff"> Postfix<br> queue
596 </td> </tr>
598 </table>
600 <li> <p> The <a href="spawn.8.html">spawn(8)</a> servers run non-Postfix commands on request,
601 with the client connected via socket or FIFO to the command's
602 standard input, output and error streams. You can find examples of
603 its use in the <a href="SMTPD_POLICY_README.html">SMTPD_POLICY_README</a> document. </p>
605 <li> <p> The <a href="tlsmgr.8.html">tlsmgr(8)</a> server runs when TLS (Transport Layer
606 Security, formerly known as SSL) is turned on in the Postfix <a href="smtp.8.html">smtp(8)</a>
607 client or <a href="smtpd.8.html">smtpd(8)</a> server. This process has two duties: </p>
609 <ul>
611 <li> <p> Maintain the pseudo-random number generator (PRNG) that
612 is used to seed the TLS engines in Postfix <a href="smtp.8.html">smtp(8)</a> client or <a href="smtpd.8.html">smtpd(8)</a>
613 server processes. The state of this PRNG is periodically saved to
614 a file, and is read when <a href="tlsmgr.8.html">tlsmgr(8)</a> starts up. </p>
616 <li> <p> Maintain the optional Postfix <a href="smtp.8.html">smtp(8)</a> client or <a href="smtpd.8.html">smtpd(8)</a>
617 server caches with TLS session keys. Saved keys can improve
618 performance by reducing the amount of computation at the start of
619 a TLS session. </p>
621 </ul>
623 <p> TLS support is available in Postfix version 2.2 and later.
624 Information about the Postfix TLS implementation is in the <a href="TLS_README.html">TLS_README</a>
625 document. </p>
627 <table>
629 <tr> <td>Network<tt>-&gt; </tt> </td> <td align="center"
630 bgcolor="#f0f0ff"> <br> <a href="smtpd.8.html">smtpd(8)</a> <br> &nbsp; </td> <td colspan="2">
631 <tt> &lt;---seed---<br><br>&lt;-session-&gt; </tt> </td> <td
632 align="center" bgcolor="#f0f0ff"> <br> <a href="tlsmgr.8.html">tlsmgr(8)</a> <br> &nbsp; </td>
633 <td colspan="3"> <tt> ---seed---&gt;<br> <br>&lt;-session-&gt;
634 </tt> </td> <td align="center" bgcolor="#f0f0ff"> <br> <a href="smtp.8.html">smtp(8)</a> <br>
635 &nbsp; </td> <td> <tt> -&gt;</tt>Network </td> </tr>
637 <tr> <td colspan="3"> </td> <td align="right"> <table> <tr> <td>
638 </td> <td> / </td> </tr> <tr> <td> / </td> <td> </td> </tr> </table>
639 </td> <td align="center"> |<br> |</td> <td align="left"> <table>
640 <tr> <td> \ </td> <td> </td> </tr> <tr> <td> </td> <td> \ </td>
641 </tr> </table> </td> <td colspan="3"> </td> </tr>
643 <tr> <td colspan="2"> </td> <td align="center" bgcolor="#f0f0ff">
644 smtpd<br> session<br> cache </td> <td> </td> <td align="center"
645 bgcolor="#f0f0ff"> PRNG<br> state <br>file </td> <td> </td> <td
646 align="center" bgcolor="#f0f0ff"> smtp<br> session<br> cache </td>
647 <td colspan="2"> </td> </tr>
649 </table>
652 <li> <p> The <a href="verify.8.html">verify(8)</a> server verifies that a sender or recipient
653 address is deliverable before the <a href="smtpd.8.html">smtpd(8)</a> server accepts it. The
654 <a href="verify.8.html">verify(8)</a> server queries a cache with address verification results.
655 If a result is not found, the <a href="verify.8.html">verify(8)</a> server injects a probe
656 message into the Postfix queue and processes the status update from
657 a delivery agent or queue manager.
658 This process is described in the <a href="ADDRESS_VERIFICATION_README.html">ADDRESS_VERIFICATION_README</a>
659 document. The <a href="verify.8.html">verify(8)</a> service is available with Postfix version
660 2.1 and later. </p>
662 <table>
664 <tr>
666 <td rowspan="2" colspan="5" align="center" valign="middle">
667 &nbsp; </td> <td rowspan="3" align="center" valign="bottom">
668 <tt> -&gt; </tt> </td> <td rowspan="3" align="center"
669 valign="middle"> probe<br> message </td> <td rowspan="3"
670 align="center" valign="middle"> <tt> -&gt; </tt> </td> <td
671 rowspan="3" bgcolor="#f0f0ff" align="center" valign="middle">
672 Postfix<br> mail<br> queue </td>
674 </tr>
676 <tr> <td> </td> </tr>
678 <tr>
680 <td rowspan="3" align="center" valign="middle"> Network </td>
681 <td rowspan="3" align="center" valign="middle"> <tt> -&gt; </tt>
682 </td> <td rowspan="3" bgcolor="#f0f0ff" align="center"
683 valign="middle"> <a href="smtpd.8.html">smtpd(8)</a> </td> <td rowspan="3" align="center"
684 valign="middle"> <tt> &lt;-&gt; </tt> </td> <td rowspan="3"
685 bgcolor="#f0f0ff" align="center" valign="middle"> <a href="verify.8.html">verify(8)</a>
686 </td>
688 </tr>
690 <tr>
692 <td rowspan="1" colspan="3"> </td> <td rowspan="1" align="center"
693 valign="middle"> <tt> |</tt><br> <tt> v</tt> </td>
695 </tr>
697 <tr>
699 <td rowspan="3" align="center" valign="top"> <tt> &lt;- </tt>
700 </td> <td rowspan="3" align="center" valign="middle"> probe<br>
701 status </td> <td rowspan="3" align="center" valign="middle">
702 <tt> &lt;- </tt> </td> <td rowspan="3" bgcolor="#f0f0ff"
703 align="center" valign="middle"> Postfix<br> delivery<br> agents
704 </td> <td rowspan="3" align="left" valign="middle"> <tt>-&gt;</tt>
705 Local<br> <tt>-&gt;</tt> Network</td>
707 </tr>
709 <tr>
711 <td rowspan="3" colspan="4" align="center" valign="middle">
712 &nbsp; </td> <td rowspan="3" align="center" valign="middle">
713 <tt> ^</tt><br> <tt> |</tt><br> <tt> v</tt> </td>
715 </tr>
717 <tr> <td> </td> </tr>
719 <tr> <td colspan="4"> &nbsp; </td> </tr>
721 <tr>
723 <td colspan="4" align="center" valign="middle"> &nbsp; </td>
724 <td bgcolor="#f0f0ff" align="center" valign="middle"> Address<br>
725 verification<br> cache </td>
727 </tr>
729 </table>
731 <li> <p> The <a href="postscreen.8.html">postscreen(8)</a> server can be put "in front" of Postfix
732 <a href="smtpd.8.html">smtpd(8)</a> processes. Its purpose is to accept connections from the
733 network and to decide what SMTP clients are allowed to talk to
734 Postfix. According to the 2008 MessageLabs annual report, 81% of
735 all email was spam, and 90% of that was sent by botnets; by 2010,
736 those numbers were 92% and 95%, respectively. While <a href="postscreen.8.html">postscreen(8)</a>
737 keeps the zombies away, more <a href="smtpd.8.html">smtpd(8)</a> processes remain available
738 for legitimate clients. </p>
740 <p> The <a href="postscreen.8.html">postscreen(8)</a> server is available with Postfix 2.8 and
741 later. To keep the implementation simple, <a href="postscreen.8.html">postscreen(8)</a> delegates
742 DNS white/backlist lookups to <a href="dnsblog.8.html">dnsblog(8)</a> server processes, and
743 delegates TLS encryption/decryption to <a href="tlsproxy.8.html">tlsproxy(8)</a> server processes.
744 This delegation is invisible to the remote SMTP client, and is not
745 shown in the diagram below. </p>
747 <table>
749 <tr> <td> zombie </td> </tr>
751 <tr> <td> </td> <td align="left"> <tt> \ </tt> </td> </tr>
753 <tr> <td> zombie </td> <td align="left"> <tt> - </tt> </td> <td>
754 </td> <td> </td> <td> </td> <td align="right"> <tt> - </tt> </td>
755 <td bgcolor="#f0f0ff" align="center"> <a href="smtpd.8.html">smtpd(8)</a> </td> </tr>
757 <tr> <td> </td> <td align="right"> <tt> \ </tt> </td> <td> </td>
758 <td align="left"> <tt> / </tt> </td> </tr>
760 <tr> <td bgcolor="#f0f0ff" align="center"> other </td> <td> <tt>
761 --- </tt> </td> <td bgcolor="#f0f0ff" align="center" valign="middle">
762 <a href="postscreen.8.html">postscreen(8)</a> </td> </tr>
764 <tr> <td> </td> <td align="right"> <tt> / </tt> </td> <td> </td>
765 <td align="right"> <tt> \ </tt> </td> </tr>
767 <tr> <td bgcolor="#f0f0ff" align="center"> other </td> <td align="left">
768 <tt> - </tt> </td> <td> </td> <td> </td> <td> </td> <td align="right">
769 <tt> - </tt> </td> <td bgcolor="#f0f0ff" align="center"> <a href="smtpd.8.html">smtpd(8)</a>
770 </td> </tr>
772 <tr> <td> </td> <td align="left"> <tt> / </tt> </td> </tr>
774 <tr> <td> zombie </td> </tr>
777 </table>
779 </ul>
781 <h2> <a name="commands"> Postfix support commands </a> </h2>
783 <p> The Postfix architecture overview ends with a summary of
784 command-line utilities for day-to-day use of the Postfix mail
785 system. Besides the Sendmail-compatible <a href="sendmail.1.html">sendmail(1)</a>, <a href="mailq.1.html">mailq(1)</a>, and
786 <a href="newaliases.1.html">newaliases(1)</a> commands, the Postfix system comes with it own
787 collection of command-line utilities. For consistency, these are
788 all named post<i>something</i>. </p>
790 <ul>
792 <li> <p> The <a href="postfix.1.html">postfix(1)</a> command controls the operation of the mail
793 system. It is the interface for starting, stopping, and restarting
794 the mail system, as well as for some other administrative operations.
795 This command is reserved to the super-user. </p>
797 <li> <p> The <a href="postalias.1.html">postalias(1)</a> command maintains Postfix <a href="aliases.5.html">aliases(5)</a> type
798 databases. This is the program that does the work for the
799 <a href="newaliases.1.html">newaliases(1)</a> command. </p>
801 <li> <p> The <a href="postcat.1.html">postcat(1)</a> command displays the contents of Postfix
802 queue files. This is a limited, preliminary utility. This program
803 is likely to be superseded by something more powerful that can also
804 edit Postfix queue files. </p>
806 <li> <p> The <a href="postconf.1.html">postconf(1)</a> command displays or updates Postfix <a href="postconf.5.html">main.cf</a>
807 parameters and displays system dependent information about the
808 supported file locking methods, and the supported types of lookup
809 tables. </p>
811 <li> <p> The <a href="postdrop.1.html">postdrop(1)</a> command is the mail posting utility that
812 is run by the Postfix <a href="sendmail.1.html">sendmail(1)</a> command in order to deposit mail
813 into the <a href="QSHAPE_README.html#maildrop_queue">maildrop queue</a> directory. </p>
815 <li> <p> The <a href="postkick.1.html">postkick(1)</a> command makes some Postfix internal
816 communication channels available for use in, for example, shell
817 scripts. </p>
819 <li> <p> The <a href="postlock.1.html">postlock(1)</a> command provides Postfix-compatible mailbox
820 locking for use in, for example, shell scripts. </p>
822 <li> <p> The <a href="postlog.1.html">postlog(1)</a> command provides Postfix-compatible logging
823 for shell scripts. </p>
825 <li> <p> The <a href="postmap.1.html">postmap(1)</a> command maintains Postfix lookup tables
826 such as <a href="canonical.5.html">canonical(5)</a>, <a href="virtual.5.html">virtual(5)</a> and others. It is a cousin of the
827 UNIX makemap command. </p>
829 <li> <p> The <a href="postmulti.1.html">postmulti(1)</a> command repeats the "postfix start" etc.
830 command for each Postfix instance, and supports creation, deletion
831 etc. of Postfix instances. For a tutorial, see <a href="MULTI_INSTANCE_README.html">MULTI_INSTANCE_README</a>.
832 </p>
834 <li> <p> The <a href="postqueue.1.html">postqueue(1)</a> command is the privileged command that
835 is run by Postfix <a href="sendmail.1.html">sendmail(1)</a> and <a href="mailq.1.html">mailq(1)</a> in order to flush or
836 list the
837 mail queue. </p>
839 <li> <p> The <a href="postsuper.1.html">postsuper(1)</a> command maintains the Postfix queue. It
840 removes old temporary files, and moves queue files into the right
841 directory after a change in the hashing depth of queue directories.
842 This command is run at mail system startup time and when Postfix
843 is restarted. </p>
845 </ul>
847 </body>
849 </html>