]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.8-20110115
authorWietse Venema <wietse@porcupine.org>
Sat, 15 Jan 2011 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:36:59 +0000 (06:36 +0000)
37 files changed:
postfix/HISTORY
postfix/README_FILES/OVERVIEW
postfix/README_FILES/POSTSCREEN_README
postfix/WISHLIST
postfix/html/OVERVIEW.html
postfix/html/POSTSCREEN_README.html
postfix/html/dnsblog.8.html
postfix/html/postconf.5.html
postfix/html/postfix-manuals.html
postfix/html/postfix.1.html
postfix/html/postscreen.8.html
postfix/man/man1/postfix.1
postfix/man/man5/postconf.5
postfix/man/man8/dnsblog.8
postfix/man/man8/postscreen.8
postfix/mantools/postlink
postfix/proto/OVERVIEW.html
postfix/proto/POSTSCREEN_README.html
postfix/proto/postconf.proto
postfix/proto/stop
postfix/src/dnsblog/dnsblog.c
postfix/src/global/mail_params.h
postfix/src/global/mail_proto.h
postfix/src/global/mail_version.h
postfix/src/postfix/postfix.c
postfix/src/postscreen/Makefile.in
postfix/src/postscreen/postscreen.c
postfix/src/postscreen/postscreen_dnsbl.c
postfix/src/postscreen/postscreen_starttls.c
postfix/src/smtpd/smtpd.c
postfix/src/tls/Makefile.in
postfix/src/tls/tls_proxy.h
postfix/src/tls/tls_proxy_clnt.c
postfix/src/tlsproxy/tlsproxy.c
postfix/src/util/dict_ht.c
postfix/src/util/mymalloc.c
postfix/src/util/sys_defs.h

index 43f0b42b7833db44c1abce180a7413f90d1b31e0..c2947e85339e45c901b8b814956d56fb654c8b5b 100644 (file)
@@ -16441,3 +16441,19 @@ Apologies for any names omitted.
        that temporarily switch control to an external program such
        as tlsproxy, or perhaps a future policy plugin.  Files:
        postscreen/postscreen_smtpd, postscreen/postscreen_starttls.c.
+
+20110113
+
+       Cleanup: ps_cache and psc_cache are now postscreen_cache.
+       There is no need for obscure name abbrevations. File:
+       src/global/mail_params.h.
+
+20110115
+
+       Workaround: malloc fuzz (safety margin for malloc requests).
+       Files: util/sys_defs.h, util/mymalloc.c.
+
+       Cleanup: dnsblog_service_name and tlsproxy_service_name are
+       now configurable, in case someone needs this. Files:
+       global/mail_params.h, postscreen/postscreen.c, mantools/postlink,
+       proto/postconf.proto.
index 95a3056b9af98e703a9c9a6007a7e5aa972c8968..ee271e61b9d861d12ef9a762a3ed98c76f044c8b 100644 (file)
@@ -366,12 +366,15 @@ queues.
     processes. Its purpose is to accept connections from the network and to
     decide what SMTP clients are allowed to talk to Postfix. According to the
     2008 MessageLabs annual report, 81% of all email was spam, and 90% of that
-    was sent by botnets. While postscreen(8) keeps the zombies away, more smtpd
-    (8) processes remain available for legitimate clients.
-
-    The postscreen(8) server is still evolving, and is likely to undergo
-    changes that break compatibility with earlier versions. For this reason the
-    postscreen(8) server is not installed with the stable Postfix release.
+    was sent by botnets; by 2010, those numbers were 92% and 95%, respectively.
+    While postscreen(8) keeps the zombies away, more smtpd(8) processes remain
+    available for legitimate clients.
+
+    The postscreen(8) server is available with Postfix 2.8 and later. To keep
+    the implementation simple, postscreen(8) delegates DNS white/backlist
+    lookups to dnsblog(8) server processes, and delegates TLS encryption/
+    decryption to tlsproxy(8) server processes. This delegation is invisible to
+    the remote SMTP client, and is not shown in the diagram below.
 
     zombie
 
index 6e93ddff497706af3bd99f76aaaebf8cc9c4943f..0f83617ae92b8e3e7d636648baa2ec477b71ac9f 100644 (file)
@@ -473,6 +473,7 @@ postscreen(8) has been tested on FreeBSD [4-8], Linux 2.[4-6] and Solaris 9
 systems.
 
   * Turning on postscreen(8) without blocking mail
+  * postscreen(8) TLS configuration
   * Blocking mail with postscreen(8)
   * Turning off postscreen(8)
 
@@ -555,6 +556,23 @@ Notes:
     ("postfix stop; postfix start"). This is needed because the Postfix "pass"
     master service type did not work reliably on all systems.
 
+p\bpo\bos\bst\bts\bsc\bcr\bre\bee\ben\bn(\b(8\b8)\b) T\bTL\bLS\bS c\bco\bon\bnf\bfi\big\bgu\bur\bra\bat\bti\bio\bon\bn
+
+postscreen(8) TLS support is available for remote SMTP clients that aren't
+whitelisted, including clients that need to renew their temporary whitelist
+status. When a remote SMTP client requests TLS service, postscreen(8) invisibly
+hands off the connection to a tlsproxy(8) process. Then, tlsproxy(8) encrypts
+and decrypts the traffic between postscreen(8) and the remote SMTP client. One
+tlsproxy(8) process can handle multiple SMTP sessions. The number of tlsproxy
+(8) processes slowly increases with server load, but it should always be much
+smaller than the number of postscreen(8) TLS sessions.
+
+TLS support for postscreen(8) and tlsproxy(8) uses the same parameters as with
+smtpd(8). We recommend that you keep the relevant configuration parameters in
+main.cf. If you must specify "-o smtpd_mumble=value" parameter overrides in
+master.cf for a postscreen-protected smtpd(8) service, then you should specify
+those same parameter overrides for the postscreen(8) and tlsproxy(8) services.
+
 B\bBl\blo\boc\bck\bki\bin\bng\bg m\bma\bai\bil\bl w\bwi\bit\bth\bh p\bpo\bos\bst\bts\bsc\bcr\bre\bee\ben\bn(\b(8\b8)\b)
 
 To use the postscreen(8) service to block mail, edit main.cf and specify one or
index b11bcc0834ba50ec2a75e8ff2615aea6a716b909..7004a33b3c88d55c71c17b4ecf2e919ad629f260 100644 (file)
@@ -4,8 +4,6 @@ Wish list:
 
        Remove this file from the stable release.
 
-       Make tlsproxy_service and dnsblog_service configurable.
-
        Things to do after the stable release:
 
        When does it pay off to send domains in the active queue
index 689b340fb9097b2a846ae8ee18862bd99d2265c3..adc415ee923344284886457e22cbd705a33c6dd5 100644 (file)
@@ -732,14 +732,17 @@ document.  The <a href="verify.8.html">verify(8)</a> service is available with P
 <a href="smtpd.8.html">smtpd(8)</a> processes. Its purpose is to accept connections from the
 network and to decide what SMTP clients are allowed to talk to
 Postfix.  According to the 2008 MessageLabs annual report, 81% of
-all email was spam, and 90% of that was sent by botnets.  While
-<a href="postscreen.8.html">postscreen(8)</a> keeps the zombies away, more <a href="smtpd.8.html">smtpd(8)</a> processes remain
-available for legitimate clients.  </p>
-
-<p> The <a href="postscreen.8.html">postscreen(8)</a> server is still evolving, and is likely to
-undergo changes that break compatibility with earlier versions.
-For this reason the <a href="postscreen.8.html">postscreen(8)</a> server is not installed with the
-stable Postfix release. </p>
+all email was spam, and 90% of that was sent by botnets; by 2010,
+those numbers were 92% and 95%, respectively.  While <a href="postscreen.8.html">postscreen(8)</a>
+keeps the zombies away, more <a href="smtpd.8.html">smtpd(8)</a> processes remain available
+for legitimate clients.  </p>
+
+<p> The <a href="postscreen.8.html">postscreen(8)</a> server is available with Postfix 2.8 and
+later. To keep the implementation simple, <a href="postscreen.8.html">postscreen(8)</a> delegates
+DNS white/backlist lookups to <a href="dnsblog.8.html">dnsblog(8)</a> server processes, and
+delegates TLS encryption/decryption to <a href="tlsproxy.8.html">tlsproxy(8)</a> server processes.
+This delegation is invisible to the remote SMTP client, and is not
+shown in the diagram below.  </p>
 
 <table>
 
index 11259a64a63d309641d041b8fffe317d4bcc518d..6dd5799def98d1dc052bcaddbd3b95d486b55777 100644 (file)
@@ -657,6 +657,8 @@ and Solaris 9 systems. </p>
 <li> <a href="#enable"> Turning on postscreen(8) without blocking
 mail</a>
 
+<li> <a href="#starttls"> postscreen(8) TLS configuration </a>
+
 <li> <a href="#blocking"> Blocking mail with postscreen(8) </a>
 
 <li> <a href="#turnoff"> Turning off postscreen(8) </a>
@@ -777,6 +779,27 @@ work reliably on all systems. </p>
 
 </ul>
 
+<h3> <a name="starttls"> postscreen(8) TLS configuration </a> </h3>
+
+<p> <a href="postscreen.8.html">postscreen(8)</a> TLS support is available for remote SMTP clients
+that aren't whitelisted, including clients that need to renew their
+temporary whitelist status.  When a remote SMTP client requests TLS
+service, <a href="postscreen.8.html">postscreen(8)</a> invisibly hands off the connection to a
+<a href="tlsproxy.8.html">tlsproxy(8)</a> process. Then, <a href="tlsproxy.8.html">tlsproxy(8)</a> encrypts and decrypts the
+traffic between <a href="postscreen.8.html">postscreen(8)</a> and the remote SMTP client. One
+<a href="tlsproxy.8.html">tlsproxy(8)</a> process can handle multiple SMTP sessions. The number
+of <a href="tlsproxy.8.html">tlsproxy(8)</a> processes slowly increases with server load, but it
+should always be much smaller than the number of <a href="postscreen.8.html">postscreen(8)</a> TLS
+sessions.  </p>
+
+<p> TLS support for <a href="postscreen.8.html">postscreen(8)</a> and <a href="tlsproxy.8.html">tlsproxy(8)</a> uses the same
+parameters as with <a href="smtpd.8.html">smtpd(8)</a>. We recommend that you keep the relevant
+configuration parameters in <a href="postconf.5.html">main.cf</a>.  If you must specify "-o
+smtpd_mumble=value" parameter overrides in <a href="master.5.html">master.cf</a> for a
+postscreen-protected <a href="smtpd.8.html">smtpd(8)</a> service, then you should specify those
+same parameter overrides for the <a href="postscreen.8.html">postscreen(8)</a> and <a href="tlsproxy.8.html">tlsproxy(8)</a>
+services. </p>
+
 <h3> <a name="blocking"> Blocking mail with postscreen(8) </a> </h3>
 
 <p> To use the <a href="postscreen.8.html">postscreen(8)</a> service to block mail, edit <a href="postconf.5.html">main.cf</a> and
index 8306a6677beab59d1d9c533a91789499737dd358..ab257ea38e65873986ec2644c9b4f2108a23585b 100644 (file)
@@ -7,24 +7,24 @@
 DNSBLOG(8)                                                          DNSBLOG(8)
 
 <b>NAME</b>
-       dnsblog - Postfix DNS blocklist logger
+       dnsblog - Postfix DNS white/blacklist logger
 
 <b>SYNOPSIS</b>
        <b>dnsblog</b> [generic Postfix daemon options]
 
 <b>DESCRIPTION</b>
-       The  <a href="dnsblog.8.html"><b>dnsblog</b>(8)</a>  server implements an ad-hoc DNS blocklist
-       lookup service that will eventually be replaced by an  UDP
-       client  that  is  built  directly  into  the <a href="postscreen.8.html"><b>postscreen</b>(8)</a>
-       server.
+       The   <a href="dnsblog.8.html"><b>dnsblog</b>(8)</a>   server   implements   an   ad-hoc   DNS
+       white/blacklist lookup service  that  will  eventually  be
+       replaced  by an UDP client that is built directly into the
+       <a href="postscreen.8.html"><b>postscreen</b>(8)</a> server.
 
        With each connection, the <a href="dnsblog.8.html"><b>dnsblog</b>(8)</a> server receives a DNS
-       blocklist domain name and an IP address. If the address is
-       listed under the DNS blocklist, the <a href="dnsblog.8.html"><b>dnsblog</b>(8)</a> server logs
-       the match and replies with the query arguments plus a non-
-       zero status.  Otherwise it replies with  the  query  argu-
-       ments  plus a zero status.  Finally, The <a href="dnsblog.8.html"><b>dnsblog</b>(8)</a> server
-       closes the connection.
+       white/blacklist  domain  name  and  an  IP address. If the
+       address is listed under the DNS white/blacklist, the  <b>dns-</b>
+       <b>blog</b>(8)  server  logs the match and replies with the query
+       arguments plus a non-zero status.   Otherwise  it  replies
+       with the query arguments plus a zero status.  Finally, The
+       <a href="dnsblog.8.html"><b>dnsblog</b>(8)</a> server closes the connection.
 
 <b>DIAGNOSTICS</b>
        Problems and transactions are logged to <b>syslogd</b>(8).
@@ -47,8 +47,8 @@ DNSBLOG(8)                                                          DNSBLOG(8)
               built-in watchdog timer.
 
        <b><a href="postconf.5.html#postscreen_dnsbl_sites">postscreen_dnsbl_sites</a> (empty)</b>
-              Optional list of DNS blocklist domains, filters and
-              weight factors.
+              Optional list of DNS white/blacklist domains,  fil-
+              ters and weight factors.
 
        <b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b>
               The time limit for sending or receiving information
index d6f0e969f54037d138022d54fa0ab64cf8385c95..cc3f97dc6bcf8e3f5048262c0c0b9f0ea2425d9a 100644 (file)
@@ -2597,6 +2597,17 @@ Example:
 <p> This feature is available in Postfix 2.8.  </p>
 
 
+</DD>
+
+<DT><b><a name="dnsblog_service_name">dnsblog_service_name</a>
+(default: dnsblog)</b></DT><DD>
+
+<p> The name of the <a href="dnsblog.8.html">dnsblog(8)</a> service entry in <a href="master.5.html">master.cf</a>. This
+service performs DNS white/blacklist lookups. </p>
+
+<p> This feature is available in Postfix 2.8 and later. </p>
+
+
 </DD>
 
 <DT><b><a name="dont_remove">dont_remove</a>
@@ -6805,7 +6816,7 @@ seconds. </p>
 </DD>
 
 <DT><b><a name="postscreen_cache_map">postscreen_cache_map</a>
-(default: btree:$<a href="postconf.5.html#data_directory">data_directory</a>/ps_cache)</b></DT><DD>
+(default: btree:$<a href="postconf.5.html#data_directory">data_directory</a>/postscreen_cache)</b></DT><DD>
 
 <p> Persistent storage for the <a href="postscreen.8.html">postscreen(8)</a> server decisions. </p>
 
@@ -6990,11 +7001,11 @@ the file is read). </p>
 <DT><b><a name="postscreen_dnsbl_sites">postscreen_dnsbl_sites</a>
 (default: empty)</b></DT><DD>
 
-<p>Optional list of DNS blocklist domains, filters and weight
+<p>Optional list of DNS white/blacklist domains, filters and weight
 factors. When the list is non-empty, the <a href="dnsblog.8.html">dnsblog(8)</a> daemon will
-query these domains with the IP addresses of non-whitelisted remote
-SMTP clients, and <a href="postscreen.8.html">postscreen(8)</a> will update an SMTP client's DNSBL
-score with each non-error reply. </p>
+query these domains with the IP addresses of remote SMTP clients,
+and <a href="postscreen.8.html">postscreen(8)</a> will update an SMTP client's DNSBL score with
+each non-error reply. </p>
 
 <p> Caution: when postscreen rejects mail, it replies with the DNSBL
 domain name. Use the <a href="postconf.5.html#postscreen_dnsbl_reply_map">postscreen_dnsbl_reply_map</a> feature to hide
@@ -15275,6 +15286,17 @@ further details. </p>
 <p> This feature is available in Postfix 2.8 and later. </p>
 
 
+</DD>
+
+<DT><b><a name="tlsproxy_service_name">tlsproxy_service_name</a>
+(default: tlsproxy)</b></DT><DD>
+
+<p> The name of the <a href="tlsproxy.8.html">tlsproxy(8)</a> service entry in <a href="master.5.html">master.cf</a>. This
+service performs plaintext &lt;=&gt; TLS ciphertext conversion. <p>
+
+<p> This feature is available in Postfix 2.8 and later. </p>
+
+
 </DD>
 
 <DT><b><a name="tlsproxy_tls_CAfile">tlsproxy_tls_CAfile</a>
index d63c0671d4a5afd00acece5b923014fec9feb3e5..36cdfa5b27b3205a5851c7d584b8600bf7edb684 100644 (file)
@@ -184,6 +184,8 @@ the following convention:  </p>
 
 <li> <a href="discard.8.html">discard(8)</a>, Postfix discard delivery agent 
 
+<li> <a href="dnsblog.8.html">dnsblog(8)</a>, DNS black/whitelist logger 
+
 <li> <a href="error.8.html">error(8)</a>, Postfix error delivery agent 
 
 <li> <a href="flush.8.html">flush(8)</a>, Postfix fast ETRN service 
index ad237fcf2dfbd8f87d0d99385a2dd51940dae0d1..c4bb73a256ae936e90c23b15f47423abd3251264 100644 (file)
@@ -309,6 +309,7 @@ POSTFIX(1)                                                          POSTFIX(1)
        <a href="bounce.8.html">bounce(8)</a>, <a href="defer.8.html">defer(8)</a>, <a href="trace.8.html">trace(8)</a>, Delivery status reports
        <a href="cleanup.8.html">cleanup(8)</a>, canonicalize and enqueue message
        <a href="discard.8.html">discard(8)</a>, Postfix discard delivery agent
+       <a href="dnsblog.8.html">dnsblog(8)</a>, DNS black/whitelist logger
        <a href="error.8.html">error(8)</a>, Postfix error delivery agent
        <a href="flush.8.html">flush(8)</a>, Postfix fast ETRN service
        <a href="local.8.html">local(8)</a>, Postfix local delivery agent
index 20c2290f852fa596852b163aee680c4955b27514..a26bf621a251d334ec65b92c74f97f18cb847380 100644 (file)
@@ -131,45 +131,49 @@ POSTSCREEN(8)                                                    POSTSCREEN(8)
               remote SMTP client.
 
 <b>BEFORE-GREETING TRIAGE</b>
+       <b><a href="postconf.5.html#dnsblog_service_name">dnsblog_service_name</a> (dnsblog)</b>
+              The  name  of  the <a href="dnsblog.8.html"><b>dnsblog</b>(8)</a> service entry in mas-
+              ter.cf.
+
        <b><a href="postconf.5.html#postscreen_access_list">postscreen_access_list</a> (<a href="postconf.5.html#permit_mynetworks">permit_mynetworks</a>)</b>
               Permanent white/blacklist for remote SMTP client IP
               addresses; <a href="postscreen.8.html"><b>postscreen</b>(8)</a> searches this list immedi-
               ately after a remote SMTP client connects.
 
        <b><a href="postconf.5.html#postscreen_blacklist_action">postscreen_blacklist_action</a> (ignore)</b>
-              The  action  that  <a href="postscreen.8.html"><b>postscreen</b>(8)</a> takes when an SMTP
-              client  is   permanently   blacklisted   with   the
+              The action that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> takes  when  an  SMTP
+              client   is   permanently   blacklisted   with  the
               <a href="postconf.5.html#postscreen_blacklist_networks">postscreen_blacklist_networks</a> parameter.
 
        <b><a href="postconf.5.html#postscreen_blacklist_networks">postscreen_blacklist_networks</a> (empty)</b>
               Network addresses that are permanently blacklisted;
-              see the <a href="postconf.5.html#postscreen_blacklist_action">postscreen_blacklist_action</a>  parameter  for
+              see  the  <a href="postconf.5.html#postscreen_blacklist_action">postscreen_blacklist_action</a> parameter for
               possible actions.
 
        <b><a href="postconf.5.html#postscreen_dnsbl_action">postscreen_dnsbl_action</a> (ignore)</b>
-              The  action  that  <a href="postscreen.8.html"><b>postscreen</b>(8)</a> takes when an SMTP
+              The action that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> takes  when  an  SMTP
               client's  combined  DNSBL  score  is  equal  to  or
-              greater  than  a  threshold  (as  defined  with the
+              greater than  a  threshold  (as  defined  with  the
               <a href="postconf.5.html#postscreen_dnsbl_sites">postscreen_dnsbl_sites</a> and <a href="postconf.5.html#postscreen_dnsbl_threshold">postscreen_dnsbl_thresh</a>-
               <a href="postconf.5.html#postscreen_dnsbl_threshold">old</a> parameters).
 
        <b><a href="postconf.5.html#postscreen_dnsbl_reply_map">postscreen_dnsbl_reply_map</a> (empty)</b>
-              A  mapping  from  actual  DNSBL  domain  name which
-              includes a secret password,  to  the  DNSBL  domain
+              A mapping  from  actual  DNSBL  domain  name  which
+              includes  a  secret  password,  to the DNSBL domain
               name  that  postscreen  will  reply  with  when  it
               rejects mail.
 
        <b><a href="postconf.5.html#postscreen_dnsbl_sites">postscreen_dnsbl_sites</a> (empty)</b>
-              Optional list of DNS blocklist domains, filters and
-              weight factors.
+              Optional  list of DNS white/blacklist domains, fil-
+              ters and weight factors.
 
        <b><a href="postconf.5.html#postscreen_dnsbl_threshold">postscreen_dnsbl_threshold</a> (1)</b>
-              The  inclusive  lower  bound  for  blocking an SMTP
+              The inclusive lower  bound  for  blocking  an  SMTP
               client,  based  on  its  combined  DNSBL  score  as
-              defined  with the <a href="postconf.5.html#postscreen_dnsbl_sites">postscreen_dnsbl_sites</a> parameter.
+              defined with the <a href="postconf.5.html#postscreen_dnsbl_sites">postscreen_dnsbl_sites</a>  parameter.
 
        <b><a href="postconf.5.html#postscreen_greet_action">postscreen_greet_action</a> (ignore)</b>
-              The action that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> takes  when  an  SMTP
+              The  action  that  <a href="postscreen.8.html"><b>postscreen</b>(8)</a> takes when an SMTP
               client speaks before its turn within the time spec-
               ified with the <a href="postconf.5.html#postscreen_greet_wait">postscreen_greet_wait</a> parameter.
 
@@ -177,28 +181,28 @@ POSTSCREEN(8)                                                    POSTSCREEN(8)
               The  <i>text</i>  in  the  optional  "220-<i>text</i>..."  server
               response that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> sends ahead of the real
               Postfix SMTP server's "220 text..." response, in an
-              attempt  to  confuse  bad SMTP clients so that they
+              attempt to confuse bad SMTP clients  so  that  they
               speak before their turn (pre-greet).
 
        <b><a href="postconf.5.html#postscreen_greet_wait">postscreen_greet_wait</a> (${stress?2}${stress:6}s)</b>
               The amount of time that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> 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
+              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).
 
 <b>AFTER-GREETING TRIAGE</b>
        <b><a href="postconf.5.html#postscreen_bare_newline_action">postscreen_bare_newline_action</a> (ignore)</b>
-              The action that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> takes  when  an  SMTP
-              client  sends  a bare newline character, that is, a
+              The  action  that  <a href="postscreen.8.html"><b>postscreen</b>(8)</a> takes when an SMTP
+              client sends a bare newline character, that  is,  a
               newline not preceded by carriage return.
 
        <b><a href="postconf.5.html#postscreen_bare_newline_enable">postscreen_bare_newline_enable</a> (no)</b>
-              Enable "bare newline" SMTP protocol  tests  in  the
+              Enable  "bare  newline"  SMTP protocol tests in the
               <a href="postscreen.8.html"><b>postscreen</b>(8)</a> server.
 
        <b><a href="postconf.5.html#postscreen_disable_vrfy_command">postscreen_disable_vrfy_command</a> ($<a href="postconf.5.html#disable_vrfy_command">disable_vrfy_command</a>)</b>
-              Disable  the SMTP VRFY command in the <a href="postscreen.8.html"><b>postscreen</b>(8)</a>
+              Disable the SMTP VRFY command in the  <a href="postscreen.8.html"><b>postscreen</b>(8)</a>
               daemon.
 
        <b><a href="postconf.5.html#postscreen_forbidden_commands">postscreen_forbidden_commands</a> ($<a href="postconf.5.html#smtpd_forbidden_commands">smtpd_forbidden_commands</a>)</b>
@@ -206,111 +210,116 @@ POSTSCREEN(8)                                                    POSTSCREEN(8)
               siders in violation of the SMTP protocol.
 
        <b><a href="postconf.5.html#postscreen_helo_required">postscreen_helo_required</a> ($<a href="postconf.5.html#smtpd_helo_required">smtpd_helo_required</a>)</b>
-              Require  that  a  remote  SMTP client sends HELO or
+              Require that a remote SMTP  client  sends  HELO  or
               EHLO before commencing a MAIL transaction.
 
        <b><a href="postconf.5.html#postscreen_non_smtp_command_action">postscreen_non_smtp_command_action</a> (drop)</b>
-              The action that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> takes  when  an  SMTP
-              client  sends  non-SMTP  commands as specified with
+              The  action  that  <a href="postscreen.8.html"><b>postscreen</b>(8)</a> takes when an SMTP
+              client sends non-SMTP commands  as  specified  with
               the <a href="postconf.5.html#postscreen_forbidden_commands">postscreen_forbidden_commands</a> parameter.
 
        <b><a href="postconf.5.html#postscreen_non_smtp_command_enable">postscreen_non_smtp_command_enable</a> (no)</b>
-              Enable   "non-SMTP   command"    tests    in    the
+              Enable    "non-SMTP    command"    tests   in   the
               <a href="postscreen.8.html"><b>postscreen</b>(8)</a> server.
 
        <b><a href="postconf.5.html#postscreen_pipelining_action">postscreen_pipelining_action</a> (enforce)</b>
-              The  action  that  <a href="postscreen.8.html"><b>postscreen</b>(8)</a> takes when an SMTP
-              client sends multiple commands instead  of  sending
-              one  command and waiting for the server to respond.
+              The action that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> takes  when  an  SMTP
+              client  sends  multiple commands instead of sending
+              one command and waiting for the server to  respond.
 
        <b><a href="postconf.5.html#postscreen_pipelining_enable">postscreen_pipelining_enable</a> (no)</b>
-              Enable "pipelining"  SMTP  protocol  tests  in  the
+              Enable  "pipelining"  SMTP  protocol  tests  in the
               <a href="postscreen.8.html"><b>postscreen</b>(8)</a> server.
 
 <b>AFTER-TRIAGE CONTROLS</b>
        <b><a href="postconf.5.html#smtpd_service_name">smtpd_service_name</a> (smtpd)</b>
-              The  internal  service  that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> forwards
+              The internal service  that  <a href="postscreen.8.html"><b>postscreen</b>(8)</a>  forwards
               allowed connections to.
 
 <b>CACHE CONTROLS</b>
        <b><a href="postconf.5.html#postscreen_cache_cleanup_interval">postscreen_cache_cleanup_interval</a> (12h)</b>
-              The amount  of  time  between  <a href="postscreen.8.html"><b>postscreen</b>(8)</a>  cache
+              The  amount  of  time  between  <a href="postscreen.8.html"><b>postscreen</b>(8)</a> cache
               cleanup runs.
 
-       <b><a href="postconf.5.html#postscreen_cache_map">postscreen_cache_map</a> (btree:$<a href="postconf.5.html#data_directory">data_directory</a>/ps_cache)</b>
-              Persistent  storage  for  the  <a href="postscreen.8.html"><b>postscreen</b>(8)</a> server
+       <b><a href="postconf.5.html#postscreen_cache_map">postscreen_cache_map</a>                   (btree:$data_direc-</b>
+       <b>tory/postscreen_cache)</b>
+              Persistent storage  for  the  <a href="postscreen.8.html"><b>postscreen</b>(8)</a>  server
               decisions.
 
        <b><a href="postconf.5.html#postscreen_cache_retention_time">postscreen_cache_retention_time</a> (7d)</b>
               The amount of time that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> will cache an
-              expired  temporary  whitelist  entry  before  it is
+              expired temporary  whitelist  entry  before  it  is
               removed.
 
        <b><a href="postconf.5.html#postscreen_bare_newline_ttl">postscreen_bare_newline_ttl</a> (30d)</b>
-              The amount of time that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> will use  the
+              The  amount of time that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> will use the
               result from a successful "bare newline" SMTP proto-
               col test.
 
        <b><a href="postconf.5.html#postscreen_dnsbl_ttl">postscreen_dnsbl_ttl</a> (1h)</b>
-              The amount of time that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> will use  the
+              The  amount of time that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> will use the
               result from a successful DNS blocklist test.
 
        <b><a href="postconf.5.html#postscreen_greet_ttl">postscreen_greet_ttl</a> (1d)</b>
-              The  amount of time that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> will use the
+              The amount of time that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> will use  the
               result from a successful PREGREET test.
 
        <b><a href="postconf.5.html#postscreen_non_smtp_command_ttl">postscreen_non_smtp_command_ttl</a> (30d)</b>
-              The amount of time that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> will use  the
-              result  from  a  successful "non_smtp_command" SMTP
+              The  amount of time that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> will use the
+              result from a  successful  "non_smtp_command"  SMTP
               protocol test.
 
        <b><a href="postconf.5.html#postscreen_pipelining_ttl">postscreen_pipelining_ttl</a> (30d)</b>
-              The amount of time that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> will use  the
+              The  amount of time that <a href="postscreen.8.html"><b>postscreen</b>(8)</a> will use the
               result from a successful "pipelining" SMTP protocol
               test.
 
 <b>RESOURCE CONTROLS</b>
        <b><a href="postconf.5.html#line_length_limit">line_length_limit</a> (2048)</b>
-              Upon input, long lines are chopped up  into  pieces
-              of  at  most this length; upon delivery, long lines
+              Upon  input,  long lines are chopped up into pieces
+              of at most this length; upon delivery,  long  lines
               are reconstructed.
 
        <b><a href="postconf.5.html#postscreen_client_connection_count_limit">postscreen_client_connection_count_limit</a></b>
        <b>($<a href="postconf.5.html#smtpd_client_connection_count_limit">smtpd_client_connection_count_limit</a>)</b>
-              How many simultaneous  connections  any  client  is
+              How  many  simultaneous  connections  any client is
               allowed to have with the <a href="postscreen.8.html"><b>postscreen</b>(8)</a> daemon.
 
        <b><a href="postconf.5.html#postscreen_command_count_limit">postscreen_command_count_limit</a> (20)</b>
-              The  limit on the total number of commands per SMTP
-              session for <a href="postscreen.8.html"><b>postscreen</b>(8)</a>'s built-in SMTP  protocol
+              The limit on the total number of commands per  SMTP
+              session  for <a href="postscreen.8.html"><b>postscreen</b>(8)</a>'s built-in SMTP protocol
               engine.
 
        <b><a href="postconf.5.html#postscreen_command_time_limit">postscreen_command_time_limit</a> (${stress?10}${stress:300}s)</b>
-              The  command  "read" time limit for <a href="postscreen.8.html"><b>postscreen</b>(8)</a>'s
+              The command "read" time limit  for  <a href="postscreen.8.html"><b>postscreen</b>(8)</a>'s
               built-in SMTP protocol engine.
 
        <b><a href="postconf.5.html#postscreen_post_queue_limit">postscreen_post_queue_limit</a> ($<a href="postconf.5.html#default_process_limit">default_process_limit</a>)</b>
-              The number of clients that can be waiting for  ser-
+              The  number of clients that can be waiting for ser-
               vice from a real SMTP server process.
 
        <b><a href="postconf.5.html#postscreen_pre_queue_limit">postscreen_pre_queue_limit</a> ($<a href="postconf.5.html#default_process_limit">default_process_limit</a>)</b>
-              The  number  of non-whitelisted clients that can be
-              waiting for a decision whether  they  will  receive
+              The number of non-whitelisted clients that  can  be
+              waiting  for  a  decision whether they will receive
               service from a real SMTP server process.
 
        <b><a href="postconf.5.html#postscreen_watchdog_timeout">postscreen_watchdog_timeout</a> (10s)</b>
-              How  much  time a <a href="postscreen.8.html"><b>postscreen</b>(8)</a> process may take to
-              respond to an SMTP client command or to  perform  a
+              How much time a <a href="postscreen.8.html"><b>postscreen</b>(8)</a> process may  take  to
+              respond  to  an SMTP client command or to perform a
               cache operation before it is terminated by a built-
               in watchdog timer.
 
 <b>STARTTLS CONTROLS</b>
        <b><a href="postconf.5.html#postscreen_tls_security_level">postscreen_tls_security_level</a> ($<a href="postconf.5.html#smtpd_tls_security_level">smtpd_tls_security_level</a>)</b>
-              The SMTP TLS security level for  the  <a href="postscreen.8.html"><b>postscreen</b>(8)</a>
-              server;  when  a non-empty value is specified, this
+              The  SMTP  TLS security level for the <a href="postscreen.8.html"><b>postscreen</b>(8)</a>
+              server; when a non-empty value is  specified,  this
               overrides       the       obsolete       parameters
               <a href="postconf.5.html#postscreen_use_tls">postscreen_use_tls</a> and <a href="postconf.5.html#postscreen_enforce_tls">postscreen_enforce_tls</a>.
 
+       <b><a href="postconf.5.html#tlsproxy_service_name">tlsproxy_service_name</a> (tlsproxy)</b>
+              The name of the <a href="tlsproxy.8.html"><b>tlsproxy</b>(8)</a> service entry  in  mas-
+              ter.cf.
+
 <b>OBSOLETE STARTTLS SUPPORT CONTROLS</b>
        These  parameters  are  supported  for  compatibility with
        <a href="smtpd.8.html"><b>smtpd</b>(8)</a> legacy parameters.
@@ -371,7 +380,7 @@ POSTSCREEN(8)                                                    POSTSCREEN(8)
 <b>SEE ALSO</b>
        <a href="smtpd.8.html">smtpd(8)</a>, Postfix SMTP server
        <a href="tlsproxy.8.html">tlsproxy(8)</a>, Postfix TLS proxy server
-       <a href="dnsblog.8.html">dnsblog(8)</a>, temporary DNS helper
+       <a href="dnsblog.8.html">dnsblog(8)</a>, DNS black/whitelist logger
        syslogd(8), system logging
 
 <b>README FILES</b>
index ac87b590f2af571a229d44a8f21721ea236d2c81..95a31350682555d84c56fd0cd6461c1ad6b54935 100644 (file)
@@ -267,6 +267,7 @@ anvil(8), Postfix connection/rate limiting
 bounce(8), defer(8), trace(8), Delivery status reports
 cleanup(8), canonicalize and enqueue message
 discard(8), Postfix discard delivery agent
+dnsblog(8), DNS black/whitelist logger
 error(8), Postfix error delivery agent
 flush(8), Postfix fast ETRN service
 local(8), Postfix local delivery agent
index 4cc70692876cb42d9e8af16fb34481e4ed8607d8..9f4b1f69302d98b0b58b1409c1ff0adf5b0a7363 100644 (file)
@@ -1470,6 +1470,11 @@ disable_vrfy_command = no
 A debugging aid to artifically delay DNS responses.
 .PP
 This feature is available in Postfix 2.8.
+.SH dnsblog_service_name (default: dnsblog)
+The name of the \fBdnsblog\fR(8) service entry in master.cf. This
+service performs DNS white/blacklist lookups.
+.PP
+This feature is available in Postfix 2.8 and later.
 .SH dont_remove (default: 0)
 Don't remove queue files and save them to the "saved" mail queue.
 This is a debugging aid.  To inspect the envelope information and
@@ -3855,7 +3860,7 @@ Time units: s (seconds), m (minutes), h (hours), d (days), w
 (weeks).
 .PP
 This feature is available in Postfix 2.8.
-.SH postscreen_cache_map (default: btree:$data_directory/ps_cache)
+.SH postscreen_cache_map (default: btree:$data_directory/postscreen_cache)
 Persistent storage for the \fBpostscreen\fR(8) server decisions.
 .PP
 This feature is available in Postfix 2.8.
@@ -3970,11 +3975,11 @@ Example:
 .PP
 This feature is available in Postfix 2.8.
 .SH postscreen_dnsbl_sites (default: empty)
-Optional list of DNS blocklist domains, filters and weight
+Optional list of DNS white/blacklist domains, filters and weight
 factors. When the list is non-empty, the \fBdnsblog\fR(8) daemon will
-query these domains with the IP addresses of non-whitelisted remote
-SMTP clients, and \fBpostscreen\fR(8) will update an SMTP client's DNSBL
-score with each non-error reply.
+query these domains with the IP addresses of remote SMTP clients,
+and \fBpostscreen\fR(8) will update an SMTP client's DNSBL score with
+each non-error reply.
 .PP
 Caution: when postscreen rejects mail, it replies with the DNSBL
 domain name. Use the postscreen_dnsbl_reply_map feature to hide
@@ -9777,6 +9782,11 @@ require that clients use TLS encryption. See smtpd_enforce_tls for
 further details.
 .PP
 This feature is available in Postfix 2.8 and later.
+.SH tlsproxy_service_name (default: tlsproxy)
+The name of the \fBtlsproxy\fR(8) service entry in master.cf. This
+service performs plaintext <=> TLS ciphertext conversion.
+.PP
+This feature is available in Postfix 2.8 and later.
 .SH tlsproxy_tls_CAfile (default: $smtpd_tls_CAfile)
 A file containing (PEM format) CA certificates of root CAs
 trusted to sign either remote SMTP client certificates or intermediate
index 2a361344c1459b61deb4d807455869791f56da53..358efa471cda0e94a06c04bba46f80495f7850f8 100644 (file)
@@ -4,7 +4,7 @@
 .SH NAME
 dnsblog
 \-
-Postfix DNS blocklist logger
+Postfix DNS white/blacklist logger
 .SH "SYNOPSIS"
 .na
 .nf
@@ -12,18 +12,18 @@ Postfix DNS blocklist logger
 .SH DESCRIPTION
 .ad
 .fi
-The \fBdnsblog\fR(8) server implements an ad-hoc DNS blocklist
-lookup service that will eventually be replaced by an UDP
-client that is built directly into the \fBpostscreen\fR(8)
-server.
+The \fBdnsblog\fR(8) server implements an ad-hoc DNS
+white/blacklist lookup service that will eventually be
+replaced by an UDP client that is built directly into the
+\fBpostscreen\fR(8) server.
 
 With each connection, the \fBdnsblog\fR(8) server receives
-a DNS blocklist domain name and an IP address. If the address
-is listed under the DNS blocklist, the \fBdnsblog\fR(8)
-server logs the match and replies with the query arguments
-plus a non-zero status.  Otherwise it replies with the query
-arguments plus a zero status.  Finally, The \fBdnsblog\fR(8)
-server closes the connection.
+a DNS white/blacklist domain name and an IP address. If the
+address is listed under the DNS white/blacklist, the
+\fBdnsblog\fR(8) server logs the match and replies with the
+query arguments plus a non-zero status.  Otherwise it replies
+with the query arguments plus a zero status.  Finally, The
+\fBdnsblog\fR(8) server closes the connection.
 .SH DIAGNOSTICS
 .ad
 .fi
@@ -47,7 +47,7 @@ configuration files.
 How much time a Postfix daemon process may take to handle a
 request before it is terminated by a built-in watchdog timer.
 .IP "\fBpostscreen_dnsbl_sites (empty)\fR"
-Optional list of DNS blocklist domains, filters and weight
+Optional list of DNS white/blacklist domains, filters and weight
 factors.
 .IP "\fBipc_timeout (3600s)\fR"
 The time limit for sending or receiving information over an internal
index ee057c4742d4e26269ac7692682111c0e3d932b0..735e9a17b6a1a346664d5105d7cbc7244b1295ae 100644 (file)
@@ -140,6 +140,8 @@ response to a remote SMTP client.
 .nf
 .ad
 .fi
+.IP "\fBdnsblog_service_name (dnsblog)\fR"
+The name of the \fBdnsblog\fR(8) service entry in master.cf.
 .IP "\fBpostscreen_access_list (permit_mynetworks)\fR"
 Permanent white/blacklist for remote SMTP client IP addresses;
 \fBpostscreen\fR(8) searches this list immediately after a remote SMTP
@@ -161,7 +163,7 @@ A mapping from actual DNSBL domain name which includes a secret
 password, to the DNSBL domain name that postscreen will reply with
 when it rejects mail.
 .IP "\fBpostscreen_dnsbl_sites (empty)\fR"
-Optional list of DNS blocklist domains, filters and weight
+Optional list of DNS white/blacklist domains, filters and weight
 factors.
 .IP "\fBpostscreen_dnsbl_threshold (1)\fR"
 The inclusive lower bound for blocking an SMTP client, based on
@@ -230,7 +232,7 @@ connections to.
 .fi
 .IP "\fBpostscreen_cache_cleanup_interval (12h)\fR"
 The amount of time between \fBpostscreen\fR(8) cache cleanup runs.
-.IP "\fBpostscreen_cache_map (btree:$data_directory/ps_cache)\fR"
+.IP "\fBpostscreen_cache_map (btree:$data_directory/postscreen_cache)\fR"
 Persistent storage for the \fBpostscreen\fR(8) server decisions.
 .IP "\fBpostscreen_cache_retention_time (7d)\fR"
 The amount of time that \fBpostscreen\fR(8) will cache an expired
@@ -287,6 +289,8 @@ is terminated by a built-in watchdog timer.
 The SMTP TLS security level for the \fBpostscreen\fR(8) server; when
 a non-empty value is specified, this overrides the obsolete parameters
 postscreen_use_tls and postscreen_enforce_tls.
+.IP "\fBtlsproxy_service_name (tlsproxy)\fR"
+The name of the \fBtlsproxy\fR(8) service entry in master.cf.
 .SH "OBSOLETE STARTTLS SUPPORT CONTROLS"
 .na
 .nf
@@ -341,7 +345,7 @@ records, so that "smtpd" becomes, for example, "postfix/smtpd".
 .nf
 smtpd(8), Postfix SMTP server
 tlsproxy(8), Postfix TLS proxy server
-dnsblog(8), temporary DNS helper
+dnsblog(8), DNS black/whitelist logger
 syslogd(8), system logging
 .SH "README FILES"
 .na
index 10f2376b93cfe64f1eb6b89f3ae2aa43148e8e96..b7110bf6fa185c66bd8db13cb8b8332cd00cc562 100755 (executable)
@@ -921,6 +921,8 @@ while (<>) {
     s;\bpostscreen_command_count_limit\b;<a href="postconf.5.html#postscreen_command_count_limit">$&</a>;g;
     s;\bpostscreen_com[-</bB>]*\n* *[<bB>]*mand_time_limit\b;<a href="postconf.5.html#postscreen_command_time_limit">$&</a>;g;
     s;\bsmtpd_service_name\b;<a href="postconf.5.html#smtpd_service_name">$&</a>;g;
+    s;\bdnsblog_service_name\b;<a href="postconf.5.html#dnsblog_service_name">$&</a>;g;
+    s;\btlsproxy_service_name\b;<a href="postconf.5.html#tlsproxy_service_name">$&</a>;g;
     s;\bpostscreen_bare_newline_enable\b;<a href="postconf.5.html#postscreen_bare_newline_enable">$&</a>;g;
     s;\bpostscreen_bare_newline_action\b;<a href="postconf.5.html#postscreen_bare_newline_action">$&</a>;g;
     s;\bpostscreen_bare_newline_ttl\b;<a href="postconf.5.html#postscreen_bare_newline_ttl">$&</a>;g;
index 062d460abfe3746df639366fe56107b6c1a10eeb..a199c493ed573e8b9d6773643cf3053838031ecb 100644 (file)
@@ -732,14 +732,17 @@ document.  The verify(8) service is available with Postfix version
 smtpd(8) processes. Its purpose is to accept connections from the
 network and to decide what SMTP clients are allowed to talk to
 Postfix.  According to the 2008 MessageLabs annual report, 81% of
-all email was spam, and 90% of that was sent by botnets.  While
-postscreen(8) keeps the zombies away, more smtpd(8) processes remain
-available for legitimate clients.  </p>
-
-<p> The postscreen(8) server is still evolving, and is likely to
-undergo changes that break compatibility with earlier versions.
-For this reason the postscreen(8) server is not installed with the
-stable Postfix release. </p>
+all email was spam, and 90% of that was sent by botnets; by 2010,
+those numbers were 92% and 95%, respectively.  While postscreen(8)
+keeps the zombies away, more smtpd(8) processes remain available
+for legitimate clients.  </p>
+
+<p> The postscreen(8) server is available with Postfix 2.8 and
+later. To keep the implementation simple, postscreen(8) delegates
+DNS white/backlist lookups to dnsblog(8) server processes, and
+delegates TLS encryption/decryption to tlsproxy(8) server processes.
+This delegation is invisible to the remote SMTP client, and is not
+shown in the diagram below.  </p>
 
 <table>
 
index b23070891885366c4381edf867b8bcb56293ba37..1386efd0242dd95f3bf8624194dcc5598e562560 100644 (file)
@@ -657,6 +657,8 @@ and Solaris 9 systems. </p>
 <li> <a href="#enable"> Turning on postscreen(8) without blocking
 mail</a>
 
+<li> <a href="#starttls"> postscreen(8) TLS configuration </a>
+
 <li> <a href="#blocking"> Blocking mail with postscreen(8) </a>
 
 <li> <a href="#turnoff"> Turning off postscreen(8) </a>
@@ -777,6 +779,27 @@ work reliably on all systems. </p>
 
 </ul>
 
+<h3> <a name="starttls"> postscreen(8) TLS configuration </a> </h3>
+
+<p> postscreen(8) TLS support is available for remote SMTP clients
+that aren't whitelisted, including clients that need to renew their
+temporary whitelist status.  When a remote SMTP client requests TLS
+service, postscreen(8) invisibly hands off the connection to a
+tlsproxy(8) process. Then, tlsproxy(8) encrypts and decrypts the
+traffic between postscreen(8) and the remote SMTP client. One
+tlsproxy(8) process can handle multiple SMTP sessions. The number
+of tlsproxy(8) processes slowly increases with server load, but it
+should always be much smaller than the number of postscreen(8) TLS
+sessions.  </p>
+
+<p> TLS support for postscreen(8) and tlsproxy(8) uses the same
+parameters as with smtpd(8). We recommend that you keep the relevant
+configuration parameters in main.cf.  If you must specify "-o
+smtpd_mumble=value" parameter overrides in master.cf for a
+postscreen-protected smtpd(8) service, then you should specify those
+same parameter overrides for the postscreen(8) and tlsproxy(8)
+services. </p>
+
 <h3> <a name="blocking"> Blocking mail with postscreen(8) </a> </h3>
 
 <p> To use the postscreen(8) service to block mail, edit main.cf and
index e04ad3553721032495dae6f9537f4f4e2438e39f..eea3a28924ac26bc843fb8f2c9545fd1716eb729 100644 (file)
@@ -12597,7 +12597,7 @@ inspection for DKIM-signed mail from known friendly domains. </p>
 <p> This feature is available in Postfix 2.7, and as an optional
 patch for Postfix 2.6. </p>
 
-%PARAM postscreen_cache_map btree:$data_directory/ps_cache
+%PARAM postscreen_cache_map btree:$data_directory/postscreen_cache
 
 <p> Persistent storage for the postscreen(8) server decisions. </p>
 
@@ -12690,11 +12690,11 @@ one-letter suffix that specifies the time unit).  </p>
 
 %PARAM postscreen_dnsbl_sites
 
-<p>Optional list of DNS blocklist domains, filters and weight
+<p>Optional list of DNS white/blacklist domains, filters and weight
 factors. When the list is non-empty, the dnsblog(8) daemon will
-query these domains with the IP addresses of non-whitelisted remote
-SMTP clients, and postscreen(8) will update an SMTP client's DNSBL
-score with each non-error reply. </p>
+query these domains with the IP addresses of remote SMTP clients,
+and postscreen(8) will update an SMTP client's DNSBL score with
+each non-error reply. </p>
 
 <p> Caution: when postscreen rejects mail, it replies with the DNSBL
 domain name. Use the postscreen_dnsbl_reply_map feature to hide
@@ -13975,3 +13975,18 @@ response. See smtpd_reject_footer for further details.  </p>
 See smtpd_command_filter for further details. </p>
 
 <p> This feature is available in Postfix 2.8 and later. </p>
+
+%PARAM dnsblog_service_name dnsblog
+
+<p> The name of the dnsblog(8) service entry in master.cf. This
+service performs DNS white/blacklist lookups. </p>
+
+<p> This feature is available in Postfix 2.8 and later. </p>
+
+%PARAM tlsproxy_service_name tlsproxy
+
+<p> The name of the tlsproxy(8) service entry in master.cf. This
+service performs plaintext &lt;=&gt; TLS ciphertext conversion. <p>
+
+<p> This feature is available in Postfix 2.8 and later. </p>
+
index 7fc6578997acc965763d5aabd5c9bda3bb0c9471..f0340a8ee75cf322c5b5005eeb2d6d483f433b13 100644 (file)
@@ -1144,3 +1144,12 @@ texthash
 ul
 whitelisted
 whitelists
+=== proto/POSTSCREEN_README.html ===
+Amavisd
+MUA
+Mailserver
+SpamAssassin
+barracudacentral
+bl
+spamcop
+tlsproxy
index dd3ea71583a07bd5fcceca96d13565b599c334d0..09cb18d378b02fc54d56db03a97e56004f7ba088 100644 (file)
@@ -2,22 +2,22 @@
 /* NAME
 /*     dnsblog 8
 /* SUMMARY
-/*     Postfix DNS blocklist logger
+/*     Postfix DNS white/blacklist logger
 /* SYNOPSIS
 /*     \fBdnsblog\fR [generic Postfix daemon options]
 /* DESCRIPTION
-/*     The \fBdnsblog\fR(8) server implements an ad-hoc DNS blocklist
-/*     lookup service that will eventually be replaced by an UDP
-/*     client that is built directly into the \fBpostscreen\fR(8)
-/*     server.
+/*     The \fBdnsblog\fR(8) server implements an ad-hoc DNS
+/*     white/blacklist lookup service that will eventually be
+/*     replaced by an UDP client that is built directly into the
+/*     \fBpostscreen\fR(8) server.
 /*
 /*     With each connection, the \fBdnsblog\fR(8) server receives
-/*     a DNS blocklist domain name and an IP address. If the address
-/*     is listed under the DNS blocklist, the \fBdnsblog\fR(8)
-/*     server logs the match and replies with the query arguments
-/*     plus a non-zero status.  Otherwise it replies with the query
-/*     arguments plus a zero status.  Finally, The \fBdnsblog\fR(8)
-/*     server closes the connection.
+/*     a DNS white/blacklist domain name and an IP address. If the
+/*     address is listed under the DNS white/blacklist, the
+/*     \fBdnsblog\fR(8) server logs the match and replies with the
+/*     query arguments plus a non-zero status.  Otherwise it replies
+/*     with the query arguments plus a zero status.  Finally, The
+/*     \fBdnsblog\fR(8) server closes the connection.
 /* DIAGNOSTICS
 /*     Problems and transactions are logged to \fBsyslogd\fR(8).
 /* CONFIGURATION PARAMETERS
@@ -37,7 +37,7 @@
 /*     How much time a Postfix daemon process may take to handle a
 /*     request before it is terminated by a built-in watchdog timer.
 /* .IP "\fBpostscreen_dnsbl_sites (empty)\fR"
-/*     Optional list of DNS blocklist domains, filters and weight
+/*     Optional list of DNS white/blacklist domains, filters and weight
 /*     factors.
 /* .IP "\fBipc_timeout (3600s)\fR"
 /*     The time limit for sending or receiving information over an internal
index d7dda00487424bfc70f7ffa42726acbb83982d9c..61f914c06bafcfa2a91830280ca32286c2f5cf17 100644 (file)
@@ -3260,10 +3260,10 @@ extern char *var_multi_cntrl_cmds;
   * postscreen(8)
   */
 #define VAR_PSC_CACHE_MAP      "postscreen_cache_map"
-#define DEF_PSC_CACHE_MAP      "btree:$data_directory/psc_cache"
+#define DEF_PSC_CACHE_MAP      "btree:$data_directory/postscreen_cache"
 extern char *var_psc_cache_map;
 
-#define VAR_SMTPD_SERVICE      "smtpd_service"
+#define VAR_SMTPD_SERVICE      "smtpd_service_name"
 #define DEF_SMTPD_SERVICE      "smtpd"
 extern char *var_smtpd_service;
 
@@ -3445,10 +3445,18 @@ extern char *var_psc_cmd_filter;
 #define DEF_PSC_ACL            PSC_ACL_NAME_WL_MYNETWORKS
 extern char *var_psc_acl;
 
+#define VAR_DNSBLOG_SERVICE    "dnsblog_service_name"
+#define DEF_DNSBLOG_SERVICE    MAIL_SERVICE_DNSBLOG
+extern char *var_dnsblog_service;
+
 #define VAR_DNSBLOG_DELAY      "dnsblog_reply_delay"
 #define DEF_DNSBLOG_DELAY      "0s"
 extern int var_dnsblog_delay;
 
+#define VAR_TLSPROXY_SERVICE   "tlsproxy_service_name"
+#define DEF_TLSPROXY_SERVICE   MAIL_SERVICE_TLSPROXY
+extern char *var_tlsproxy_service;
+
 #define VAR_TLSP_WATCHDOG      "tlsproxy_watchdog_timeout"
 #define DEF_TLSP_WATCHDOG      "10s"
 extern int var_tlsp_watchdog;
index d33f0ccb4b9f64a4987102164c0e1eea01761134..5292406621a7aaf1a2c83c62b046278c631cc621 100644 (file)
@@ -32,8 +32,8 @@
 #define MAIL_PROTO_QMQP                "QMQP"
 
  /*
-  * Names of services: these are the names if INET ports, UNIX-domain sockets
-  * or FIFOs that a service listens on.
+  * Names of services: these are the names of the UNIX-domain socket or or
+  * FIFO that a service listens on.
   */
 #define MAIL_SERVICE_BOUNCE    "bounce"
 #define MAIL_SERVICE_CLEANUP   "cleanup"
@@ -58,6 +58,8 @@
 #define MAIL_SERVICE_PROXYMAP  "proxymap"
 #define MAIL_SERVICE_PROXYWRITE        "proxywrite"
 #define MAIL_SERVICE_SCACHE    "scache"
+#define MAIL_SERVICE_DNSBLOG   "dnsblog"
+#define MAIL_SERVICE_TLSPROXY  "tlsproxy"
 
  /*
   * Well-known socket or FIFO directories. The main difference is in file
@@ -238,7 +240,7 @@ extern char *mail_pathname(const char *, const char *);
 #define MAIL_ATTR_DSN_ORCPT    "dsn_orig_rcpt" /* dsn original recipient */
 
  /*
-  * PROXY support.
+  * TLSPROXY support.
   */
 #define MAIL_ATTR_REMOTE_ENDPT "remote_endpoint"       /* name[addr]:port */
 #define MAIL_ATTR_ROLE         "role"  /* requested role */
@@ -249,10 +251,10 @@ extern char *mail_pathname(const char *, const char *);
 #define MAIL_ATTR_ISSUER_CN    "issuer_CN"
 #define MAIL_ATTR_PEER_FPT     "peer_fingerprint"
 #define MAIL_ATTR_PEER_STATUS  "peer_status"
-#define MAIL_ATTR_CIPHER_PROTOCOL      "cipher_protocol"
+#define MAIL_ATTR_CIPHER_PROTOCOL "cipher_protocol"
 #define MAIL_ATTR_CIPHER_NAME  "cipher_name"
-#define MAIL_ATTR_CIPHER_USEBITS       "cipher_usebits"
-#define MAIL_ATTR_CIPHER_ALGBITS       "cipher_algbits"
+#define MAIL_ATTR_CIPHER_USEBITS "cipher_usebits"
+#define MAIL_ATTR_CIPHER_ALGBITS "cipher_algbits"
 
  /*
   * SMTP reply footer support.
index a12201f69a357d1a84fe73d2d3cc488954e6e5db..3fb73c2f98733c8351d5c8169c20b57008d42c52 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20110113"
+#define MAIL_RELEASE_DATE      "20110115"
 #define MAIL_VERSION_NUMBER    "2.8"
 
 #ifdef SNAPSHOT
index 1e5f2f7ff9955329a2167463e2b9c27d319549cc..c7b8c97ecdd7b05bb3fc1918206380644a0c5bc0 100644 (file)
 /*     bounce(8), defer(8), trace(8), Delivery status reports
 /*     cleanup(8), canonicalize and enqueue message
 /*     discard(8), Postfix discard delivery agent
+/*     dnsblog(8), DNS black/whitelist logger
 /*     error(8), Postfix error delivery agent
 /*     flush(8), Postfix fast ETRN service
 /*     local(8), Postfix local delivery agent
index 2afc1da0c4b0b3d1a4e651533956d1833bd2bb59..0eead33d391ff11b60788d3d544aebc02d8ab668 100644 (file)
@@ -156,6 +156,7 @@ postscreen_dnsbl.o: ../../include/myaddrinfo.h
 postscreen_dnsbl.o: ../../include/mymalloc.h
 postscreen_dnsbl.o: ../../include/split_at.h
 postscreen_dnsbl.o: ../../include/string_list.h
+postscreen_dnsbl.o: ../../include/stringops.h
 postscreen_dnsbl.o: ../../include/sys_defs.h
 postscreen_dnsbl.o: ../../include/valid_hostname.h
 postscreen_dnsbl.o: ../../include/vbuf.h
index 7e97b329b8b26b468a6992364b27d60706528d98..0e9d61807121b7535c7ce6aa1610aa6af7cab618 100644 (file)
 /* BEFORE-GREETING TRIAGE
 /* .ad
 /* .fi
+/* .IP "\fBdnsblog_service_name (dnsblog)\fR"
+/*     The name of the \fBdnsblog\fR(8) service entry in master.cf.
 /* .IP "\fBpostscreen_access_list (permit_mynetworks)\fR"
 /*     Permanent white/blacklist for remote SMTP client IP addresses;
 /*     \fBpostscreen\fR(8) searches this list immediately after a remote SMTP
 /*     password, to the DNSBL domain name that postscreen will reply with
 /*     when it rejects mail.
 /* .IP "\fBpostscreen_dnsbl_sites (empty)\fR"
-/*     Optional list of DNS blocklist domains, filters and weight
+/*     Optional list of DNS white/blacklist domains, filters and weight
 /*     factors.
 /* .IP "\fBpostscreen_dnsbl_threshold (1)\fR"
 /*     The inclusive lower bound for blocking an SMTP client, based on
 /* .fi
 /* .IP "\fBpostscreen_cache_cleanup_interval (12h)\fR"
 /*     The amount of time between \fBpostscreen\fR(8) cache cleanup runs.
-/* .IP "\fBpostscreen_cache_map (btree:$data_directory/ps_cache)\fR"
+/* .IP "\fBpostscreen_cache_map (btree:$data_directory/postscreen_cache)\fR"
 /*     Persistent storage for the \fBpostscreen\fR(8) server decisions.
 /* .IP "\fBpostscreen_cache_retention_time (7d)\fR"
 /*     The amount of time that \fBpostscreen\fR(8) will cache an expired
 /*     The SMTP TLS security level for the \fBpostscreen\fR(8) server; when
 /*     a non-empty value is specified, this overrides the obsolete parameters
 /*     postscreen_use_tls and postscreen_enforce_tls.
+/* .IP "\fBtlsproxy_service_name (tlsproxy)\fR"
+/*     The name of the \fBtlsproxy\fR(8) service entry in master.cf.
 /* OBSOLETE STARTTLS SUPPORT CONTROLS
 /* .ad
 /* .fi
 /* SEE ALSO
 /*     smtpd(8), Postfix SMTP server
 /*     tlsproxy(8), Postfix TLS proxy server
-/*     dnsblog(8), temporary DNS helper
+/*     dnsblog(8), DNS black/whitelist logger
 /*     syslogd(8), system logging
 /* README FILES
 /* .ad
@@ -439,6 +443,9 @@ int     var_psc_barlf_ttl;
 int     var_psc_cmd_count;
 char   *var_psc_cmd_time;
 
+char   *var_dnsblog_service;
+char   *var_tlsproxy_service;
+
 char   *var_smtpd_rej_footer;
 char   *var_psc_rej_footer;
 
@@ -1082,6 +1089,8 @@ int     main(int argc, char **argv)
        VAR_PSC_DNSBL_REPLY, DEF_PSC_DNSBL_REPLY, &var_psc_dnsbl_reply, 0, 0,
        VAR_PSC_TLS_LEVEL, DEF_PSC_TLS_LEVEL, &var_psc_tls_level, 0, 0,
        VAR_PSC_CMD_FILTER, DEF_PSC_CMD_FILTER, &var_psc_cmd_filter, 0, 0,
+       VAR_DNSBLOG_SERVICE, DEF_DNSBLOG_SERVICE, &var_dnsblog_service, 1, 0,
+       VAR_TLSPROXY_SERVICE, DEF_TLSPROXY_SERVICE, &var_tlsproxy_service, 1, 0,
        0,
     };
     static const CONFIG_INT_TABLE int_table[] = {
index 81085892db70076037a1132782a4d4ca11de07cb..f21b04efdd50de51ab1e294f84bd37a726bc932e 100644 (file)
@@ -72,6 +72,7 @@
 #include <valid_hostname.h>
 #include <ip_match.h>
 #include <myaddrinfo.h>
+#include <stringops.h>
 
 /* Global library. */
 
 
 #include <postscreen.h>
 
-#define DNSBL_SERVICE                  "dnsblog"
+ /*
+  * Talking to the DNSBLOG service.
+  */
 #define DNSBLOG_TIMEOUT                        10
+static char *psc_dnsbl_service;
 
  /*
   * Per-DNSBL filters and weights.
@@ -479,8 +483,9 @@ int     psc_dnsbl_request(const char *client_addr,
      * implementation.
      */
     for (ht = dnsbl_site_list; *ht; ht++) {
-       if ((fd = LOCAL_CONNECT("private/" DNSBL_SERVICE, NON_BLOCKING, 1)) < 0) {
-           msg_warn("%s: connect to " DNSBL_SERVICE " service: %m", myname);
+       if ((fd = LOCAL_CONNECT(psc_dnsbl_service, NON_BLOCKING, 1)) < 0) {
+           msg_warn("%s: connect to %s service: %m",
+                    myname, psc_dnsbl_service);
            continue;
        }
        stream = vstream_fdopen(fd, O_RDWR);
@@ -489,7 +494,8 @@ int     psc_dnsbl_request(const char *client_addr,
                   ATTR_TYPE_STR, MAIL_ATTR_ACT_CLIENT_ADDR, client_addr,
                   ATTR_TYPE_END);
        if (vstream_fflush(stream) != 0) {
-           msg_warn("%s: error sending to " DNSBL_SERVICE " service: %m", myname);
+           msg_warn("%s: error sending to %s service: %m",
+                    myname, psc_dnsbl_service);
            vstream_fclose(stream);
            continue;
        }
@@ -514,6 +520,12 @@ void    psc_dnsbl_init(void)
     if (dnsbl_site_cache != 0)
        msg_panic("%s: called more than once", myname);
 
+    /*
+     * pre-compute the DNSBLOG socket name.
+     */
+    psc_dnsbl_service = concatenate(MAIL_CLASS_PRIVATE, "/",
+                                   var_dnsblog_service, (char *) 0);
+
     /*
      * Prepare for quick iteration when sending out queries to all DNSBL
      * servers, and for quick lookup when a reply arrives from a specific
index 9d8c1280539396bc9f513484508de8b85145cc8f..eb5d95a524d1dcd74b6a0f7e31949e897ae9a3e3 100644 (file)
@@ -49,6 +49,7 @@
 #include <mymalloc.h>
 #include <connect.h>
 #include <stringops.h>                 /* concatenate() */
+#include <vstring.h>
 
 /* Global library. */
 
@@ -80,6 +81,8 @@ typedef struct {
 
 #define TLSPROXY_INIT_TIMEOUT          10
 
+static char *psc_tlsp_service = 0;
+
 /* psc_starttls_finish - complete negotiation with TLS proxy */
 
 static void psc_starttls_finish(int event, char *context)
@@ -139,7 +142,7 @@ static void psc_starttls_finish(int event, char *context)
         */
        msg_warn("%s sending file handle to %s service",
                 event == EVENT_TIME ? "timeout" : "problem",
-                TLSPROXY_SERVICE);
+                psc_tlsp_service);
        event_disable_readwrite(vstream_fileno(tlsproxy_stream));
        vstream_fclose(tlsproxy_stream);
        PSC_SEND_REPLY(smtp_state,
@@ -184,16 +187,21 @@ void    psc_starttls_open(PSC_STATE *smtp_state, EVENT_NOTIFY_FN resume_event)
     const char *myname = "psc_starttls_open";
     PSC_STARTTLS *starttls_state;
     VSTREAM *tlsproxy_stream;
-    char   *remote_endpt;
     int     fd;
+    static VSTRING *remote_endpt = 0;
+
+    if (psc_tlsp_service == 0) {
+       psc_tlsp_service = concatenate(MAIL_CLASS_PRIVATE "/",
+                                      var_tlsproxy_service, (char *) 0);
+       remote_endpt = vstring_alloc(20);
+    }
 
     /*
      * Connect to the tlsproxy(8) daemon. We report all errors
      * asynchronously, to avoid having to maintain multiple delivery paths.
      */
-    if ((fd = LOCAL_CONNECT("private/" TLSPROXY_SERVICE,
-                           NON_BLOCKING, 1)) < 0) {
-       msg_warn("connect to %s service: %m", TLSPROXY_SERVICE);
+    if ((fd = LOCAL_CONNECT(psc_tlsp_service, NON_BLOCKING, 1)) < 0) {
+       msg_warn("connect to %s service: %m", psc_tlsp_service);
        PSC_SEND_REPLY(smtp_state,
                    "454 4.7.0 TLS not available due to local problem\r\n");
        event_request_timer(resume_event, (char *) smtp_state, 0);
@@ -215,16 +223,15 @@ void    psc_starttls_open(PSC_STATE *smtp_state, EVENT_NOTIFY_FN resume_event)
      * simplify all the format strings throughout the program.
      */
     tlsproxy_stream = vstream_fdopen(fd, O_RDWR);
-    remote_endpt = concatenate("[", smtp_state->smtp_client_addr, "]:",
-                              smtp_state->smtp_client_port, (char *) 0);
+    vstring_sprintf(remote_endpt, "[%s]:%s", smtp_state->smtp_client_addr,
+                   smtp_state->smtp_client_port);
     attr_print(tlsproxy_stream, ATTR_FLAG_NONE,
-              ATTR_TYPE_STR, MAIL_ATTR_REMOTE_ENDPT, remote_endpt,
+              ATTR_TYPE_STR, MAIL_ATTR_REMOTE_ENDPT, STR(remote_endpt),
               ATTR_TYPE_INT, MAIL_ATTR_FLAGS, TLS_PROXY_FLAG_ROLE_SERVER,
               ATTR_TYPE_INT, MAIL_ATTR_TIMEOUT, psc_normal_cmd_time_limit,
               ATTR_TYPE_END);
-    myfree(remote_endpt);
     if (vstream_fflush(tlsproxy_stream) != 0) {
-       msg_warn("error sending request to %s service: %m", TLSPROXY_SERVICE);
+       msg_warn("error sending request to %s service: %m", psc_tlsp_service);
        vstream_fclose(tlsproxy_stream);
        PSC_SEND_REPLY(smtp_state,
                    "454 4.7.0 TLS not available due to local problem\r\n");
index f9a525e08f939ac4ed62b79404fd29ede8dbb5e4..3dd9367b928b855a8f88d111c0af7bcb159efab8 100644 (file)
@@ -1251,6 +1251,11 @@ char   *var_unv_from_tf_act;
 
 int     smtpd_proxy_opts;
 
+#ifdef USE_TLSPROXY
+char   *var_tlsproxy_service;
+
+#endif
+
  /*
   * Silly little macros.
   */
@@ -4165,9 +4170,9 @@ static int starttls_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
 #define PROXY_OPEN_FLAGS \
        (TLS_PROXY_FLAG_ROLE_SERVER | TLS_PROXY_FLAG_SEND_CONTEXT)
 
-    state->tlsproxy = tls_proxy_open(PROXY_OPEN_FLAGS, state->client,
-                                    state->addr, state->port,
-                                    var_smtpd_tmout);
+    state->tlsproxy = tls_proxy_open(var_tlsproxy_service, PROXY_OPEN_FLAGS,
+                                    state->client, state->addr,
+                                    state->port, var_smtpd_tmout);
     if (state->tlsproxy == 0) {
        state->error_mask |= MAIL_ERROR_SOFTWARE;
        /* RFC 4954 Section 6. */
@@ -4374,9 +4379,10 @@ static void smtpd_proto(SMTPD_STATE *state)
        if (SMTPD_STAND_ALONE(state) == 0 && var_smtpd_tls_wrappermode) {
 #ifdef USE_TLSPROXY
            /* We garbage-collect the VSTREAM in smtpd_state_reset() */
-           state->tlsproxy = tls_proxy_open(PROXY_OPEN_FLAGS, state->client,
-                                            state->addr, state->port,
-                                            var_smtpd_tmout);
+           state->tlsproxy = tls_proxy_open(var_tlsproxy_service,
+                                            PROXY_OPEN_FLAGS,
+                                            state->client, state->addr,
+                                            state->port, var_smtpd_tmout);
            if (state->tlsproxy == 0) {
                msg_warn("Wrapper-mode request dropped from %s for service %s."
                       " TLS context initialization failed. For details see"
@@ -5242,6 +5248,9 @@ int     main(int argc, char **argv)
        VAR_UNV_RCPT_TF_ACT, DEF_UNV_RCPT_TF_ACT, &var_unv_rcpt_tf_act, 1, 0,
        VAR_UNV_FROM_TF_ACT, DEF_UNV_FROM_TF_ACT, &var_unv_from_tf_act, 1, 0,
        VAR_SMTPD_CMD_FILTER, DEF_SMTPD_CMD_FILTER, &var_smtpd_cmd_filter, 0, 0,
+#ifdef USE_TLSPROXY
+       VAR_TLSPROXY_SERVICE, DEF_TLSPROXY_SERVICE, &var_tlsproxy_service, 1, 0,
+#endif
        0,
     };
     static const CONFIG_RAW_TABLE raw_table[] = {
index f47ae4ec62522234ab86495c13dc604e900d6583..1dbe1546b5db9548c885db0e2dcf473345e47af5 100644 (file)
@@ -206,6 +206,7 @@ tls_proxy_clnt.o: ../../include/argv.h
 tls_proxy_clnt.o: ../../include/attr.h
 tls_proxy_clnt.o: ../../include/connect.h
 tls_proxy_clnt.o: ../../include/iostuff.h
+tls_proxy_clnt.o: ../../include/mail_params.h
 tls_proxy_clnt.o: ../../include/mail_proto.h
 tls_proxy_clnt.o: ../../include/msg.h
 tls_proxy_clnt.o: ../../include/mymalloc.h
index fb80923237f423fb328c190d7eb60db457e8b4e9..e677c67aba9d38e562198afb8832cd13c373a24d 100644 (file)
  /*
   * External interface.
   */
-#define TLSPROXY_SERVICE               "tlsproxy"
-
 #define TLS_PROXY_FLAG_ROLE_SERVER     (1<<0)  /* request server role */
 #define TLS_PROXY_FLAG_ROLE_CLIENT     (1<<1)  /* request client role */
 #define TLS_PROXY_FLAG_SEND_CONTEXT    (1<<2)  /* send TLS context */
 
 #ifdef USE_TLS
 
-extern VSTREAM *tls_proxy_open(int, VSTREAM *, const char *,
+extern VSTREAM *tls_proxy_open(const char *, int, VSTREAM *, const char *,
                                       const char *, int);
 extern TLS_SESS_STATE *tls_proxy_context_receive(VSTREAM *);
 extern void tls_proxy_context_free(TLS_SESS_STATE *);
index a6877975d3280e3f1cd57d5476b6b9812d5763a4..cf7c32f3e037c28a95dccabca5f22206ebbcda60 100644 (file)
@@ -6,8 +6,9 @@
 /* SYNOPSIS
 /*     #include <tlsproxy_clnt.h>
 /*
-/*     VSTREAM *tls_proxy_open(flags, peer_stream, peer_addr,
+/*     VSTREAM *tls_proxy_open(service, flags, peer_stream, peer_addr,
 /*                               peer_port, timeout)
+/*     const char *service;
 /*     int     flags;
 /*     VSTREAM *peer_stream;
 /*     const char *peer_addr;
@@ -47,6 +48,8 @@
 /*     was received with tls_proxy_context_receive().
 /*
 /*     Arguments:
+/* .IP service
+/*     The (base) name of the tlsproxy service.
 /* .IP flags
 /*     Bit-wise OR of:
 /* .RS
 #include <msg.h>
 #include <mymalloc.h>
 #include <connect.h>
-#include <stringops.h>                 /* concatenate() */
+#include <stringops.h>
+#include <vstring.h>
 
 /* Global library. */
 
 #include <mail_proto.h>
+#include <mail_params.h>
 
 /* TLS library-specific. */
 
 
 #define TLSPROXY_INIT_TIMEOUT          10
 
+/* SLMs. */
+
+#define STR    vstring_str
+
 /* tls_proxy_open - open negotiations with TLS proxy */
 
-VSTREAM *tls_proxy_open(int flags, VSTREAM *peer_stream,
-                              const char *peer_addr,
-                              const char *peer_port,
-                              int timeout)
+VSTREAM *tls_proxy_open(const char *service, int flags,
+                               VSTREAM *peer_stream,
+                               const char *peer_addr,
+                               const char *peer_port,
+                               int timeout)
 {
     VSTREAM *tlsproxy_stream;
-    char   *remote_endpt;
     int     status;
     int     fd;
+    static VSTRING *tlsproxy_service = 0;
+    static VSTRING *remote_endpt = 0;
+
+    /*
+     * Initialize.
+     */
+    if (tlsproxy_service == 0) {
+       tlsproxy_service = vstring_alloc(20);
+       remote_endpt = vstring_alloc(20);
+    }
 
     /*
-     * Connect to the tlsproxy(8) daemon. We report all errors
-     * asynchronously, to avoid having to maintain multiple delivery paths.
+     * Connect to the tlsproxy(8) daemon.
      */
-    if ((fd = LOCAL_CONNECT("private/" TLSPROXY_SERVICE, BLOCKING,
+    vstring_sprintf(tlsproxy_service, "%s/%s", MAIL_CLASS_PRIVATE, service);
+    if ((fd = LOCAL_CONNECT(STR(tlsproxy_service), BLOCKING,
                            TLSPROXY_INIT_TIMEOUT)) < 0) {
-       msg_warn("connect to %s service: %m", TLSPROXY_SERVICE);
+       msg_warn("connect to %s service: %m", STR(tlsproxy_service));
        return (0);
     }
 
@@ -134,16 +153,15 @@ VSTREAM *tls_proxy_open(int flags, VSTREAM *peer_stream,
      * simplify all the format strings throughout the program.
      */
     tlsproxy_stream = vstream_fdopen(fd, O_RDWR);
-    remote_endpt = concatenate("[", peer_addr, "]:",
-                              peer_port, (char *) 0);
+    vstring_sprintf(remote_endpt, "[%s]:%s", peer_addr, peer_port);
     attr_print(tlsproxy_stream, ATTR_FLAG_NONE,
-              ATTR_TYPE_STR, MAIL_ATTR_REMOTE_ENDPT, remote_endpt,
+              ATTR_TYPE_STR, MAIL_ATTR_REMOTE_ENDPT, STR(remote_endpt),
               ATTR_TYPE_INT, MAIL_ATTR_FLAGS, flags,
               ATTR_TYPE_INT, MAIL_ATTR_TIMEOUT, timeout,
               ATTR_TYPE_END);
-    myfree(remote_endpt);
     if (vstream_fflush(tlsproxy_stream) != 0) {
-       msg_warn("error sending request to %s service: %m", TLSPROXY_SERVICE);
+       msg_warn("error sending request to %s service: %m",
+                STR(tlsproxy_service));
        vstream_fclose(tlsproxy_stream);
        return (0);
     }
@@ -164,7 +182,7 @@ VSTREAM *tls_proxy_open(int flags, VSTREAM *peer_stream,
         * configuration error, or other causes).
         */
        msg_warn("%s service role \"%s\" is not available",
-                TLSPROXY_SERVICE,
+                STR(tlsproxy_service),
                 (flags & TLS_PROXY_FLAG_ROLE_SERVER) ? "server" :
                 (flags & TLS_PROXY_FLAG_ROLE_CLIENT) ? "client" :
                 "bogus role");
@@ -181,7 +199,8 @@ VSTREAM *tls_proxy_open(int flags, VSTREAM *peer_stream,
        /*
         * Some error: drop the TLS proxy stream.
         */
-       msg_warn("sending file handle to %s service: %m", TLSPROXY_SERVICE);
+       msg_warn("sending file handle to %s service: %m",
+                STR(tlsproxy_service));
        vstream_fclose(tlsproxy_stream);
        return (0);
     }
@@ -197,7 +216,7 @@ TLS_SESS_STATE *tls_proxy_context_receive(VSTREAM *proxy_stream)
     tls_context = (TLS_SESS_STATE *) mymalloc(sizeof(*tls_context));
 
     if (attr_scan(proxy_stream, ATTR_FLAG_STRICT,
-                 ATTR_TYPE_FUNC, tls_proxy_context_scan, (char *) tls_context,
+              ATTR_TYPE_FUNC, tls_proxy_context_scan, (char *) tls_context,
                  ATTR_TYPE_END) != 1) {
        tls_proxy_context_free(tls_context);
        return (0);
@@ -208,7 +227,7 @@ TLS_SESS_STATE *tls_proxy_context_receive(VSTREAM *proxy_stream)
 
 /* tls_proxy_context_free - destroy object from tls_proxy_context_receive() */
 
-void tls_proxy_context_free(TLS_SESS_STATE *tls_context)
+void    tls_proxy_context_free(TLS_SESS_STATE *tls_context)
 {
     if (tls_context->peer_CN)
        myfree(tls_context->peer_CN);
index f55cfe9f11b753075ff9a3eab1e6d78b0ee60818..06dea0e959a047640f61261932856d7b40847ad5 100644 (file)
@@ -849,7 +849,7 @@ static void tlsp_get_request_event(int event, char *context)
        msg_info("CONNECT %s %s",
                 (req_flags & TLS_PROXY_FLAG_ROLE_SERVER) ? "from" :
                 (req_flags & TLS_PROXY_FLAG_ROLE_CLIENT) ? "to" :
-                "(bogus direction)", state->remote_endpt);
+                "(bogus_direction)", state->remote_endpt);
        state->req_flags = req_flags;
        state->timeout = timeout + 10;          /* XXX */
        event_enable_read(plaintext_fd, tlsp_get_fd_event, (char *) state);
index 32ad47c34194e750ede35b04942bd39e87529400..657f1fc383d18117f5b22d170921119e27bd0579 100644 (file)
@@ -74,6 +74,7 @@ static void dict_ht_update(DICT *dict, const char *name, const char *value)
 {
     DICT_HT *dict_ht = (DICT_HT *) dict;
     HTABLE_INFO *ht;
+    char   *saved_value = mystrdup(value);
 
     /*
      * Optionally fold the key.
@@ -89,7 +90,7 @@ static void dict_ht_update(DICT *dict, const char *name, const char *value)
     } else {
        ht = htable_enter(dict_ht->table, name, (char *) 0);
     }
-    ht->value = mystrdup(value);
+    ht->value = saved_value;
 }
 
 /* dict_ht_sequence - first/next iterator */
index 9e62213502ca947b0c873a88c252ed3f19a651b4..16df5cc547102a44e988408824f114264b6391fa 100644 (file)
@@ -154,6 +154,9 @@ char   *mymalloc(ssize_t len)
      */
     if (len < 1)
        msg_panic("mymalloc: requested length %ld", (long) len);
+#ifdef MYMALLOC_FUZZ
+    len += MYMALLOC_FUZZ;
+#endif
     if ((real_ptr = (MBLOCK *) malloc(SPACE_FOR(len))) == 0)
        msg_fatal("mymalloc: insufficient memory: %m");
     CHECK_OUT_PTR(ptr, real_ptr, len);
@@ -180,6 +183,9 @@ char   *myrealloc(char *ptr, ssize_t len)
      */
     if (len < 1)
        msg_panic("myrealloc: requested length %ld", (long) len);
+#ifdef MYMALLOC_FUZZ
+    len += MYMALLOC_FUZZ;
+#endif
     CHECK_IN_PTR(ptr, real_ptr, old_len, "myrealloc");
     if ((real_ptr = (MBLOCK *) realloc((char *) real_ptr, SPACE_FOR(len))) == 0)
        msg_fatal("myrealloc: insufficient memory: %m");
index 93dc2a054169dab06081cafae25d7bc938e4e889..26fbace79c7c9dbabba044c9c522e7d3b0eb75b2 100644 (file)
@@ -576,6 +576,7 @@ extern int opterr;
 #define BROKEN_AI_PASSIVE_NULL_HOST
 #define BROKEN_AI_NULL_SERVICE
 #define USE_SYSV_POLL
+#define MYMALLOC_FUZZ  1
 #endif
 
 #ifdef AIX4