]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.4-20060719
authorWietse Venema <wietse@porcupine.org>
Wed, 19 Jul 2006 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:32:27 +0000 (06:32 +0000)
41 files changed:
postfix/HISTORY
postfix/README_FILES/FILTER_README
postfix/README_FILES/MILTER_README
postfix/README_FILES/SASL_README
postfix/README_FILES/TLS_README
postfix/conf/postfix-files
postfix/html/FILTER_README.html
postfix/html/MILTER_README.html
postfix/html/SASL_README.html
postfix/html/TLS_README.html
postfix/html/postconf.5.html
postfix/html/postfix-manuals.html
postfix/html/postfix.1.html
postfix/html/smtp.8.html
postfix/html/smtpd.8.html
postfix/man/man1/postfix.1
postfix/man/man5/postconf.5
postfix/man/man8/smtp.8
postfix/man/man8/smtpd.8
postfix/mantools/postlink
postfix/proto/FILTER_README.html
postfix/proto/MILTER_README.html
postfix/proto/SASL_README.html
postfix/proto/TLS_README.html
postfix/proto/postconf.proto
postfix/src/cleanup/cleanup.h
postfix/src/cleanup/cleanup_milter.c
postfix/src/cleanup/cleanup_state.c
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/milter/test-list
postfix/src/milter/test-milter.c
postfix/src/postfix/postfix.c
postfix/src/smtp/lmtp_params.c
postfix/src/smtp/smtp.c
postfix/src/smtp/smtp_params.c
postfix/src/smtp/smtp_proto.c
postfix/src/smtp/smtp_sasl_glue.c
postfix/src/smtpd/smtpd.c
postfix/src/tls/tls.h
postfix/src/tls/tls_server.c

index 5fb21364703cefecc555c59c5b67521aa674f35d..c2752fce677961eb5c0fd89b8130ae3200573ae7 100644 (file)
@@ -12534,8 +12534,52 @@ Apologies for any names omitted.
        from smtpd to cleanup broke in the middle.  Found by Coverity.
        File: milter/milter.c.
 
+20060716
+
+       Bugfix: "sendmail -bs" panic caused by a missing
+       SMTPD_STATE_ALONE() guard before a milter_abort() call.
+       File: smtpd/smtpd.c.
+
+       Bugfix (bug introduced with Postfix 2.2): the Postfix SMTP
+       client enforced Mandatory TLS only when talking to an ESMTP
+       server.  Victor Duchovni.  File: src/smtp/smtp_proto.c.
+
+20060718
+
+       Bugfix (bug introduced 20060711): null pointer bug when
+       rejecting SMTP mail with Milter application.  File:
+       cleanup/cleanup_milter.c.
+
+       Workaround (problem introduced in 200605/200606 TLS update):
+       the Postfix SMTP server now issues TLS session IDs even
+       when TLS session caching is turned off, otherwise MS Outlook
+       fails to deliver mail. There may also be interoperability
+       issues with other MTAs that we haven't discovered yet.
+       Specify "smtpd_tls_always_issue_session_ids = no" to disable
+       the workaround. Victor Duchovni. Files: smtpd/smtpd.c,
+       tls/tls_server.c.
+
+20060719
+
+       Cleanup: the smtp_sasl_auth_enforce feature is gone. It was
+       meant to work around a problem that was introduced with
+       plaintext fallback after a failed TLS handshake.  Unfortunately,
+       it created more problems than it solved. We now address the
+       underlying problem more directly as described next. File:
+       smtp/smtp_proto.c.
+
+       Safety: with plaintext fallback after failed TLS handshake,
+       the Postfix SMTP client defers mail if the server does not
+       support SASL over plaintext, while the Postfix SMTP client
+       would have attempted to log in with SASL after successful
+       TLS handshake.  This prevents mail from being rejected with
+       insufficient mail relay permission.  Files: smtp/smtp_connect.c,
+       smtp/smtp_session.c, smtp/smtp_proto.c.
+
 Wish list:
 
+       Add M flag (enable multi-recipient delivery) to pipe daemon.
+
        The usage of TLScontext->cache_type is unclear. It specifies
        a TLS session cache type (smtpd, smtp, or lmtp), but it is
        sometimes used as an indicator that TLS session caching is
index cace42a9e883cc1ea250e2ecf8bc99768511ab6a..330e586303b7a4f6794fdd0641e512587a41d74d 100644 (file)
@@ -344,12 +344,10 @@ the Postfix master.cf file:
     real client name IP address. See smtp(8) and XFORWARD_README for more
     information.
 
-  * With "-o disable_mime_output_conversion=yes", the scan delivery agent will
-    not convert 8BITMIME mail to quoted-printable form while delivering to the
-    content filter, as that would invalidate domainkeys and other digital
-    signatures. This workaround is needed because some SMTP-based content
-    filters don't announce 8BITMIME support, even though they can handle it
-    just fine.
+  * The "-o disable_mime_output_conversion=yes" is a workaround that prevents
+    the breaking of domainkeys and other digital signatures. This is needed
+    because some SMTP-based content filters don't announce 8BITMIME support,
+    even though they can handle it just fine.
 
 A\bAd\bdv\bva\ban\bnc\bce\bed\bd c\bco\bon\bnt\bte\ben\bnt\bt f\bfi\bil\blt\bte\ber\br:\b: r\bru\bun\bnn\bni\bin\bng\bg t\bth\bhe\be c\bco\bon\bnt\bte\ben\bnt\bt f\bfi\bil\blt\bte\ber\br
 
index 66356a0955d031cdc9260fd62649e0a3279d650e..659e23a0664c098ab68036ca09962944b1490279 100644 (file)
@@ -382,9 +382,9 @@ message).
 W\bWo\bor\brk\bka\bar\bro\bou\bun\bnd\bds\bs
 
 Content filters may break domain key etc. signatures. If you use an SMTP-based
-filter as described in FILTER_README, then you should add a line to master.cf
-with "disable_mime_output_conversion = yes", as described in the advanced
-content filter example.
+content filter, then you should add a line to master.cf with "-
+o disable_mime_output_conversion=yes" (note: no spaces around the "="), as
+described in the advanced content filter example.
 
 Sendmail Milter applications were originally developed for the Sendmail version
 8 MTA, which has a different architecture than Postfix. The result is that some
index 163ca0416fa269a915bafe6581528f94aead3e5e..87ae46b270523070597500c77340b48900300fed 100644 (file)
@@ -71,13 +71,14 @@ no need to link extra libraries into Postfix.
 To generate the necessary Makefiles, execute the following in the Postfix top-
 level directory:
 
-    % make makefiles CCARGS='-DUSE_SASL_AUTH -DDEF_SASL_SERVER=\"dovecot\"'
+    % make makefiles CCARGS='-DUSE_SASL_AUTH -
+    DDEF_SASL_SERVER_TYPE=\"dovecot\"'
 
 After this, proceed with "make" as described in the INSTALL document.
 
 Notes:
 
-  * The "-DDEF_SASL_SERVER" stuff is not necessary; it just makes Postfix
+  * The "-DDEF_SASL_SERVER_TYPE" stuff is not necessary; it just makes Postfix
     configuration a little more convenient because you don't have to specify
     the SASL plug-in type in the Postfix main.cf file.
 
index a5353848a639d50c70cc7fcc32e7b8891f10abb5..49194798a3f153cf44acacf842cf16b6c4173ab3 100644 (file)
@@ -323,8 +323,8 @@ port<>25 and OE (5.01 Mac on all ports).
 
 It is strictly discouraged to use this mode from main.cf. If you want to
 support this service, enable a special port in master.cf and specify "-
-o smtpd_tls_wrappermode = yes" as an smtpd(8) command line option. Port 465
-(smtps) was once chosen for this feature.
+o smtpd_tls_wrappermode=yes" (note: no space around the "=") as an smtpd(8)
+command line option. Port 465 (smtps) was once chosen for this feature.
 
 Example:
 
@@ -426,6 +426,17 @@ Example:
     /etc/postfix/main.cf:
         smtpd_tls_session_cache_timeout = 3600s
 
+When the Postfix SMTP server does not save TLS sessions to an external cache
+database, client-side session caching is unlikely to be useful. To prevent such
+wastage, the Postfix SMTP server can be configured to not issue TLS session
+ids. By default the Postfix SMTP server always issues TLS session ids. This
+works around known interoperability issues with some MUAs, and prevents
+possible interoperability issues with other MTAs.
+
+Example:
+
+        smtpd_tls_always_issue_session_ids = no
+
 S\bSe\ber\brv\bve\ber\br a\bac\bcc\bce\bes\bss\bs c\bco\bon\bnt\btr\bro\bol\bl
 
 Postfix TLS support introduces three additional features for Postfix SMTP
index 714163f7a3bc95d0b0aef32cae1eb0c7390bb1d5..b04779dc005547bfc8957dac2a52b7a8f7988d14 100644 (file)
@@ -353,6 +353,7 @@ $html_directory/postconf.1.html:f:root:-:644
 $html_directory/postconf.5.html:f:root:-:644
 $html_directory/postdrop.1.html:f:root:-:644
 $html_directory/postfix-logo.jpg:f:root:-:644
+$html_directory/postfix-manuals.html:f:root:-:644
 $html_directory/postfix.1.html:f:root:-:644
 $html_directory/postkick.1.html:f:root:-:644
 $html_directory/postlock.1.html:f:root:-:644
index 01d08b6d78929c35ef4de79e78026f166f72b503..bd78079a809fe26cbd0f923dcf7df649bf518184 100644 (file)
@@ -634,12 +634,10 @@ after-filter smtpd process, so that filtered mail is logged with
 the real client name IP address. See <a href="smtp.8.html">smtp(8)</a> and <a href="XFORWARD_README.html">XFORWARD_README</a>
 for more information. </p>
 
-<li> <p> With "-o <a href="postconf.5.html#disable_mime_output_conversion">disable_mime_output_conversion</a>=yes", the scan
-delivery agent will not convert 8BITMIME mail to quoted-printable
-form while delivering to the content filter, as that would invalidate
-domainkeys and other digital signatures.  This workaround is needed
-because some SMTP-based content filters don't announce 8BITMIME
-support, even though they can handle it just fine.  </p>
+<li> <p> The "-o <a href="postconf.5.html#disable_mime_output_conversion">disable_mime_output_conversion</a>=yes" is a workaround
+that prevents the breaking of domainkeys and other digital signatures.
+This is needed because some SMTP-based content filters don't announce
+8BITMIME support, even though they can handle it just fine.  </p>
 
 </ul>
 
index 1ae1d0676f52ddc4914d7ea13b2c05d75f62694c..9f8a5151be5bc1cd26fe350afcd9a7c37f9254b9 100644 (file)
@@ -613,9 +613,9 @@ TO </td> </tr>
 <h2><a name="workarounds">Workarounds</a></h2>
 
 <p> Content filters may break domain key etc. signatures. If you
-use an SMTP-based filter as described in <a href="FILTER_README.html">FILTER_README</a>, then you
-should add a line to <a href="master.5.html">master.cf</a> with "<a href="postconf.5.html#disable_mime_output_conversion">disable_mime_output_conversion</a>
-= yes", as described in the <a
+use an SMTP-based content filter, then you should add a line to
+<a href="master.5.html">master.cf</a> with "-o <a href="postconf.5.html#disable_mime_output_conversion">disable_mime_output_conversion</a>=yes" (note: no
+spaces around the "="), as described in the <a
 href="FILTER_README.html#advanced_filter">advanced content filter</a>
 example. </p>
 
index d177f7f15adffd70c61bbd480922baf3b46d34ae..3086d14e4cc804d748f848dbdabf6ad24d41c4a1 100644 (file)
@@ -127,7 +127,7 @@ in the Postfix top-level directory: </p>
 
 <blockquote>
 <pre>
-% make makefiles CCARGS='-DUSE_SASL_AUTH -DDEF_SASL_SERVER=\"dovecot\"'
+% make makefiles CCARGS='-DUSE_SASL_AUTH -DDEF_SASL_SERVER_TYPE=\"dovecot\"'
 </pre>
 </blockquote>
 
@@ -138,7 +138,7 @@ in the Postfix top-level directory: </p>
 
 <ul>
 
-<li> <p> The "-DDEF_SASL_SERVER" stuff is not necessary; it just
+<li> <p> The "-DDEF_SASL_SERVER_TYPE" stuff is not necessary; it just
 makes Postfix configuration a little more convenient because you
 don't have to specify the SASL plug-in type in the Postfix <a href="postconf.5.html">main.cf</a>
 file.  </p>
index 42ed35f78d2b6ab47eef274f059d3d4acd377561..b3f30dadd56ff92a20368589cbd8c791562bd70f 100644 (file)
@@ -490,8 +490,9 @@ and OE (5.01 Mac on all ports). </p>
 
 <p> It is strictly discouraged to use this mode from <a href="postconf.5.html">main.cf</a>. If
 you want to support this service, enable a special port in <a href="master.5.html">master.cf</a>
-and specify "-o <a href="postconf.5.html#smtpd_tls_wrappermode">smtpd_tls_wrappermode</a> = yes" as an <a href="smtpd.8.html">smtpd(8)</a> command
-line option.  Port 465 (smtps) was once chosen for this feature.
+and specify "-o <a href="postconf.5.html#smtpd_tls_wrappermode">smtpd_tls_wrappermode</a>=yes" (note: no space around
+the "=") as an <a href="smtpd.8.html">smtpd(8)</a> command line option.  Port 465 (smtps) was
+once chosen for this feature.
 </p>
 
 <p> Example: </p>
@@ -631,6 +632,22 @@ recommends a maximum of 24 hours.  </p>
 </pre>
 </blockquote>
 
+<p> When the Postfix SMTP server does not save TLS sessions to an
+external cache database, client-side session caching is unlikely
+to be useful.  To prevent such wastage, the Postfix SMTP server can
+be configured to not issue TLS session ids. By default the Postfix
+SMTP server always issues TLS session ids. This works around known
+interoperability issues with some MUAs, and prevents possible
+interoperability issues with other MTAs. </p>
+
+<p> Example: </p>
+
+<blockquote>
+<pre>
+    <a href="postconf.5.html#smtpd_tls_always_issue_session_ids">smtpd_tls_always_issue_session_ids</a> = no
+</pre>
+</blockquote>
+
 <h3><a name="server_access">Server access control</a> </h3>
 
 <p> Postfix TLS support introduces three additional features for
index 0600eabab6dcbaf474bf5561c62276fc3325b605..b485dc1d8b7cc706e45442e6dc88d9f992e07628 100644 (file)
@@ -3556,17 +3556,6 @@ Enable SASL authentication in the Postfix LMTP client.
 </p>
 
 
-</DD>
-
-<DT><b><a name="lmtp_sasl_auth_enforce">lmtp_sasl_auth_enforce</a>
-(default: yes)</b></DT><DD>
-
-<p> The LMTP-specific version of the <a href="postconf.5.html#smtp_sasl_auth_enforce">smtp_sasl_auth_enforce</a>
-configuration parameter.  See there for details. </p>
-
-<p> This feature is available in Postfix 2.3 and later. </p>
-
-
 </DD>
 
 <DT><b><a name="lmtp_sasl_mechanism_filter">lmtp_sasl_mechanism_filter</a>
@@ -7590,19 +7579,6 @@ Example:
 </pre>
 
 
-</DD>
-
-<DT><b><a name="smtp_sasl_auth_enforce">smtp_sasl_auth_enforce</a>
-(default: yes)</b></DT><DD>
-
-<p> If sender-dependent SASL passwords are turned off, defer mail
-delivery when an SMTP server does not support SASL authentication,
-while <a href="postconf.5.html#smtp_sasl_password_maps">smtp_sasl_password_maps</a> contains SASL login/password information
-for that server.  </p>
-
-<p> This feature is available in Postfix 2.3 and later. </p>
-
-
 </DD>
 
 <DT><b><a name="smtp_sasl_mechanism_filter">smtp_sasl_mechanism_filter</a>
@@ -9819,7 +9795,7 @@ null sender address.
 <DT><b><a name="smtpd_peername_lookup">smtpd_peername_lookup</a>
 (default: yes)</b></DT><DD>
 
-<p> Attempt to look up the Postfix SMTP client hostname, and verify that
+<p> Attempt to look up the remote SMTP client hostname, and verify that
 the name matches the client IP address. A client name is set to
 "unknown" when it cannot be looked up or verified, or when name
 lookup is disabled.  Turning off name lookup reduces delays due to
@@ -10780,6 +10756,36 @@ feature is therefore not recommended. </p>
 <p> This feature is available in Postfix 2.2 and later.  </p>
 
 
+</DD>
+
+<DT><b><a name="smtpd_tls_always_issue_session_ids">smtpd_tls_always_issue_session_ids</a>
+(default: yes)</b></DT><DD>
+
+<p> Force the Postfix SMTP server to issue a TLS session id, even
+when TLS session caching is turned off (<a href="postconf.5.html#smtpd_tls_session_cache_database">smtpd_tls_session_cache_database</a>
+is empty). This behavior is compatible with Postfix &lt; 2.3. </p>
+
+<p> With Postfix 2.3 and later the Postfix SMTP server can disable
+session id generation when TLS session caching is turned off. This
+keeps clients from caching sessions that almost certainly cannot
+be re-used.  </p>
+
+<p> By default, the Postfix SMTP server always generates TLS session
+ids. This works around a known defect in mail client applications
+such as MS Outlook, and may also prevent interoperability issues
+with other MTAs. </p>
+
+<p> Example: </p>
+
+<blockquote>
+<pre>
+    <a href="postconf.5.html#smtpd_tls_always_issue_session_ids">smtpd_tls_always_issue_session_ids</a> = no
+</pre>
+</blockquote>
+
+<p> This feature is available in Postfix 2.3 and later. </p>
+
+
 </DD>
 
 <DT><b><a name="smtpd_tls_ask_ccert">smtpd_tls_ask_ccert</a>
index ac25aab95fa9648f120621ad9130c7a8f6150ba4..9a6ea668ed109be4d5d1067263552edd5dfcd388 100644 (file)
@@ -113,9 +113,9 @@ the following convention:  </p>
 
 <li> <a href="bounce.5.html">bounce(5)</a>, Postfix bounce message templates 
 
-<li> <a href="master.5.html">master(5)</a>, Postfix master.cf file syntax 
+<li> <a href="master.5.html">master(5)</a>, Postfix <a href="master.5.html">master.cf</a> file syntax 
 
-<li> <a href="postconf.5.html">postconf(5)</a>, Postfix main.cf file syntax 
+<li> <a href="postconf.5.html">postconf(5)</a>, Postfix <a href="postconf.5.html">main.cf</a> file syntax 
 
 </ul>
 
index fb225222e134b076e706eae3a6b72ec1a1fd3151..f8bc251b416bfdf9e36029fa17ad469bb1d00ea3 100644 (file)
@@ -62,7 +62,7 @@ POSTFIX(1)                                                          POSTFIX(1)
               <b>postfix-files</b> file.
 
               Specify <i>name</i>=<i>value</i> to override and update  specific
-              main.cf  configuration  parameters.  Use  this, for
+              <a href="postconf.5.html">main.cf</a>  configuration  parameters.  Use  this, for
               example, to change the <b><a href="postconf.5.html#mail_owner">mail_owner</a></b>  or  <b><a href="postconf.5.html#setgid_group">setgid_group</a></b>
               setting for an already installed Postfix system.
 
@@ -71,13 +71,13 @@ POSTFIX(1)                                                          POSTFIX(1)
               <b>fix/post-install set-permissions</b>".
 
        <b>upgrade-configuration [</b><i>name</i>=<i>value ...</i><b>]</b>
-              Update  the <b>main.cf</b> and <b>master.cf</b> files with infor-
+              Update  the <a href="postconf.5.html"><b>main.cf</b></a> and <a href="master.5.html"><b>master.cf</b></a> files with infor-
               mation that Postfix needs in order to run:  add  or
               update  services,  and  add or update configuration
               parameter settings.
 
               Specify <i>name</i>=<i>value</i> to override and update  specific
-              main.cf configuration parameters.
+              <a href="postconf.5.html">main.cf</a> configuration parameters.
 
               This feature is available in Postfix 2.1 and later.
               With  Postfix  2.0  and  earlier,  use  "<b>/etc/post-</b>
@@ -86,7 +86,7 @@ POSTFIX(1)                                                          POSTFIX(1)
        The following options are implemented:
 
        <b>-c</b> <i>config</i><b>_</b><i>dir</i>
-              Read  the <b>main.cf</b> and <b>master.cf</b> configuration files
+              Read  the <a href="postconf.5.html"><b>main.cf</b></a> and <a href="master.5.html"><b>master.cf</b></a> configuration files
               in the named directory instead of the default  con-
               figuration  directory.   Use  this  to  distinguish
               between multiple  Postfix  instances  on  the  same
@@ -118,7 +118,7 @@ POSTFIX(1)                                                          POSTFIX(1)
               present.
 
 <b>CONFIGURATION PARAMETERS</b>
-       The   following   <b>main.cf</b>   configuration  parameters  are
+       The   following   <a href="postconf.5.html"><b>main.cf</b></a>   configuration  parameters  are
        exported as environment variables with the same names:
 
        <b><a href="postconf.5.html#command_directory">command_directory</a> (see 'postconf -d' output)</b>
@@ -130,8 +130,8 @@ POSTFIX(1)                                                          POSTFIX(1)
               daemon programs.
 
        <b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b>
-              The default location of  the  Postfix  main.cf  and
-              master.cf configuration files.
+              The default location of  the  Postfix  <a href="postconf.5.html">main.cf</a>  and
+              <a href="master.5.html">master.cf</a> configuration files.
 
        <b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b>
               The  location of the Postfix top-level queue direc-
@@ -173,8 +173,8 @@ POSTFIX(1)                                                          POSTFIX(1)
        Other configuration parameters:
 
        <b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b>
-              The  default  location  of  the Postfix main.cf and
-              master.cf configuration files.
+              The  default  location  of  the Postfix <a href="postconf.5.html">main.cf</a> and
+              <a href="master.5.html">master.cf</a> configuration files.
 
        <b><a href="postconf.5.html#import_environment">import_environment</a> (see 'postconf -d' output)</b>
               The list of environment parameters that  a  Postfix
@@ -190,8 +190,8 @@ POSTFIX(1)                                                          POSTFIX(1)
               becomes, for example, "postfix/smtpd".
 
 <b>FILES</b>
-       /etc/postfix/main.cf, Postfix configuration parameters
-       /etc/postfix/master.cf, Postfix daemon processes
+       /etc/postfix/<a href="postconf.5.html">main.cf</a>, Postfix configuration parameters
+       /etc/postfix/<a href="master.5.html">master.cf</a>, Postfix daemon processes
        /etc/postfix/postfix-files, file/directory permissions
        /etc/postfix/postfix-script, administrative commands
        /etc/postfix/post-install, post-installation configuration
@@ -214,8 +214,8 @@ POSTFIX(1)                                                          POSTFIX(1)
 
        Postfix configuration:
        <a href="bounce.5.html">bounce(5)</a>, Postfix bounce message templates
-       <a href="master.5.html">master(5)</a>, Postfix master.cf file syntax
-       <a href="postconf.5.html">postconf(5)</a>, Postfix main.cf file syntax
+       <a href="master.5.html">master(5)</a>, Postfix <a href="master.5.html">master.cf</a> file syntax
+       <a href="postconf.5.html">postconf(5)</a>, Postfix <a href="postconf.5.html">main.cf</a> file syntax
 
        Table-driven mechanisms:
        <a href="access.5.html">access(5)</a>, Postfix SMTP access control table
@@ -283,6 +283,14 @@ POSTFIX(1)                                                          POSTFIX(1)
        P.O. Box 704
        Yorktown Heights, NY 10598, USA
 
+       TLS support by:
+       Lutz Jaenicke
+       Brandenburg University of Technology
+       Cottbus, Germany
+
+       Victor Duchovni
+       Morgan Stanley
+
        SASL support originally by:
        Till Franke
        SuSE Rhein/Main AG
index ca2302a55325f12e536618685df47c1ee7dfc820..9ea0a828c1672e4ff0dfbd8aa2728639917e5f19 100644 (file)
@@ -293,13 +293,6 @@ SMTP(8)                                                                SMTP(8)
 
        Available in Postfix version 2.3 and later:
 
-       <b><a href="postconf.5.html#smtp_sasl_auth_enforce">smtp_sasl_auth_enforce</a> (yes)</b>
-              If sender-dependent SASL passwords are turned  off,
-              defer  mail  delivery  when an SMTP server does not
-              support SASL authentication, while  <a href="postconf.5.html#smtp_sasl_password_maps">smtp_sasl_pass</a>-
-              <a href="postconf.5.html#smtp_sasl_password_maps">word_maps</a>  contains SASL login/password information
-              for that server.
-
        <b><a href="postconf.5.html#smtp_sender_dependent_authentication">smtp_sender_dependent_authentication</a> (no)</b>
               Enable sender-dependent authentication in the Post-
               fix  SMTP  client; this is available only with SASL
@@ -387,6 +380,16 @@ SMTP(8)                                                                SMTP(8)
               offers  STARTTLS,  when  TLS is not already enabled
               for that server.
 
+       <b><a href="postconf.5.html#smtp_tls_policy_maps">smtp_tls_policy_maps</a> (empty)</b>
+              Optional lookup tables with the Postfix SMTP client
+              TLS security policy by next-hop destination; when a
+              non-empty value is specified,  this  overrides  the
+              obsolete <a href="postconf.5.html#smtp_tls_per_site">smtp_tls_per_site</a> parameter.
+
+       <b><a href="postconf.5.html#smtp_tls_mandatory_protocols">smtp_tls_mandatory_protocols</a> (SSLv3, TLSv1)</b>
+              List  of TLS protocols that the Postfix SMTP client
+              will use with mandatory TLS encryption.
+
        <b><a href="postconf.5.html#smtp_tls_scert_verifydepth">smtp_tls_scert_verifydepth</a> (5)</b>
               The verification depth for remote SMTP server  cer-
               tificates.
index 0a55a893ba1f58773ef73d3631dc5af481b82543..7092c7ba16153dfd97cfe3c48190d7f5108b1bf5 100644 (file)
@@ -130,6 +130,13 @@ SMTPD(8)                                                              SMTPD(8)
               Postpone the start  of  an  SMTP  mail  transaction
               until a valid RCPT TO command is received.
 
+       Available in Postfix version 2.3 and later:
+
+       <b><a href="postconf.5.html#smtpd_tls_always_issue_session_ids">smtpd_tls_always_issue_session_ids</a> (yes)</b>
+              Force  the  Postfix SMTP server to issue a TLS ses-
+              sion id, even when TLS session  caching  is  turned
+              off (<a href="postconf.5.html#smtpd_tls_session_cache_database">smtpd_tls_session_cache_database</a> is empty).
+
 <b>ADDRESS REWRITING CONTROLS</b>
        See  the  <a href="ADDRESS_REWRITING_README.html">ADDRESS_REWRITING_README</a> document for a detailed
        discussion of Postfix address rewriting.
@@ -355,6 +362,11 @@ SMTPD(8)                                                              SMTPD(8)
               authority (CA) that issued the Postfix SMTP  server
               certificate.
 
+       <b><a href="postconf.5.html#smtpd_tls_always_issue_session_ids">smtpd_tls_always_issue_session_ids</a> (yes)</b>
+              Force  the  Postfix SMTP server to issue a TLS ses-
+              sion id, even when TLS session  caching  is  turned
+              off (<a href="postconf.5.html#smtpd_tls_session_cache_database">smtpd_tls_session_cache_database</a> is empty).
+
        <b><a href="postconf.5.html#smtpd_tls_ask_ccert">smtpd_tls_ask_ccert</a> (no)</b>
               Ask  a remote SMTP client for a client certificate.
 
@@ -694,9 +706,9 @@ SMTPD(8)                                                              SMTPD(8)
        Available in Postfix version 2.3 and later:
 
        <b><a href="postconf.5.html#smtpd_peername_lookup">smtpd_peername_lookup</a> (yes)</b>
-              Attempt to look up the Postfix  SMTP  client  host-
-              name,  and  verify that the name matches the client
-              IP address.
+              Attempt to look up the remote SMTP client hostname,
+              and  verify  that  the  name  matches the client IP
+              address.
 
        The per SMTP client connection count and request rate lim-
        its are implemented in co-operation with the <a href="anvil.8.html"><b>anvil</b>(8)</a> ser-
index e19443ea14732bb8d9e5ca8b737dceab35fcc272..75948b33703e10518b46dde7c965aaba4a5ce115 100644 (file)
@@ -259,6 +259,14 @@ IBM T.J. Watson Research
 P.O. Box 704
 Yorktown Heights, NY 10598, USA
 
+TLS support by:
+Lutz Jaenicke
+Brandenburg University of Technology
+Cottbus, Germany
+
+Victor Duchovni
+Morgan Stanley
+
 SASL support originally by:
 Till Franke
 SuSE Rhein/Main AG
index 69f3c18245775a46db73494187493913ae72b66d..8484d021615c0985f29c2c0d93f6024ffc676085 100644 (file)
@@ -1901,11 +1901,6 @@ Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
 The default time unit is s (seconds).
 .SH lmtp_sasl_auth_enable (default: no)
 Enable SASL authentication in the Postfix LMTP client.
-.SH lmtp_sasl_auth_enforce (default: yes)
-The LMTP-specific version of the smtp_sasl_auth_enforce
-configuration parameter.  See there for details.
-.PP
-This feature is available in Postfix 2.3 and later.
 .SH lmtp_sasl_mechanism_filter (default: empty)
 The LMTP-specific version of the smtp_sasl_mechanism_filter
 configuration parameter.  See there for details.
@@ -4218,13 +4213,6 @@ smtp_sasl_auth_enable = yes
 .fi
 .ad
 .ft R
-.SH smtp_sasl_auth_enforce (default: yes)
-If sender-dependent SASL passwords are turned off, defer mail
-delivery when an SMTP server does not support SASL authentication,
-while smtp_sasl_password_maps contains SASL login/password information
-for that server.
-.PP
-This feature is available in Postfix 2.3 and later.
 .SH smtp_sasl_mechanism_filter (default: empty)
 If non-empty, a Postfix SMTP client filter for the remote SMTP
 server's list of offered SASL mechanisms.  Different client and
@@ -5831,7 +5819,7 @@ This list overrides any commands built into the Postfix SMTP server.
 The lookup key to be used in SMTP \fBaccess\fR(5) tables instead of the
 null sender address.
 .SH smtpd_peername_lookup (default: yes)
-Attempt to look up the Postfix SMTP client hostname, and verify that
+Attempt to look up the remote SMTP client hostname, and verify that
 the name matches the client IP address. A client name is set to
 "unknown" when it cannot be looked up or verified, or when name
 lookup is disabled.  Turning off name lookup reduces delays due to
@@ -6457,6 +6445,37 @@ smtpd_tls_CApath = /etc/postfix/certs
 .ft R
 .PP
 This feature is available in Postfix 2.2 and later.
+.SH smtpd_tls_always_issue_session_ids (default: yes)
+Force the Postfix SMTP server to issue a TLS session id, even
+when TLS session caching is turned off (smtpd_tls_session_cache_database
+is empty). This behavior is compatible with Postfix < 2.3.
+.PP
+With Postfix 2.3 and later the Postfix SMTP server can disable
+session id generation when TLS session caching is turned off. This
+keeps clients from caching sessions that almost certainly cannot
+be re-used.
+.PP
+By default, the Postfix SMTP server always generates TLS session
+ids. This works around a known defect in mail client applications
+such as MS Outlook, and may also prevent interoperability issues
+with other MTAs.
+.PP
+Example:
+.na
+.nf
+.in +4
+.nf
+.na
+.ft C
+    smtpd_tls_always_issue_session_ids = no
+.fi
+.ad
+.ft R
+.in -4
+.fi
+.ad
+.PP
+This feature is available in Postfix 2.3 and later.
 .SH smtpd_tls_ask_ccert (default: no)
 Ask a remote SMTP client for a client certificate. This
 information is needed for certificate based mail relaying with,
index 942f20c76cc3981f15cbb591952c4fa2359fd787..40d18484b1aeb8acccf1504368e304e53430d881 100644 (file)
@@ -262,11 +262,6 @@ If non-empty, a Postfix SMTP client filter for the remote SMTP
 server's list of offered SASL mechanisms.
 .PP
 Available in Postfix version 2.3 and later:
-.IP "\fBsmtp_sasl_auth_enforce (yes)\fR"
-If sender-dependent SASL passwords are turned off, defer mail
-delivery when an SMTP server does not support SASL authentication,
-while smtp_sasl_password_maps contains SASL login/password information
-for that server.
 .IP "\fBsmtp_sender_dependent_authentication (no)\fR"
 Enable sender-dependent authentication in the Postfix SMTP client; this is
 available only with SASL authentication, and disables SMTP connection
@@ -327,6 +322,13 @@ Enable additional Postfix SMTP client logging of TLS activity.
 .IP "\fBsmtp_tls_note_starttls_offer (no)\fR"
 Log the hostname of a remote SMTP server that offers STARTTLS,
 when TLS is not already enabled for that server.
+.IP "\fBsmtp_tls_policy_maps (empty)\fR"
+Optional lookup tables with the Postfix SMTP client TLS security
+policy by next-hop destination; when a non-empty value is specified,
+this overrides the obsolete smtp_tls_per_site parameter.
+.IP "\fBsmtp_tls_mandatory_protocols (SSLv3, TLSv1)\fR"
+List of TLS protocols that the Postfix SMTP client will use
+with mandatory TLS encryption.
 .IP "\fBsmtp_tls_scert_verifydepth (5)\fR"
 The verification depth for remote SMTP server certificates.
 .IP "\fBsmtp_tls_secure_cert_match (nexthop, dot-nexthop)\fR"
index 53ea252054fbfafa2ba3a682840f423b44f0ee04..b0865010bbbee6ec36c79f827a4695fab6d309f3 100644 (file)
@@ -124,6 +124,12 @@ to a remote SMTP client.
 .IP "\fBsmtpd_delay_open_until_valid_rcpt (yes)\fR"
 Postpone the start of an SMTP mail transaction until a valid
 RCPT TO command is received.
+.PP
+Available in Postfix version 2.3 and later:
+.IP "\fBsmtpd_tls_always_issue_session_ids (yes)\fR"
+Force the Postfix SMTP server to issue a TLS session id, even
+when TLS session caching is turned off (smtpd_tls_session_cache_database
+is empty).
 .SH "ADDRESS REWRITING CONTROLS"
 .na
 .nf
@@ -310,6 +316,10 @@ The file with the certificate of the certification authority
 .IP "\fBsmtpd_tls_CAfile (empty)\fR"
 The file with the certificate of the certification authority
 (CA) that issued the Postfix SMTP server certificate.
+.IP "\fBsmtpd_tls_always_issue_session_ids (yes)\fR"
+Force the Postfix SMTP server to issue a TLS session id, even
+when TLS session caching is turned off (smtpd_tls_session_cache_database
+is empty).
 .IP "\fBsmtpd_tls_ask_ccert (no)\fR"
 Ask a remote SMTP client for a client certificate.
 .IP "\fBsmtpd_tls_auth_only (no)\fR"
@@ -562,7 +572,7 @@ before it is flushed upon receipt of EHLO, RSET, or end of DATA.
 .PP
 Available in Postfix version 2.3 and later:
 .IP "\fBsmtpd_peername_lookup (yes)\fR"
-Attempt to look up the Postfix SMTP client hostname, and verify that
+Attempt to look up the remote SMTP client hostname, and verify that
 the name matches the client IP address.
 .PP
 The per SMTP client connection count and request rate limits are
index 57e3c8a433b0d3083b7b8936352a0fab253f4782..babcb2f1dc276c2387b21554eb10f60369d63934 100755 (executable)
@@ -253,7 +253,6 @@ while (<>) {
     s;\blmtp_rcpt_timeout\b;<a href="postconf.5.html#lmtp_rcpt_timeout">$&</a>;g;
     s;\blmtp_rset_timeout\b;<a href="postconf.5.html#lmtp_rset_timeout">$&</a>;g;
     s;\blmtp_sasl_auth_enable\b;<a href="postconf.5.html#lmtp_sasl_auth_enable">$&</a>;g;
-    s;\blmtp_sasl_auth_enforce\b;<a href="postconf.5.html#lmtp_sasl_auth_enforce">$&</a>;g;
     s;\blmtp_sasl_password_maps\b;<a href="postconf.5.html#lmtp_sasl_password_maps">$&</a>;g;
     s;\blmtp_sasl_security_options\b;<a href="postconf.5.html#lmtp_sasl_security_options">$&</a>;g;
     s;\blmtp_sasl_type\b;<a href="postconf.5.html#lmtp_sasl_type">$&</a>;g;
@@ -526,7 +525,6 @@ while (<>) {
     s;\bsmtp_[-</Bb>]*\n* *[<Bb>]*sasl_[-</Bb>]*\n* *[<Bb>]*tls_[-</Bb>]*\n* *[<Bb>]*secu[-</Bb>]*\n* *[<Bb>]*rity_options\b;<a href="postconf.5.html#smtp_sasl_tls_security_options">$&</a>;g;
     s;\bsmtp_sasl_tls_verified_secu[-</Bb>]*\n* *[<Bb>]*rity_options\b;<a href="postconf.5.html#smtp_sasl_tls_verified_security_options">$&</a>;g;
     s;\bsmtp_sasl_type\b;<a href="postconf.5.html#smtp_sasl_type">$&</a>;g;
-    s;\bsmtp_sasl_auth_enforce\b;<a href="postconf.5.html#smtp_sasl_auth_enforce">$&</a>;g;
     s;\bsmtp_starttls_timeout\b;<a href="postconf.5.html#smtp_starttls_timeout">$&</a>;g;
     s;\bsmtp_tls_CAfile\b;<a href="postconf.5.html#smtp_tls_CAfile">$&</a>;g;
     s;\bsmtp_tls_CApath\b;<a href="postconf.5.html#smtp_tls_CApath">$&</a>;g;
@@ -577,6 +575,7 @@ while (<>) {
     s;\bsmtpd_tls_req_ccert\b;<a href="postconf.5.html#smtpd_tls_req_ccert">$&</a>;g;
     s;\bsmtpd_tls_session_cache_database\b;<a href="postconf.5.html#smtpd_tls_session_cache_database">$&</a>;g;
     s;\bsmtpd_tls_session_cache_timeout\b;<a href="postconf.5.html#smtpd_tls_session_cache_timeout">$&</a>;g;
+    s;\bsmtpd_tls_always_issue_session_ids\b;<a href="postconf.5.html#smtpd_tls_always_issue_session_ids">$&</a>;g;
     s;\bsmtpd_tls_wrappermode\b;<a href="postconf.5.html#smtpd_tls_wrappermode">$&</a>;g;
     s;\bsmtpd_use_tls\b;<a href="postconf.5.html#smtpd_use_tls">$&</a>;g;
     s;\btls_daemon_random_bytes\b;<a href="postconf.5.html#tls_daemon_random_bytes">$&</a>;g;
index fb7679144bbf65005f3126a1a633bcded938b25f..7e586878dc4e3387af4aa21bf5dfdea776c8b8ba 100644 (file)
@@ -634,12 +634,10 @@ after-filter smtpd process, so that filtered mail is logged with
 the real client name IP address. See smtp(8) and XFORWARD_README
 for more information. </p>
 
-<li> <p> With "-o disable_mime_output_conversion=yes", the scan
-delivery agent will not convert 8BITMIME mail to quoted-printable
-form while delivering to the content filter, as that would invalidate
-domainkeys and other digital signatures.  This workaround is needed
-because some SMTP-based content filters don't announce 8BITMIME
-support, even though they can handle it just fine.  </p>
+<li> <p> The "-o disable_mime_output_conversion=yes" is a workaround
+that prevents the breaking of domainkeys and other digital signatures.
+This is needed because some SMTP-based content filters don't announce
+8BITMIME support, even though they can handle it just fine.  </p>
 
 </ul>
 
index 8e56061f2d5d207f1b5f5d0178e750f007d653b5..7005e09863ecae6291d5a91500ae7b4a504a3946 100644 (file)
@@ -613,9 +613,9 @@ TO </td> </tr>
 <h2><a name="workarounds">Workarounds</a></h2>
 
 <p> Content filters may break domain key etc. signatures. If you
-use an SMTP-based filter as described in FILTER_README, then you
-should add a line to master.cf with "disable_mime_output_conversion
-= yes", as described in the <a
+use an SMTP-based content filter, then you should add a line to
+master.cf with "-o disable_mime_output_conversion=yes" (note: no
+spaces around the "="), as described in the <a
 href="FILTER_README.html#advanced_filter">advanced content filter</a>
 example. </p>
 
index 2c0ac06c12e8258db9d5b71bd5453650bcf4f731..cd6d23ab1455964909f74c883258c39ad2570da3 100644 (file)
@@ -127,7 +127,7 @@ in the Postfix top-level directory: </p>
 
 <blockquote>
 <pre>
-% make makefiles CCARGS='-DUSE_SASL_AUTH -DDEF_SASL_SERVER=\"dovecot\"'
+% make makefiles CCARGS='-DUSE_SASL_AUTH -DDEF_SASL_SERVER_TYPE=\"dovecot\"'
 </pre>
 </blockquote>
 
@@ -138,7 +138,7 @@ INSTALL document. </p>
 
 <ul>
 
-<li> <p> The "-DDEF_SASL_SERVER" stuff is not necessary; it just
+<li> <p> The "-DDEF_SASL_SERVER_TYPE" stuff is not necessary; it just
 makes Postfix configuration a little more convenient because you
 don't have to specify the SASL plug-in type in the Postfix main.cf
 file.  </p>
index 249e3b22c428373bffcb43a8fb77e0fe700e4c61..7247efedcb1383aab260752b1c47febfe59098b4 100644 (file)
@@ -490,8 +490,9 @@ and OE (5.01 Mac on all ports). </p>
 
 <p> It is strictly discouraged to use this mode from main.cf. If
 you want to support this service, enable a special port in master.cf
-and specify "-o smtpd_tls_wrappermode = yes" as an smtpd(8) command
-line option.  Port 465 (smtps) was once chosen for this feature.
+and specify "-o smtpd_tls_wrappermode=yes" (note: no space around
+the "=") as an smtpd(8) command line option.  Port 465 (smtps) was
+once chosen for this feature.
 </p>
 
 <p> Example: </p>
@@ -631,6 +632,22 @@ recommends a maximum of 24 hours.  </p>
 </pre>
 </blockquote>
 
+<p> When the Postfix SMTP server does not save TLS sessions to an
+external cache database, client-side session caching is unlikely
+to be useful.  To prevent such wastage, the Postfix SMTP server can
+be configured to not issue TLS session ids. By default the Postfix
+SMTP server always issues TLS session ids. This works around known
+interoperability issues with some MUAs, and prevents possible
+interoperability issues with other MTAs. </p>
+
+<p> Example: </p>
+
+<blockquote>
+<pre>
+    smtpd_tls_always_issue_session_ids = no
+</pre>
+</blockquote>
+
 <h3><a name="server_access">Server access control</a> </h3>
 
 <p> Postfix TLS support introduces three additional features for
index f233c4662a4cd902a46c895ee263130ad34b4aab..0918f8db92191d4c0b514c12dae9ed05aa28c07c 100644 (file)
@@ -8941,7 +8941,7 @@ process instance while mail is being forwarded.  </p>
 
 %PARAM smtpd_peername_lookup yes
 
-<p> Attempt to look up the Postfix SMTP client hostname, and verify that
+<p> Attempt to look up the remote SMTP client hostname, and verify that
 the name matches the client IP address. A client name is set to
 "unknown" when it cannot be looked up or verified, or when name
 lookup is disabled.  Turning off name lookup reduces delays due to
@@ -10367,22 +10367,6 @@ configuration parameter.  See there for details. </p>
 
 <p> This feature is available in Postfix 2.3 and later. </p>
 
-%PARAM smtp_sasl_auth_enforce   yes
-
-<p> If sender-dependent SASL passwords are turned off, defer mail
-delivery when an SMTP server does not support SASL authentication,
-while smtp_sasl_password_maps contains SASL login/password information
-for that server.  </p>
-
-<p> This feature is available in Postfix 2.3 and later. </p>
-
-%PARAM lmtp_sasl_auth_enforce   yes
-
-<p> The LMTP-specific version of the smtp_sasl_auth_enforce
-configuration parameter.  See there for details. </p>
-
-<p> This feature is available in Postfix 2.3 and later. </p>
-
 %PARAM smtpd_tls_security_level
 
 <p> The SMTP TLS security level for the Postfix SMTP server; when
@@ -10444,3 +10428,29 @@ notifications by the smtp(8) and smtpd(8) processes. </dd>
 Postfix-generated email messages. The user is warned. </p>
 
 <p> This feature is available in Postfix 2.3 and later. </p>
+
+%PARAM smtpd_tls_always_issue_session_ids yes
+
+<p> Force the Postfix SMTP server to issue a TLS session id, even
+when TLS session caching is turned off (smtpd_tls_session_cache_database
+is empty). This behavior is compatible with Postfix &lt; 2.3. </p>
+
+<p> With Postfix 2.3 and later the Postfix SMTP server can disable
+session id generation when TLS session caching is turned off. This
+keeps clients from caching sessions that almost certainly cannot
+be re-used.  </p>
+
+<p> By default, the Postfix SMTP server always generates TLS session
+ids. This works around a known defect in mail client applications
+such as MS Outlook, and may also prevent interoperability issues
+with other MTAs. </p>
+
+<p> Example: </p>
+
+<blockquote>
+<pre>
+    smtpd_tls_always_issue_session_ids = no
+</pre>
+</blockquote>
+
+<p> This feature is available in Postfix 2.3 and later. </p>
index cc0a9bd51564cc7d818638b1774738c2bd2c665a..c3b5dd612a21196195f0d952d6204c68bd531f42 100644 (file)
@@ -92,6 +92,8 @@ typedef struct CLEANUP_STATE {
     MILTERS *milters;                  /* mail filters */
     const char *client_name;           /* real or ersatz client */
     const char *client_addr;           /* real or ersatz client */
+    int     client_af;                 /* real or ersatz client */
+    const char *client_port;           /* real or ersatz client */
 } CLEANUP_STATE;
 
  /*
index ebd1f5ce70f2aef77427201b30bdab963bc904fb..beacd8249fac2ea299a48245ea2872fbd25e4a80 100644 (file)
@@ -1277,6 +1277,12 @@ static const char *cleanup_milter_apply(CLEANUP_STATE *state, const char *event,
     if (msg_verbose)
        msg_info("%s: %s", myname, resp);
 
+    /*
+     * Sanity check.
+     */
+    if (state->client_name == 0)
+       msg_panic("%s: missing client info initialization", myname);
+
     /*
      * We don't report errors that were already reported by the content
      * editing call-back routines. See cleanup_milter_error() above.
@@ -1354,6 +1360,34 @@ static const char *cleanup_milter_apply(CLEANUP_STATE *state, const char *event,
     return (ret);
 }
 
+/* cleanup_milter_client_init - initialize real or ersatz client info */
+
+static void cleanup_milter_client_init(CLEANUP_STATE *state)
+{
+    const char *proto_attr;
+
+    /*
+     * Either the cleanup client specifies a name, address and protocol, or
+     * we have a local submission and pretend localhost/127.0.0.1/AF_INET.
+     */
+#define NO_CLIENT_PORT "0"
+
+    state->client_name = nvtable_find(state->attr, MAIL_ATTR_ACT_CLIENT_NAME);
+    state->client_addr = nvtable_find(state->attr, MAIL_ATTR_ACT_CLIENT_ADDR);
+    state->client_port = nvtable_find(state->attr, MAIL_ATTR_ACT_CLIENT_PORT);
+    proto_attr = nvtable_find(state->attr, MAIL_ATTR_ACT_CLIENT_AF);
+
+    if (state->client_name == 0 || state->client_addr == 0 || proto_attr == 0
+       || !alldig(proto_attr)) {
+       state->client_name = "localhost";
+       state->client_addr = "127.0.0.1";
+       state->client_af = AF_INET;
+    } else
+       state->client_af = atoi(proto_attr);
+    if (state->client_port == 0)
+       state->client_port = NO_CLIENT_PORT;
+}
+
 /* cleanup_milter_inspect - run message through mail filter */
 
 void    cleanup_milter_inspect(CLEANUP_STATE *state, MILTERS *milters)
@@ -1364,6 +1398,12 @@ void    cleanup_milter_inspect(CLEANUP_STATE *state, MILTERS *milters)
     if (msg_verbose)
        msg_info("enter %s", myname);
 
+    /*
+     * Initialize, in case we're called via smtpd(8).
+     */
+    if (state->client_name == 0)
+       cleanup_milter_client_init(state);
+
     /*
      * Process mail filter replies. The reply format is verified by the mail
      * filter library.
@@ -1382,9 +1422,6 @@ void    cleanup_milter_emul_mail(CLEANUP_STATE *state,
                                         const char *addr)
 {
     const char *resp;
-    const char *proto_attr;
-    const char *client_port;
-    int     client_af;
     const char *helo;
     const char *argv[2];
 
@@ -1397,33 +1434,14 @@ void    cleanup_milter_emul_mail(CLEANUP_STATE *state,
                         cleanup_ins_header, cleanup_del_header,
                         cleanup_add_rcpt, cleanup_del_rcpt,
                         cleanup_repl_body, (void *) state);
-
-    /*
-     * Either the cleanup client specifies a name, address and protocol, or
-     * we have a local submission and pretend localhost/127.0.0.1/AF_INET.
-     */
-#define NO_CLIENT_PORT "0"
-
-    state->client_name = nvtable_find(state->attr, MAIL_ATTR_ACT_CLIENT_NAME);
-    state->client_addr = nvtable_find(state->attr, MAIL_ATTR_ACT_CLIENT_ADDR);
-
-    client_port = nvtable_find(state->attr, MAIL_ATTR_ACT_CLIENT_PORT);
-    proto_attr = nvtable_find(state->attr, MAIL_ATTR_ACT_CLIENT_AF);
-    if (state->client_name == 0 || state->client_addr == 0 || proto_attr == 0
-       || !alldig(proto_attr)) {
-       state->client_name = "localhost";
-       state->client_addr = "127.0.0.1";
-       client_af = AF_INET;
-    } else
-       client_af = atoi(proto_attr);
-    if (client_port == 0)
-       client_port = NO_CLIENT_PORT;
+    if (state->client_name == 0)
+       cleanup_milter_client_init(state);
 
     /*
      * Emulate SMTP events.
      */
     if ((resp = milter_conn_event(milters, state->client_name, state->client_addr,
-                                 client_port, client_af)) != 0) {
+                             state->client_port, state->client_af)) != 0) {
        cleanup_milter_apply(state, "CONNECT", resp);
        return;
     }
@@ -1453,9 +1471,16 @@ void    cleanup_milter_emul_rcpt(CLEANUP_STATE *state,
                                         MILTERS *milters,
                                         const char *addr)
 {
+    const char *myname = "cleanup_milter_emul_rcpt";
     const char *resp;
     const char *argv[2];
 
+    /*
+     * Sanity check.
+     */
+    if (state->client_name == 0)
+       msg_panic("%s: missing client info initialization", myname);
+
     /*
      * CLEANUP_STAT_CONT and CLEANUP_STAT_DEFER both update the reason
      * attribute, but CLEANUP_STAT_DEFER takes precedence. It terminates
@@ -1479,8 +1504,15 @@ void    cleanup_milter_emul_rcpt(CLEANUP_STATE *state,
 
 void    cleanup_milter_emul_data(CLEANUP_STATE *state, MILTERS *milters)
 {
+    const char *myname = "cleanup_milter_emul_data";
     const char *resp;
 
+    /*
+     * Sanity check.
+     */
+    if (state->client_name == 0)
+       msg_panic("%s: missing client info initialization", myname);
+
     if ((resp = milter_data_event(milters)) != 0)
        cleanup_milter_apply(state, "DATA", resp);
 }
index fae7fdd5800d2e520f5462b17c6c863c7e6b80b7..d1fc37203f6c64bda88b3d85a454f87b6372b92d 100644 (file)
@@ -110,6 +110,8 @@ CLEANUP_STATE *cleanup_state_alloc(VSTREAM *src)
     state->milters = 0;
     state->client_name = 0;
     state->client_addr = 0;
+    state->client_af = 0;
+    state->client_port = 0;
     return (state);
 }
 
index 5ab4dbf559b8c37fa8bf5d9320cbdb1c33f76924..082a4a1267f1aebcc1ec9b87489afe2ce2304750 100644 (file)
@@ -1183,6 +1183,10 @@ extern char *var_smtpd_tls_scache_db;
 #define DEF_SMTPD_TLS_SCACHTIME        "3600s"
 extern int var_smtpd_tls_scache_timeout;
 
+#define VAR_SMTPD_TLS_SET_SESSID       "smtpd_tls_always_issue_session_ids"
+#define DEF_SMTPD_TLS_SET_SESSID       1
+extern bool var_smtpd_tls_set_sessid;
+
 #define VAR_SMTPD_DELAY_OPEN   "smtpd_delay_open_until_valid_rcpt"
 #define DEF_SMTPD_DELAY_OPEN   1
 extern bool var_smtpd_delay_open;
index 99c4bfc5a90681e0c4bde73ac6d52f2041f79aea..edd0ad6508cfb4aeb8a9c70f8b0661aac4916ade 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      "20060711"
+#define MAIL_RELEASE_DATE      "20060719"
 #define MAIL_VERSION_NUMBER    "2.4"
 
 #ifdef SNAPSHOT
index f66a0ac3957895a747560eb880cec9a2991d2f84..70ea9a4c566df884fbf5d1cd7dff20fab545bc71 100644 (file)
@@ -1,3 +1,13 @@
+# Reject with text 
+./test-milter -C 1 -a "554 5.7.1 Rejected" -c connect -p inet:9999@127.0.0.1
+./test-milter -C 1 -a "554 5.7.1 Rejected" -c helo -p inet:9999@127.0.0.1
+./test-milter -C 1 -a "554 5.7.1 Rejected" -c mail -p inet:9999@127.0.0.1
+./test-milter -C 1 -a "554 5.7.1 Rejected" -c rcpt -p inet:9999@127.0.0.1
+./test-milter -C 1 -a "554 5.7.1 Rejected" -c header -p inet:9999@127.0.0.1
+./test-milter -C 1 -a "554 5.7.1 Rejected" -c eoh -p inet:9999@127.0.0.1
+./test-milter -C 1 -a "554 5.7.1 Rejected" -c body -p inet:9999@127.0.0.1
+./test-milter -C 1 -a "554 5.7.1 Rejected" -c eom -p inet:9999@127.0.0.1
+
 # Tempfail tests
 ./test-milter -C 1 -a tempfail -c connect -p inet:9999@127.0.0.1
 ./test-milter -C 1 -a tempfail -c helo -p inet:9999@127.0.0.1
index f11962a44e1175b323d8f128e7e2cfbd3022ea8f..d617499d3a8ee753fb37da678a9d3ce64599ab13 100644 (file)
@@ -96,17 +96,23 @@ static char *reply_code;
 static char *reply_dsn;
 static char *reply_message;
 
+#ifdef SMFIR_INSHEADER
 static char *ins_hdr;
 static int ins_idx;
 static char *ins_val;
 
+#endif
+
+#ifdef SMFIR_CHGHEADER
 static char *chg_hdr;
 static int chg_idx;
 static char *chg_val;
 
+#endif
+
 static int test_reply(SMFICTX *ctx, int code)
 {
-    (void) fflush(stdout);                     /* In case output redirected. */
+    (void) fflush(stdout);             /* In case output redirected. */
 
     if (code == SMFIR_REPLYCODE) {
        if (smfi_setreply(ctx, reply_code, reply_dsn, reply_message) != MI_SUCCESS)
@@ -214,10 +220,14 @@ static sfsistat test_body(SMFICTX *ctx, unsigned char *data, size_t data_len)
 static sfsistat test_eom(SMFICTX *ctx)
 {
     printf("test_eom\n");
+#ifdef SMFIR_INSHEADER
     if (ins_hdr && smfi_insheader(ctx, ins_idx, ins_hdr, ins_val) == MI_FAILURE)
        fprintf(stderr, "smfi_insheader failed");
+#endif
+#ifdef SMFIR_CHGHEADER
     if (chg_hdr && smfi_chgheader(ctx, chg_hdr, chg_idx, chg_val) == MI_FAILURE)
        fprintf(stderr, "smfi_chgheader failed");
+#endif
     return (test_reply(ctx, test_eom_reply));
 }
 
@@ -318,6 +328,7 @@ int     main(int argc, char **argv)
                exit(1);
            }
            break;
+#ifdef SMFIR_INSHEADER
        case 'i':
            if (ins_hdr) {
                fprintf(stderr, "too many -i options\n");
@@ -325,12 +336,14 @@ int     main(int argc, char **argv)
            }
            parse_hdr_info(optarg, &ins_idx, &ins_hdr, &ins_val);
            break;
+#endif
        case 'p':
            if (smfi_setconn(optarg) == MI_FAILURE) {
                fprintf(stderr, "smfi_setconn failed\n");
                exit(1);
            }
            break;
+#ifdef SMFIR_CHGHEADER
        case 'r':
            if (chg_hdr) {
                fprintf(stderr, "too many -r options\n");
@@ -338,6 +351,7 @@ int     main(int argc, char **argv)
            }
            parse_hdr_info(optarg, &chg_idx, &chg_hdr, &chg_val);
            break;
+#endif
        case 'v':
            verbose++;
            break;
index bad094a78d062fe4c9a9fcb148e77f805414ac39..784526c47173290a1f47b4fe46fc1c4ba5df6831 100644 (file)
 /*     P.O. Box 704
 /*     Yorktown Heights, NY 10598, USA
 /*
+/*     TLS support by:
+/*     Lutz Jaenicke
+/*     Brandenburg University of Technology
+/*     Cottbus, Germany
+/*
+/*     Victor Duchovni
+/*     Morgan Stanley
+/*
 /*     SASL support originally by:
 /*     Till Franke
 /*     SuSE Rhein/Main AG
index fa488781e9661058071f3b62c6de10321c211121..e5f0c119cfbcf81a847bf5fbc4240409740cb834 100644 (file)
@@ -95,6 +95,5 @@
 #endif
        VAR_LMTP_SENDER_AUTH, DEF_LMTP_SENDER_AUTH, &var_smtp_sender_auth,
        VAR_LMTP_CNAME_OVERR, DEF_LMTP_CNAME_OVERR, &var_smtp_cname_overr,
-       VAR_LMTP_SASL_ENFORCE, DEF_LMTP_SASL_ENFORCE, &var_smtp_sasl_enforce,
        0,
     };
index 7fdbf780d05b6d97446bafbfabfa2b8a8ad2034b..b6fdad8b04a3e405d5e4d3c75ee4249d775e56dc 100644 (file)
 /*     server's list of offered SASL mechanisms.
 /* .PP
 /*     Available in Postfix version 2.3 and later:
-/* .IP "\fBsmtp_sasl_auth_enforce (yes)\fR"
-/*     If sender-dependent SASL passwords are turned off, defer mail
-/*     delivery when an SMTP server does not support SASL authentication,
-/*     while smtp_sasl_password_maps contains SASL login/password information
-/*     for that server.
 /* .IP "\fBsmtp_sender_dependent_authentication (no)\fR"
 /*     Enable sender-dependent authentication in the Postfix SMTP client; this is
 /*     available only with SASL authentication, and disables SMTP connection
 /* .IP "\fBsmtp_tls_note_starttls_offer (no)\fR"
 /*     Log the hostname of a remote SMTP server that offers STARTTLS,
 /*     when TLS is not already enabled for that server.
+/* .IP "\fBsmtp_tls_policy_maps (empty)\fR"
+/*     Optional lookup tables with the Postfix SMTP client TLS security
+/*     policy by next-hop destination; when a non-empty value is specified,
+/*     this overrides the obsolete smtp_tls_per_site parameter.
+/* .IP "\fBsmtp_tls_mandatory_protocols (SSLv3, TLSv1)\fR"
+/*     List of TLS protocols that the Postfix SMTP client will use
+/*     with mandatory TLS encryption.
 /* .IP "\fBsmtp_tls_scert_verifydepth (5)\fR"
 /*     The verification depth for remote SMTP server certificates.
 /* .IP "\fBsmtp_tls_secure_cert_match (nexthop, dot-nexthop)\fR"
@@ -697,7 +699,6 @@ bool    var_smtp_sender_auth;
 char   *var_lmtp_tcp_port;
 int     var_scache_proto_tmout;
 bool    var_smtp_cname_overr;
-bool    var_smtp_sasl_enforce;
 
  /*
   * Global variables.
index 540da37812f5b36f7df2f0210f367a6cad313c3e..9c73b2d58bdfaf671e749d07b419ac17e4c57f1c 100644 (file)
@@ -99,6 +99,5 @@
 #endif
        VAR_SMTP_SENDER_AUTH, DEF_SMTP_SENDER_AUTH, &var_smtp_sender_auth,
        VAR_SMTP_CNAME_OVERR, DEF_SMTP_CNAME_OVERR, &var_smtp_cname_overr,
-       VAR_SMTP_SASL_ENFORCE, DEF_SMTP_SASL_ENFORCE, &var_smtp_sasl_enforce,
        0,
     };
index b66d91a9fd8eb0122eb4435e78bed4cd27ba3b46..7fb0c262fdb698dda2257918b22cab2fcafd537e 100644 (file)
@@ -359,7 +359,6 @@ int     smtp_helo(SMTP_STATE *state)
                                       "host %s refused to talk to me: %s",
                                       session->namaddr,
                                       translit(resp->str, "\n", " ")));
-           return (0);
        }
     } else {
        where = "performing the LHLO handshake";
@@ -372,93 +371,106 @@ int     smtp_helo(SMTP_STATE *state)
     }
 
     /*
-     * Determine what server EHLO keywords to ignore, typically to avoid
-     * inter-operability problems.
+     * No early returns allowed, to ensure consistent handling of TLS and
+     * SASL policies.
      */
-    if (smtp_ehlo_dis_maps == 0
-       || (ehlo_words = maps_find(smtp_ehlo_dis_maps, state->session->addr, 0)) == 0)
-       ehlo_words = var_smtp_ehlo_dis_words;
-    discard_mask = ehlo_mask(ehlo_words);
-    if (discard_mask && !(discard_mask & EHLO_MASK_SILENT))
-       msg_info("discarding EHLO keywords: %s", str_ehlo_mask(discard_mask));
+    if (session->features & SMTP_FEATURE_ESMTP) {
 
-    /*
-     * Pick up some useful features offered by the SMTP server. XXX Until we
-     * have a portable routine to convert from string to off_t with proper
-     * overflow detection, ignore the message size limit advertised by the
-     * SMTP server. Otherwise, we might do the wrong thing when the server
-     * advertises a really huge message size limit.
-     * 
-     * XXX Allow for "code (SP|-) ehlo-keyword (SP|=) ehlo-param...", because
-     * MicroSoft implemented AUTH based on an old draft.
-     */
-    lines = resp->str;
-    for (n = 0; (words = mystrtok(&lines, "\n")) != 0; /* see below */ ) {
-       if (mystrtok(&words, "- ") && (word = mystrtok(&words, " \t=")) != 0) {
-           if (n == 0) {
-               if (session->helo != 0)
-                   myfree(session->helo);
+       /*
+        * Determine what server EHLO keywords to ignore, typically to avoid
+        * inter-operability problems.
+        */
+       if (smtp_ehlo_dis_maps == 0
+           || (ehlo_words = maps_find(smtp_ehlo_dis_maps,
+                                      state->session->addr, 0)) == 0)
+           ehlo_words = var_smtp_ehlo_dis_words;
+       discard_mask = ehlo_mask(ehlo_words);
+       if (discard_mask && !(discard_mask & EHLO_MASK_SILENT))
+           msg_info("discarding EHLO keywords: %s",
+                    str_ehlo_mask(discard_mask));
 
-               /*
-                * XXX: Keep the original case: we don't expect a single SMTP
-                * server to randomly change the case of its helo response.
-                * If different capitalization is detected, we should assume
-                * disjoint TLS caches.
-                */
-               session->helo = mystrdup(word);
-               if (strcasecmp(word, var_myhostname) == 0
-                && (state->misc_flags & SMTP_MISC_FLAG_LOOP_DETECT) != 0) {
-                   msg_warn("host %s replied to HELO/EHLO with my own hostname %s",
-                            session->namaddrport, var_myhostname);
-                   if (session->features & SMTP_FEATURE_BEST_MX)
-                       return (smtp_site_fail(state, DSN_BY_LOCAL_MTA,
+       /*
+        * Pick up some useful features offered by the SMTP server. XXX Until
+        * we have a portable routine to convert from string to off_t with
+        * proper overflow detection, ignore the message size limit
+        * advertised by the SMTP server. Otherwise, we might do the wrong
+        * thing when the server advertises a really huge message size limit.
+        * 
+        * XXX Allow for "code (SP|-) ehlo-keyword (SP|=) ehlo-param...",
+        * because MicroSoft implemented AUTH based on an old draft.
+        */
+       lines = resp->str;
+       for (n = 0; (words = mystrtok(&lines, "\n")) != 0; /* see below */ ) {
+           if (mystrtok(&words, "- ")
+               && (word = mystrtok(&words, " \t=")) != 0) {
+               if (n == 0) {
+                   if (session->helo != 0)
+                       myfree(session->helo);
+
+                   /*
+                    * XXX: Keep the original case: we don't expect a single
+                    * SMTP server to randomly change the case of its helo
+                    * response. If different capitalization is detected, we
+                    * should assume disjoint TLS caches.
+                    */
+                   session->helo = mystrdup(word);
+                   if (strcasecmp(word, var_myhostname) == 0
+                       && (state->misc_flags & SMTP_MISC_FLAG_LOOP_DETECT) != 0) {
+                       msg_warn("host %s replied to HELO/EHLO"
+                                " with my own hostname %s",
+                                session->namaddrport, var_myhostname);
+                       if (session->features & SMTP_FEATURE_BEST_MX)
+                           return (smtp_site_fail(state, DSN_BY_LOCAL_MTA,
                                             SMTP_RESP_FAKE(&fake, "5.4.6"),
                                         "mail for %s loops back to myself",
-                                              request->nexthop));
-                   else
-                       return (smtp_site_fail(state, DSN_BY_LOCAL_MTA,
+                                                  request->nexthop));
+                       else
+                           return (smtp_site_fail(state, DSN_BY_LOCAL_MTA,
                                             SMTP_RESP_FAKE(&fake, "4.4.6"),
                                         "mail for %s loops back to myself",
-                                              request->nexthop));
-               }
-           } else if (strcasecmp(word, "8BITMIME") == 0) {
-               if ((discard_mask & EHLO_MASK_8BITMIME) == 0)
-                   session->features |= SMTP_FEATURE_8BITMIME;
-           } else if (strcasecmp(word, "PIPELINING") == 0) {
-               if ((discard_mask & EHLO_MASK_PIPELINING) == 0)
-                   session->features |= SMTP_FEATURE_PIPELINING;
-           } else if (strcasecmp(word, "XFORWARD") == 0) {
-               if ((discard_mask & EHLO_MASK_XFORWARD) == 0)
-                   while ((word = mystrtok(&words, " \t")) != 0)
-                       session->features |= name_code(xforward_features,
-                                                NAME_CODE_FLAG_NONE, word);
-           } else if (strcasecmp(word, "SIZE") == 0) {
-               if ((discard_mask & EHLO_MASK_SIZE) == 0) {
-                   session->features |= SMTP_FEATURE_SIZE;
-                   if ((word = mystrtok(&words, " \t")) != 0) {
-                       if (!alldig(word))
-                           msg_warn("bad EHLO SIZE limit \"%s\" from %s",
-                                    word, session->namaddrport);
-                       else
-                           session->size_limit = off_cvt_string(word);
+                                                  request->nexthop));
+                   }
+               } else if (strcasecmp(word, "8BITMIME") == 0) {
+                   if ((discard_mask & EHLO_MASK_8BITMIME) == 0)
+                       session->features |= SMTP_FEATURE_8BITMIME;
+               } else if (strcasecmp(word, "PIPELINING") == 0) {
+                   if ((discard_mask & EHLO_MASK_PIPELINING) == 0)
+                       session->features |= SMTP_FEATURE_PIPELINING;
+               } else if (strcasecmp(word, "XFORWARD") == 0) {
+                   if ((discard_mask & EHLO_MASK_XFORWARD) == 0)
+                       while ((word = mystrtok(&words, " \t")) != 0)
+                           session->features |=
+                               name_code(xforward_features,
+                                         NAME_CODE_FLAG_NONE, word);
+               } else if (strcasecmp(word, "SIZE") == 0) {
+                   if ((discard_mask & EHLO_MASK_SIZE) == 0) {
+                       session->features |= SMTP_FEATURE_SIZE;
+                       if ((word = mystrtok(&words, " \t")) != 0) {
+                           if (!alldig(word))
+                               msg_warn("bad EHLO SIZE limit \"%s\" from %s",
+                                        word, session->namaddrport);
+                           else
+                               session->size_limit = off_cvt_string(word);
+                       }
                    }
-               }
 #ifdef USE_TLS
-           } else if (strcasecmp(word, "STARTTLS") == 0) {
-               /* Ignored later if we already sent STARTTLS. */
-               if ((discard_mask & EHLO_MASK_STARTTLS) == 0)
-                   session->features |= SMTP_FEATURE_STARTTLS;
+               } else if (strcasecmp(word, "STARTTLS") == 0) {
+                   /* Ignored later if we already sent STARTTLS. */
+                   if ((discard_mask & EHLO_MASK_STARTTLS) == 0)
+                       session->features |= SMTP_FEATURE_STARTTLS;
 #endif
 #ifdef USE_SASL_AUTH
-           } else if (var_smtp_sasl_enable && strcasecmp(word, "AUTH") == 0) {
-               if ((discard_mask & EHLO_MASK_AUTH) == 0)
-                   smtp_sasl_helo_auth(session, words);
+               } else if (var_smtp_sasl_enable
+                          && strcasecmp(word, "AUTH") == 0) {
+                   if ((discard_mask & EHLO_MASK_AUTH) == 0)
+                       smtp_sasl_helo_auth(session, words);
 #endif
-           } else if (strcasecmp(word, "DSN") == 0) {
-               if ((discard_mask & EHLO_MASK_DSN) == 0)
-                   session->features |= SMTP_FEATURE_DSN;
+               } else if (strcasecmp(word, "DSN") == 0) {
+                   if ((discard_mask & EHLO_MASK_DSN) == 0)
+                       session->features |= SMTP_FEATURE_DSN;
+               }
+               n++;
            }
-           n++;
        }
     }
     if (msg_verbose)
@@ -600,16 +612,6 @@ int     smtp_helo(SMTP_STATE *state)
 #ifdef USE_SASL_AUTH
     if (var_smtp_sasl_enable && (session->features & SMTP_FEATURE_AUTH))
        return (smtp_sasl_helo_login(state));
-    else if (var_smtp_sasl_enable
-            && *var_smtp_sasl_passwd
-            && !var_smtp_sender_auth
-            && var_smtp_sasl_enforce
-            && smtp_sasl_passwd_lookup(session) != 0)
-       return (smtp_site_fail(state, DSN_BY_LOCAL_MTA,
-                              SMTP_RESP_FAKE(&fake, "4.7.0"),
-                              "SASL login/password exists, but host %s "
-                              "does not announce SASL authentication support",
-                              session->namaddr));
 #endif
 
     return (0);
@@ -744,11 +746,22 @@ static int smtp_start_tls(SMTP_STATE *state)
        DONT_USE_DEAD_SESSION;
 
        /*
-        * If TLS is optional, try again, this time without TLS.
-        * Specifically, this session is not final, don't defer any
-        * recipients yet.
+        * If TLS is optional, try delivery to the same server over a
+        * plaintext connection. Otherwise we would defer mail forever with
+        * destinations that have no alternate MX host.
+        * 
+        * Don't fall back to plaintext if we were willing to use SASL-over-TLS
+        * authentication. If the server doesn't announce SASL support over
+        * plaintext connections, then we don't want delivery to fail with
+        * "relay access denied".
         */
-       if (session->tls_level == TLS_LEV_MAY)
+       if (session->tls_level == TLS_LEV_MAY
+#ifdef USE_SASL_AUTH
+           && !(var_smtp_sasl_enable
+                && *var_smtp_sasl_passwd
+                && smtp_sasl_passwd_lookup(session))
+#endif
+           )
            RETRY_AS_PLAINTEXT;
        return (smtp_site_fail(state, DSN_BY_LOCAL_MTA,
                               SMTP_RESP_FAKE(&fake, "4.7.5"),
index 433258dc75cd3969e844a38e1729148f3d63e1f5..139f6fd5309b34451077c8de8800c1322f9e205a 100644 (file)
@@ -175,9 +175,13 @@ int     smtp_sasl_passwd_lookup(SMTP_SESSION *session)
         && (value = mail_addr_find(smtp_sasl_passwd_map,
                                 state->request->sender, (char **) 0)) != 0)
        || (value = maps_find(smtp_sasl_passwd_map, session->host, 0)) != 0
-       || (value = maps_find(smtp_sasl_passwd_map, session->dest, 0)) != 0) {
+      || (value = maps_find(smtp_sasl_passwd_map, session->dest, 0)) != 0) {
+       if (session->sasl_username)
+           myfree(session->sasl_username);
        session->sasl_username = mystrdup(value);
        passwd = split_at(session->sasl_username, ':');
+       if (session->sasl_passwd)
+           myfree(session->sasl_passwd);
        session->sasl_passwd = mystrdup(passwd ? passwd : "");
        if (msg_verbose)
            msg_info("%s: host `%s' user `%s' pass `%s'",
index 8425f1d3bc03cb077f902d0aa3010ff729e8da07..1f6dfdfd814aefbb92b4164262341f1b1ebed53f 100644 (file)
 /* .IP "\fBsmtpd_delay_open_until_valid_rcpt (yes)\fR"
 /*     Postpone the start of an SMTP mail transaction until a valid
 /*     RCPT TO command is received.
+/* .PP
+/*     Available in Postfix version 2.3 and later:
+/* .IP "\fBsmtpd_tls_always_issue_session_ids (yes)\fR"
+/*     Force the Postfix SMTP server to issue a TLS session id, even
+/*     when TLS session caching is turned off (smtpd_tls_session_cache_database
+/*     is empty).
 /* ADDRESS REWRITING CONTROLS
 /* .ad
 /* .fi
 /* .IP "\fBsmtpd_tls_CAfile (empty)\fR"
 /*     The file with the certificate of the certification authority
 /*     (CA) that issued the Postfix SMTP server certificate.
+/* .IP "\fBsmtpd_tls_always_issue_session_ids (yes)\fR"
+/*     Force the Postfix SMTP server to issue a TLS session id, even
+/*     when TLS session caching is turned off (smtpd_tls_session_cache_database
+/*     is empty).
 /* .IP "\fBsmtpd_tls_ask_ccert (no)\fR"
 /*     Ask a remote SMTP client for a client certificate.
 /* .IP "\fBsmtpd_tls_auth_only (no)\fR"
 /* .PP
 /*     Available in Postfix version 2.3 and later:
 /* .IP "\fBsmtpd_peername_lookup (yes)\fR"
-/*     Attempt to look up the Postfix SMTP client hostname, and verify that
+/*     Attempt to look up the remote SMTP client hostname, and verify that
 /*     the name matches the client IP address.
 /* .PP
 /*     The per SMTP client connection count and request rate limits are
@@ -1070,6 +1080,7 @@ char   *var_smtpd_tls_mand_proto;
 bool    var_smtpd_tls_received_header;
 bool    var_smtpd_tls_req_ccert;
 int     var_smtpd_tls_scache_timeout;
+bool    var_smtpd_tls_set_sessid;
 int     var_tls_daemon_rand_bytes;
 
 #endif
@@ -1520,7 +1531,7 @@ static void helo_reset(SMTPD_STATE *state)
     if (state->helo_name) {
        myfree(state->helo_name);
        state->helo_name = 0;
-       if (smtpd_milters)
+       if (SMTPD_STAND_ALONE(state) == 0 && smtpd_milters != 0)
            milter_abort(smtpd_milters);
     }
 }
@@ -4218,6 +4229,7 @@ static void pre_jail_init(char *unused_name, char **unused_argv)
            props.verifydepth = var_smtpd_tls_ccert_vd;
            props.cache_type = TLS_MGR_SCACHE_SMTPD;
            props.scache_timeout = var_smtpd_tls_scache_timeout;
+           props.set_sessid = var_smtpd_tls_set_sessid;
            props.cert_file = var_smtpd_tls_cert_file;
            props.key_file = var_smtpd_tls_key_file;
            props.dcert_file = var_smtpd_tls_dcert_file;
@@ -4250,14 +4262,14 @@ static void pre_jail_init(char *unused_name, char **unused_argv)
                msg_warn("Can't require client certs unless TLS is required");
 
            props.cipherlist =
-               tls_cipher_list(enforce_tls ?
-                                   tls_cipher_level(var_smtpd_tls_mand_ciph) :
-                                   TLS_CIPHER_EXPORT,
+               tls_cipher_list(enforce_tls ?
+                               tls_cipher_level(var_smtpd_tls_mand_ciph) :
+                               TLS_CIPHER_EXPORT,
                                var_smtpd_tls_excl_ciph,
                                havecert ? "" : "aRSA aDSS",
                                wantcert ? "aNULL" : "",
-                               enforce_tls ?  var_smtpd_tls_mand_excl :
-                                   TLS_END_EXCLUDE,
+                               enforce_tls ? var_smtpd_tls_mand_excl :
+                               TLS_END_EXCLUDE,
                                TLS_END_EXCLUDE);
 
            if (props.cipherlist == 0) {
@@ -4268,8 +4280,8 @@ static void pre_jail_init(char *unused_name, char **unused_argv)
                                    var_smtpd_tls_excl_ciph,
                                    havecert ? "" : "aRSA aDSS",
                                    wantcert ? "aNULL" : "",
-                                   enforce_tls ?  var_smtpd_tls_mand_excl :
-                                       TLS_END_EXCLUDE,
+                                   enforce_tls ? var_smtpd_tls_mand_excl :
+                                   TLS_END_EXCLUDE,
                                    TLS_END_EXCLUDE);
            }
            if (havecert || oknocert)
@@ -4439,6 +4451,7 @@ int     main(int argc, char **argv)
        VAR_SMTPD_TLS_ACERT, DEF_SMTPD_TLS_ACERT, &var_smtpd_tls_ask_ccert,
        VAR_SMTPD_TLS_RCERT, DEF_SMTPD_TLS_RCERT, &var_smtpd_tls_req_ccert,
        VAR_SMTPD_TLS_RECHEAD, DEF_SMTPD_TLS_RECHEAD, &var_smtpd_tls_received_header,
+       VAR_SMTPD_TLS_SET_SESSID, DEF_SMTPD_TLS_SET_SESSID, &var_smtpd_tls_set_sessid,
 #endif
        VAR_SMTPD_PEERNAME_LOOKUP, DEF_SMTPD_PEERNAME_LOOKUP, &var_smtpd_peername_lookup,
        VAR_SMTPD_DELAY_OPEN, DEF_SMTPD_DELAY_OPEN, &var_smtpd_delay_open,
index 8bee86f5dadb65ac7c81fbe815cc6bccab725535..f1370232703ffd56621b6386ab6e538387c7574e 100644 (file)
@@ -17,7 +17,7 @@
 #include <name_code.h>
 
  /*
-  * TLS enforcement levels. Non-sentinel values also be used to indicate
+  * TLS enforcement levels. Non-sentinel values may also be used to indicate
   * the actual security level of a session.
   */
 #define TLS_LEV_NOTFOUND       -1      /* sentinel */
@@ -174,6 +174,7 @@ typedef struct {
     int     verifydepth;
     const char *cache_type;
     long    scache_timeout;
+    int     set_sessid;
     const char *cert_file;
     const char *key_file;
     const char *dcert_file;
index bc7e8aefa0bb4f9c1be179ca2716c62c5690ed7f..3c6dac341a458b4766574c342bcb7d45c9be31de 100644 (file)
@@ -447,7 +447,7 @@ SSL_CTX *tls_server_init(const tls_server_props *props)
        tls_print_errors();
        cachable = 0;
     }
-    if (cachable) {
+    if (cachable || props->set_sessid) {
 
        /*
         * Initialize the session cache.
@@ -474,8 +474,10 @@ SSL_CTX *tls_server_init(const tls_server_props *props)
        SSL_CTX_set_session_cache_mode(server_ctx,
                                       SSL_SESS_CACHE_SERVER |
                                       SSL_SESS_CACHE_NO_AUTO_CLEAR);
-       SSL_CTX_sess_set_get_cb(server_ctx, get_server_session_cb);
-       SSL_CTX_sess_set_new_cb(server_ctx, new_server_session_cb);
+       if (cachable) {
+           SSL_CTX_sess_set_get_cb(server_ctx, get_server_session_cb);
+           SSL_CTX_sess_set_new_cb(server_ctx, new_server_session_cb);
+       }
 
        /*
         * OpenSSL ignores timed-out sessions. We need to set the internal