]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.5-20080114
authorWietse Venema <wietse@porcupine.org>
Mon, 14 Jan 2008 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:33:51 +0000 (06:33 +0000)
55 files changed:
postfix/.indent.pro
postfix/HISTORY
postfix/README_FILES/CDB_README
postfix/README_FILES/LDAP_README
postfix/README_FILES/MILTER_README
postfix/README_FILES/MYSQL_README
postfix/README_FILES/PCRE_README
postfix/README_FILES/PGSQL_README
postfix/README_FILES/SASL_README
postfix/README_FILES/TLS_README
postfix/RELEASE_NOTES
postfix/WISHLIST
postfix/conf/master.cf
postfix/html/CDB_README.html
postfix/html/LDAP_README.html
postfix/html/MILTER_README.html
postfix/html/MYSQL_README.html
postfix/html/PCRE_README.html
postfix/html/PGSQL_README.html
postfix/html/SASL_README.html
postfix/html/TLS_README.html
postfix/html/lmtp.8.html
postfix/html/postconf.5.html
postfix/html/proxymap.8.html
postfix/html/smtp.8.html
postfix/html/tlsmgr.8.html
postfix/man/man5/postconf.5
postfix/man/man8/proxymap.8
postfix/man/man8/smtp.8
postfix/man/man8/tlsmgr.8
postfix/mantools/postlink
postfix/proto/CDB_README.html
postfix/proto/LDAP_README.html
postfix/proto/MILTER_README.html
postfix/proto/MYSQL_README.html
postfix/proto/PCRE_README.html
postfix/proto/PGSQL_README.html
postfix/proto/SASL_README.html
postfix/proto/TLS_README.html
postfix/proto/postconf.proto
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/milter/milter8.c
postfix/src/pipe/pipe.c
postfix/src/proxymap/proxymap.c
postfix/src/smtp/Makefile.in
postfix/src/smtp/lmtp_params.c
postfix/src/smtp/smtp.c
postfix/src/smtp/smtp_params.c
postfix/src/smtp/smtp_sasl_auth_cache.c [new file with mode: 0644]
postfix/src/smtp/smtp_sasl_auth_cache.h [new file with mode: 0644]
postfix/src/smtp/smtp_sasl_glue.c
postfix/src/smtpd/smtpd.c
postfix/src/tlsmgr/tlsmgr.c
postfix/src/util/sys_defs.h

index b54aff891d87ce2d07ab78afeaf86cd4568ba7a4..73040aa46cd3f0436ffb58ab1803145ef6e808af 100644 (file)
 -TSMTP_ADDR
 -TSMTP_CMD
 -TSMTP_RESP
+-TSMTP_SASL_AUTH_CACHE
 -TSMTP_SESSION
 -TSMTP_STATE
 -TSMTP_TLS_SITE_POLICY
index b8302f2951f00fd9e41a782dc8b38ebbdd6de4f1..b7a44cfafacae5a492879c67ff12e572fc1ceb71 100644 (file)
@@ -14231,3 +14231,24 @@ Apologies for any names omitted.
 
        Cleanup: more read-only data. Files: everything that passes
        around a HEADER_OPTS pointer.
+
+20080112
+
+       Safety: optional lookup table to prevent the Postfix SMTP
+       client from making repeated SASL login failures with the
+       same hostname, username and password.  This introduces new
+       parameters: smtp_sasl_auth_cache_name, smtp_sasl_auth_cache_time.
+       Based on code by Keean Schupke.  Files: smtp/smtp_sasl_glue.c,
+       smtp/smtp_sasl_auth_cache.c.
+
+       Safety: the Postfix SMTP client now by default defers mail
+       after the server rejects a SASL login attempt with a 535
+       status code.  Specify "smtp_sasl_auth_soft_bounce = no" to
+       get the earlier behavior.  Based on code by Keean Schupke.
+       Files: smtp/smtp_sasl_glue.c.
+
+20080114
+
+       Safety: the smtpd_client_new_tls_session_rate_limit setting
+       now also limits the number of failed TLS handshakes. This
+       limits the impact of broken configurations. File: smtpd/smtpd.c.
index b93993291a3c14629eee07055441855ae0da9660..502b7c4911cca2692232445f90b983b394cec01b 100644 (file)
@@ -20,7 +20,11 @@ document has general information about Postfix databases.
 CDB support is available with Postfix 2.2 and later releases. This document
 describes how to build Postfix with CDB support.
 
-B\bBu\bui\bil\bld\bdi\bin\bng\bg P\bPo\bos\bst\btf\bfi\bix\bx w\bwi\bit\bth\bh C\bCD\bDB\bB
+B\bBu\bui\bil\bld\bdi\bin\bng\bg P\bPo\bos\bst\btf\bfi\bix\bx w\bwi\bit\bth\bh C\bCD\bDB\bB s\bsu\bup\bpp\bpo\bor\brt\bt
+
+These instructions assume that you build Postfix from source code as described
+in the INSTALL document. Some modification may be required if you build Postfix
+from a vendor-specific source package.
 
 Postfix is compatible with two CDB implementations:
 
index fc5da6b1a4cbd4e4543363d66fcc08433eecdf92..043b311a20e41c9a5c27e0e67c77cb18d3899bbc 100644 (file)
@@ -26,6 +26,10 @@ Topics covered in this document:
 
 B\bBu\bui\bil\bld\bdi\bin\bng\bg P\bPo\bos\bst\btf\bfi\bix\bx w\bwi\bit\bth\bh L\bLD\bDA\bAP\bP s\bsu\bup\bpp\bpo\bor\brt\bt
 
+These instructions assume that you build Postfix from source code as described
+in the INSTALL document. Some modification may be required if you build Postfix
+from a vendor-specific source package.
+
 Note 1: Postfix no longer supports the LDAP version 1 interface.
 
 Note 2: to use LDAP with Debian GNU/Linux's Postfix, all you need is to install
index cf901786c43b1cf630e254daec6ead855761600a..a67fa044d3200ee323102e69c767d020dd8209ac 100644 (file)
@@ -340,8 +340,7 @@ Sendmail. See the workarounds section below for solutions.
     |{client_name}       |Always                   |when lookup or            |
     |                    |                         |verification fails        |
     |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
-    |{client_port}       |Always                   |Client TCP port           |
-    |                    |(Postfix >=2.5)          |                          |
+    |{client_port}       |Always (Postfix >=2.5)   |Client TCP port           |
     |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
     |                    |                         |Client name from reverse  |
     |{client_ptr}        |CONNECT, HELO, MAIL, DATA|lookup, "unknown" when    |
@@ -374,7 +373,8 @@ Sendmail. See the workarounds section below for solutions.
 
 Postfix sends specific sets of macros at different SMTP protocol stages. The
 sets are configured with the parameters as described in the table (EOH = end of
-headers; EOM = end of message).
+headers; EOM = end of message). The protocol version is a number that Postfix
+sends at the beginning of the Milter protocol handshake.
 
      _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b 
     |P\bPa\bar\bra\bam\bme\bet\bte\ber\br n\bna\bam\bme\be               |P\bPr\bro\bot\bto\boc\bco\bol\bl v\bve\ber\brs\bsi\bio\bon\bn|P\bPr\bro\bot\bto\boc\bco\bol\bl s\bst\bta\bag\bge\be |
index 403fc736ca06a4991dbb691db296a8529ff3de93..7639bf36eb3bac45eb5bd2d207fa83372546a065 100644 (file)
@@ -17,6 +17,10 @@ service.
 
 B\bBu\bui\bil\bld\bdi\bin\bng\bg P\bPo\bos\bst\btf\bfi\bix\bx w\bwi\bit\bth\bh M\bMy\byS\bSQ\bQL\bL s\bsu\bup\bpp\bpo\bor\brt\bt
 
+These instructions assume that you build Postfix from source code as described
+in the INSTALL document. Some modification may be required if you build Postfix
+from a vendor-specific source package.
+
 Note: to use mysql with Debian GNU/Linux's Postfix, all you need is to install
 the postfix-mysql package and you're done. There is no need to recompile
 Postfix.
index c633ce186afdf609c5698d9ffe25e77ba2141d87..f8d40d3d378c3439e2ff3b2b05ea86717727ff22 100644 (file)
@@ -16,6 +16,10 @@ pcre_table(5) manual page. Information about PCRE itself can be found at http:/
 
 B\bBu\bui\bil\bld\bdi\bin\bng\bg P\bPo\bos\bst\btf\bfi\bix\bx w\bwi\bit\bth\bh P\bPC\bCR\bRE\bE s\bsu\bup\bpp\bpo\bor\brt\bt
 
+These instructions assume that you build Postfix from source code as described
+in the INSTALL document. Some modification may be required if you build Postfix
+from a vendor-specific source package.
+
 Note: to use pcre with Debian GNU/Linux's Postfix, all you need is to install
 the postfix-pcre package and you're done. There is no need to recompile
 Postfix.
index 152d6a3f0c3f6cfa419358ab442dbced798033ec..502b5e6835595c60033aae16623696029d9c0031 100644 (file)
@@ -17,6 +17,10 @@ service.
 
 B\bBu\bui\bil\bld\bdi\bin\bng\bg P\bPo\bos\bst\btf\bfi\bix\bx w\bwi\bit\bth\bh P\bPo\bos\bst\btg\bgr\bre\beS\bSQ\bQL\bL s\bsu\bup\bpp\bpo\bor\brt\bt
 
+These instructions assume that you build Postfix from source code as described
+in the INSTALL document. Some modification may be required if you build Postfix
+from a vendor-specific source package.
+
 Note: to use pgsql with Debian GNU/Linux's Postfix, all you need to do is to
 install the postfix-pgsql package and you're done. There is no need to
 recompile Postfix.
index 62cc96c64e5320993166c20b1dda4f0e05c4e7ec..5266e9cb4bdb03ed652e3af183eab9ba93b35ec0 100644 (file)
@@ -62,6 +62,10 @@ Needless to say, these commands are not available in earlier Postfix versions.
 
 B\bBu\bui\bil\bld\bdi\bin\bng\bg P\bPo\bos\bst\btf\bfi\bix\bx w\bwi\bit\bth\bh D\bDo\bov\bve\bec\bco\bot\bt S\bSA\bAS\bSL\bL s\bsu\bup\bpp\bpo\bor\brt\bt
 
+These instructions assume that you build Postfix from source code as described
+in the INSTALL document. Some modification may be required if you build Postfix
+from a vendor-specific source package.
+
 Support for the Dovecot version 1 SASL protocol is available in Postfix 2.3 and
 later. At the time of writing, only server-side SASL support is available, so
 you can't use it to authenticate to your network provider's server. Dovecot
@@ -102,6 +106,10 @@ configure --enable-login''.
 
 B\bBu\bui\bil\bld\bdi\bin\bng\bg P\bPo\bos\bst\btf\bfi\bix\bx w\bwi\bit\bth\bh C\bCy\byr\bru\bus\bs S\bSA\bAS\bSL\bL s\bsu\bup\bpp\bpo\bor\brt\bt
 
+These instructions assume that you build Postfix from source code as described
+in the INSTALL document. Some modification may be required if you build Postfix
+from a vendor-specific source package.
+
 The following assumes that the Cyrus SASL include files are in /usr/local/
 include, and that the Cyrus SASL libraries are in /usr/local/lib.
 
index e11a09668e73438432a72ab5d22691fbaa10017e..6740bf3eb487100a16f97e9e0d0d181fd7765d8e 100644 (file)
@@ -49,9 +49,9 @@ programs. Other colored boxes represent storage elements.
     that seeds the TLS engines in the smtpd(8) server and smtp(8) client
     processes, and maintains the TLS session key cache files.
 
-                    <---seed---              ---seed--->
+                    <---seed----             ----seed--->
 Network-> smtpd(8)                tlsmgr(8)                 smtp(8)  ->Network
-                    <-session->              <-session->        
+                    <-key/cert->             <-key/cert->       
 
                                 /       |    \
                                         |
@@ -63,6 +63,10 @@ Network-> smtpd(8)                tlsmgr(8)                 smtp(8)  ->Network
 
 B\bBu\bui\bil\bld\bdi\bin\bng\bg P\bPo\bos\bst\btf\bfi\bix\bx w\bwi\bit\bth\bh T\bTL\bLS\bS s\bsu\bup\bpp\bpo\bor\brt\bt
 
+These instructions assume that you build Postfix from source code as described
+in the INSTALL document. Some modification may be required if you build Postfix
+from a vendor-specific source package.
+
 To build Postfix with TLS support, first we need to generate the make(1) files
 with the necessary definitions. This is done by invoking the command "make
 makefiles" in the Postfix top-level directory and with arguments as shown next.
@@ -1795,16 +1799,16 @@ indicates a super-user shell.
         writing new private key to './demoCA/private/cakey.pem'
         Enter PEM pass phrase:w\bwh\bha\bat\bte\bev\bve\ber\br
 
-  * Create an unpassworded private key for host FOO and create an unsigned
-    public key certificate.
+  * Create an unpassworded private key for host foo.porcupine.org and create an
+    unsigned public key certificate.
 
-        % o\bop\bpe\ben\bns\bss\bsl\bl r\bre\beq\bq -\b-n\bne\bew\bw -\b-n\bno\bod\bde\bes\bs -\b-k\bke\bey\byo\bou\but\bF\bFO\bOO\bO-\b-k\bke\bey\by.\b.p\bpe\bem\bm -\b-o\bou\but\bt F\bFO\bOO\bO-\b-r\bre\beq\bq.\b.p\bpe\bem\bm -\b-d\bda\bay\bys\bs
+        % o\bop\bpe\ben\bns\bss\bsl\bl r\bre\beq\bq -\b-n\bne\bew\bw -\b-n\bno\bod\bde\bes\bs -\b-k\bke\bey\byo\bou\but\bf\bfo\boo\bo-\b-k\bke\bey\by.\b.p\bpe\bem\bm -\b-o\bou\but\bt f\bfo\boo\bo-\b-r\bre\beq\bq.\b.p\bpe\bem\bm -\b-d\bda\bay\bys\bs
         3\b36\b65\b5
         Using configuration from /etc/ssl/openssl.cnf
         Generating a 1024 bit RSA private key
         ........................................++++++
         ....++++++
-        writing new private key to 'FOO-key.pem'
+        writing new private key to 'foo-key.pem'
         -----
         You are about to be asked to enter information that will be
         incorporated
@@ -1820,7 +1824,7 @@ indicates a super-user shell.
         Locality Name (eg, city) []:W\bWe\bes\bst\btc\bch\bhe\bes\bst\bte\ber\br
         Organization Name (eg, company) [Internet Widgits Pty Ltd]:P\bPo\bor\brc\bcu\bup\bpi\bin\bne\be
         Organizational Unit Name (eg, section) []:
-        Common Name (eg, YOUR name) []:F\bFO\bOO\bO
+        Common Name (eg, YOUR name) []:f\bfo\boo\bo.\b.p\bpo\bor\brc\bcu\bup\bpi\bin\bne\be.\b.o\bor\brg\bg
         Email Address []:w\bwi\bie\bet\bts\bse\be@\b@p\bpo\bor\brc\bcu\bup\bpi\bin\bne\be.\b.o\bor\brg\bg
 
         Please enter the following 'extra' attributes
@@ -1828,10 +1832,10 @@ indicates a super-user shell.
         A challenge password []:w\bwh\bha\bat\bte\bev\bve\ber\br
         An optional company name []:
 
-  * Sign the public key certificate for host FOO with the Certification
-    Authority private key that we created a few steps ago.
+  * Sign the public key certificate for host foo.porcupine.org with the
+    Certification Authority private key that we created a few steps ago.
 
-        % o\bop\bpe\ben\bns\bss\bsl\bl c\bca\ba -\b-o\bou\but\bF\bFO\bOO\bO-\b-c\bce\ber\brt\bt.\b.p\bpe\bem\bm -\b-i\bin\bnf\bfi\bil\ble\bes\bs F\bFO\bOO\bO-\b-r\bre\beq\bq.\b.p\bpe\bem\bm
+        % o\bop\bpe\ben\bns\bss\bsl\bl c\bca\ba -\b-o\bou\but\bf\bfo\boo\bo-\b-c\bce\ber\brt\bt.\b.p\bpe\bem\bm -\b-i\bin\bnf\bfi\bil\ble\bes\bs f\bfo\boo\bo-\b-r\bre\beq\bq.\b.p\bpe\bem\bm
         Using configuration from /etc/ssl/openssl.cnf
         Enter PEM pass phrase:w\bwh\bha\bat\bte\bev\bve\ber\br
         Check that the request matches the signature
@@ -1841,7 +1845,7 @@ indicates a super-user shell.
         stateOrProvinceName   :PRINTABLE:'New York'
         localityName          :PRINTABLE:'Westchester'
         organizationName      :PRINTABLE:'Porcupine'
-        commonName            :PRINTABLE:'FOO'
+        commonName            :PRINTABLE:'foo.porcupine.org'
         emailAddress          :IA5STRING:'wietse@porcupine.org'
         Certificate is to be certified until Nov 21 19:40:56 2005 GMT (365
         days)
@@ -1855,9 +1859,9 @@ indicates a super-user shell.
     Certification Authority certificate files. This requires super-user
     privileges.
 
-        # c\bcp\bp d\bde\bem\bmo\boC\bCA\bA/\b/c\bca\bac\bce\ber\brt\bt.\b.p\bpe\bem\bF\bFO\bOO\bO-\b-k\bke\bey\by.\b.p\bpe\bem\bm F\bFO\bOO\bO-\b-c\bce\ber\brt\bt.\b.p\bpe\bem\bm /\b/e\bet\btc\bc/\b/p\bpo\bos\bst\btf\bfi\bix\bx
-        # c\bch\bhm\bmo\bod\bd 6\b64\b44\b4 /\b/e\bet\btc\bc/\b/p\bpo\bos\bst\btf\bfi\bix\bx/\b/F\bFO\bOO\bO-\b-c\bce\ber\brt\bt.\b.p\bpe\bem\bm /\b/e\bet\btc\bc/\b/p\bpo\bos\bst\btf\bfi\bix\bx/\b/c\bca\bac\bce\ber\brt\bt.\b.p\bpe\bem\bm
-        # c\bch\bhm\bmo\bod\bd 4\b40\b00\b0 /\b/e\bet\btc\bc/\b/p\bpo\bos\bst\btf\bfi\bix\bx/\b/F\bFO\bOO\bO-\b-k\bke\bey\by.\b.p\bpe\bem\bm
+        # c\bcp\bp d\bde\bem\bmo\boC\bCA\bA/\b/c\bca\bac\bce\ber\brt\bt.\b.p\bpe\bem\bf\bfo\boo\bo-\b-k\bke\bey\by.\b.p\bpe\bem\bm f\bfo\boo\bo-\b-c\bce\ber\brt\bt.\b.p\bpe\bem\bm /\b/e\bet\btc\bc/\b/p\bpo\bos\bst\btf\bfi\bix\bx
+        # c\bch\bhm\bmo\bod\bd 6\b64\b44\b4 /\b/e\bet\btc\bc/\b/p\bpo\bos\bst\btf\bfi\bix\bx/\b/f\bfo\boo\bo-\b-c\bce\ber\brt\bt.\b.p\bpe\bem\bm /\b/e\bet\btc\bc/\b/p\bpo\bos\bst\btf\bfi\bix\bx/\b/c\bca\bac\bce\ber\brt\bt.\b.p\bpe\bem\bm
+        # c\bch\bhm\bmo\bod\bd 4\b40\b00\b0 /\b/e\bet\btc\bc/\b/p\bpo\bos\bst\btf\bfi\bix\bx/\b/f\bfo\boo\bo-\b-k\bke\bey\by.\b.p\bpe\bem\bm
 
   * Configure Postfix, by adding the following to /etc/postfix/main.cf. It is
     generally best to not configure client certificates, unless there are
@@ -1873,8 +1877,8 @@ indicates a super-user shell.
                btree:/var/lib/postfix/smtp_tls_session_cache
             smtp_tls_security_level = may
             smtpd_tls_CAfile = /etc/postfix/cacert.pem
-            smtpd_tls_cert_file = /etc/postfix/FOO-cert.pem
-            smtpd_tls_key_file = /etc/postfix/FOO-key.pem
+            smtpd_tls_cert_file = /etc/postfix/foo-cert.pem
+            smtpd_tls_key_file = /etc/postfix/foo-key.pem
             smtpd_tls_received_header = yes
             smtpd_tls_session_cache_database =
                btree:/var/lib/postfix/smtpd_tls_session_cache
index a1b9ec37417b6835640134c6bce9b704c9d9db89..bee758dabf9cff6ef79fbfd09b120204b090f711 100644 (file)
@@ -11,6 +11,30 @@ instead, a new snapshot is released.
 The mail_release_date configuration parameter (format: yyyymmdd)
 specifies the release date of a stable release or snapshot release.
 
+Incompatibility with Postfix 2.3 and earlier
+============================================
+
+If you upgrade from Postfix 2.3 or earlier, read RELEASE_NOTES-2.4
+before proceeding.
+
+Incompatibility with Postfix snapshot 20080114
+==============================================
+
+The Postfix SMTP client now by default defers mail after a remote
+SMTP server rejects a SASL authentication attempt.  Specify
+"smtp_sasl_auth_soft_bounce = no" for the old behavior.
+
+Major changes with Postfix snapshot 20080114
+============================================
+
+The Postfix SMTP client can now avoid making repeated SASL login
+failures with the same server, username and password.  To enable
+this safety feature, specify for example "smtp_sasl_auth_cache_name
+= proxy:btree:/var/lib/postfix/sasl_auth_cache" (access through the
+proxy service is required). Instead of trying to SASL authenticate,
+the Postfix SMTP client defers or bounces mail as controlled with
+the new smtp_sasl_auth_soft_bounce configuration parameter.
+
 Incompatibility with Postfix snapshot 20080109
 ==============================================
 
@@ -136,12 +160,6 @@ require ESMTP command-line parsing in the cleanup server. Unfortunately,
 Sendmail's documentation does not specify what ESMTP options are
 supported, but only discusses examples of things that don't work.
 
-Incompatibility with Postfix 2.3 and earlier
-============================================
-
-If you upgrade from Postfix 2.3 or earlier, read RELEASE_NOTES-2.4
-before proceeding.
-
 Incompatibility with Postfix snapshot 20071216
 ==============================================
 
index de66e9fe9e00c45fc6f854009b160a3b47634a28..b8855e96f003731608a7fc18778d6f14aa5a528b 100644 (file)
@@ -1,5 +1,8 @@
 Wish list:
 
+       See if "pickup =o content_filter=smtp:127.0.0.1" can be
+       made a viable alternative to the use of non_smtpd_milters.
+
        Consolidate duplicated code *_server_accept_{pass,inet}().
 
        Consolidate duplicated code in {inet,unix,upass}_trigger.c.
@@ -11,8 +14,8 @@ Wish list:
        handlers unchanged, and have the smtp_loop() reader loop
        bail out with smtp_site_fail("server disconnected after
        %s", where), but only in the case that it isn't already in
-       the final state. Handle 421 replies in HELO/EHLO with custom
-       code to prevent EHLO->HELO fall-back.
+       the final state. But first we need to clean up the handling
+       of do/don't cache, expired, bad and dead sessions.
 
        Make event_drain() a proper event loop; update the zero mask,
        and don't ignore a non-empty timer queue.
@@ -63,7 +66,9 @@ Wish list:
        settings?
 
        Remove defer(8) and trace(8) references and man pages. These
-       are services not program names.
+       are services not program names. On the other hand we have
+       man pages for lmtp(8) and smtp(8), but not for relay(8).
+       Likewise, retry(8) does not have a man page.
 
        Bind all deliveries to the same local delivery process,
        making Postfix perform as poorly as monolithic mailers, but
@@ -75,13 +80,13 @@ Wish list:
 
        Need scache size limit.
 
-       Update BACKSCATTER_README to use PCRE because that's what I
-       am using now.
-
        Make postcat header/body aware so people can grep headers.
+       What headers? primary, mime, nested? What body? Does it
+       include the mime and attached headers?
 
        Make postmap header/body aware so people can test multi-line
-       header checks.
+       header checks. What headers? primary, mime, nested? What
+       body? Does it include the mime and attached headers?
 
        REDIRECT should override original recipient info, and
        probably override DSN as well.
@@ -266,10 +271,6 @@ Wish list:
 
        Med: separate ulimit for delivery to command?
 
-       Med: option to open queue file early, after MAIL FROM.  This
-       would allow correlation of rejected RCPT TO requests with
-       accepted requests for the same mail transaction.
-
        Med: postsuper -r should do something with recipients in
        bounce logfiles, to make sure the sender will be notified.
        To be perfectly safe, no process other than the queue manager
index a85f71f1a167c3cb65e5ed9bccc8277712139d8b..0ec4c660478f1c77077411972562eaad2c9f1fb9 100644 (file)
@@ -36,7 +36,7 @@ proxywrite unix -       -       n       -       -       proxymap
 smtp      unix  -       -       n       -       -       smtp
 # When relaying mail as backup MX, disable fallback_relay to avoid MX loops
 relay     unix  -       -       n       -       -       smtp
-       -o fallback_relay=
+       -o smtp_fallback_relay=
 #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
 showq     unix  n       -       n       -       -       showq
 error     unix  -       -       n       -       -       error
@@ -46,7 +46,7 @@ local     unix  -       n       n       -       -       local
 virtual   unix  -       n       n       -       -       virtual
 lmtp      unix  -       -       n       -       -       lmtp
 anvil     unix  -       -       n       -       1       anvil
-scache   unix  -       -       n       -       1       scache
+scache    unix  -       -       n       -       1       scache
 #
 # ====================================================================
 # Interfaces to non-Postfix software. Be sure to examine the manual
index ba1c5e8d6db3cb4cc90de7805749770141c66ed8..b0a56242a4f05aeb3dc2baf379f51137c48bdf2c 100644 (file)
@@ -37,7 +37,12 @@ information about Postfix databases.  </p>
 <p> CDB support is available with Postfix 2.2 and later releases.
 This document describes how to build Postfix with CDB support. </p>
 
-<h2>Building Postfix with CDB</h2>
+<h2>Building Postfix with CDB support</h2>
+
+<p> These instructions assume that you build Postfix from source
+code as described in the <a href="INSTALL.html">INSTALL</a> document. Some modification may
+be required if you build Postfix from a vendor-specific source
+package.  </p>
 
 <p> Postfix is compatible with two CDB implementations: </p>
 
index b3367b013fd1a6cd37715217c8f8d89f7486a4e7..2a9483aa2ba7c34f1be8a9f967f28eca8d405980 100644 (file)
@@ -55,6 +55,11 @@ it to each. </p>
 
 <h2><a name="build">Building Postfix with LDAP support</a></h2>
 
+<p> These instructions assume that you build Postfix from source
+code as described in the <a href="INSTALL.html">INSTALL</a> document. Some modification may   
+be required if you build Postfix from a vendor-specific source
+package.  </p>
+
 <p> Note 1: Postfix no longer supports the LDAP version 1 interface.
 </p>
 
@@ -165,7 +170,7 @@ server listening at port 389 on ldap.example.com. It will bind anonymously,
 search for any directory entries whose mailacceptinggeneralid
 attribute is "ldapuser", read the "maildrop" attributes of those
 found, and build a list of their maildrops, which will be treated
-as <a href="http://www.faqs.org/rfcs/rfc822.html">RFC822</a> addresses to which the message will be delivered. </p>
+as <a href="http://tools.ietf.org/html/rfc822">RFC822</a> addresses to which the message will be delivered. </p>
 
 <h2><a name="example_virtual">Example: virtual domains/addresses</a></h2>
 
@@ -555,10 +560,10 @@ contents, please include the applicable bits of some directory entries. </p>
 
 <li>Prabhat K Singh: Wrote the initial Postfix LDAP lookups and connection caching.
 
-<li>Keith Stevenson: <a href="http://www.faqs.org/rfcs/rfc2254.html">RFC 2254</a> escaping in queries.
+<li>Keith Stevenson: <a href="http://tools.ietf.org/html/rfc2254">RFC 2254</a> escaping in queries.
 
 <li>Samuel Tardieu: Noticed that searches could include wildcards, prompting
-                the work on <a href="http://www.faqs.org/rfcs/rfc2254.html">RFC 2254</a> escaping in queries. Spotted a bug
+                the work on <a href="http://tools.ietf.org/html/rfc2254">RFC 2254</a> escaping in queries. Spotted a bug
                 in binding.
 
 <li>Sami Haahtinen: Referral chasing and v3 support.
index 4c02b8d57c3ec3068ed1c831073e06ca0730807f..ce06e5ca28396ad600244f11c05d5c95fdea5677 100644 (file)
@@ -552,7 +552,7 @@ Connection concurrency for this client </td> </tr>
 <tr> <td> {client_name} </td> <td> Always </td> <td> Client hostname,
 "unknown" when lookup or verification fails </td> </tr>
 
-<tr> <td> {client_port} </td> <td> Always <br> (Postfix &ge;2.5) </td>
+<tr> <td> {client_port} </td> <td> Always (Postfix &ge;2.5) </td>
 <td> Client TCP port </td> </tr>
 
 <tr> <td> {client_ptr} </td> <td> CONNECT, HELO, MAIL, DATA </td>
@@ -592,7 +592,9 @@ TLS protocol version </td> </tr>
 
 <p> Postfix sends specific sets of macros at different SMTP protocol
 stages.  The sets are configured with the parameters as described
-in the table (EOH = end of headers; EOM = end of message). </p>
+in the table (EOH = end of headers; EOM = end of message). The
+protocol version is a number that Postfix sends at the beginning
+of the Milter protocol handshake. </p>
 
 <blockquote>
 
index 933059e5fbaf0664b2c3875706ade04e89ddebdc..1b50298ec318dc9deef9d90ed060ac83f6cbe0c0 100644 (file)
@@ -33,6 +33,11 @@ clients by using the Postfix <a href="proxymap.8.html">proxymap(8)</a> service.
 
 <h2>Building Postfix with MySQL support</h2>
 
+<p> These instructions assume that you build Postfix from source
+code as described in the <a href="INSTALL.html">INSTALL</a> document. Some modification may
+be required if you build Postfix from a vendor-specific source
+package.  </p>
+
 <p> Note: to use mysql with Debian GNU/Linux's Postfix, all you
 need is to install the postfix-mysql package and you're done.
 There is no need to recompile Postfix. </p>
index f4a4e25c44678cde681d14df878cd9a76fe5ff1c..6e619c616d5d46f522a2fdb7e3405364f6438e12 100644 (file)
@@ -32,6 +32,11 @@ itself can be found at <a href="http://www.pcre.org/">http://www.pcre.org/</a>.
 
 <h2>Building Postfix with PCRE support</h2>
 
+<p> These instructions assume that you build Postfix from source
+code as described in the <a href="INSTALL.html">INSTALL</a> document. Some modification may
+be required if you build Postfix from a vendor-specific source
+package.  </p>
+
 <p> Note: to use pcre with Debian GNU/Linux's Postfix, all you
 need is to install the postfix-pcre package and you're done.  There
 is no need to recompile Postfix. </p>
index 021d64175bd2889c6944f7322f8ecef8c4df1850..c7e3fed4fe6f767ec570c782709cd9a8bb431936 100644 (file)
@@ -33,6 +33,11 @@ clients by using the Postfix <a href="proxymap.8.html">proxymap(8)</a> service.
 
 <h2>Building Postfix with PostgreSQL support</h2>
 
+<p> These instructions assume that you build Postfix from source
+code as described in the <a href="INSTALL.html">INSTALL</a> document. Some modification may
+be required if you build Postfix from a vendor-specific source
+package.  </p>
+
 <p> Note: to use pgsql with Debian GNU/Linux's Postfix, all you
 need to do is to install the postfix-pgsql package and you're done.
 There is no need to recompile Postfix. </p>
index ea4a9f57a8677683a2f39cec917b0b90d3d99af7..a1a5de269f8ded5d316f545645b7349b2a9efc7c 100644 (file)
@@ -117,6 +117,11 @@ Postfix versions. </p>
 <h2><a name="build_dovecot">Building Postfix with Dovecot SASL
 support</a></h2>
 
+<p> These instructions assume that you build Postfix from source
+code as described in the <a href="INSTALL.html">INSTALL</a> document. Some modification may   
+be required if you build Postfix from a vendor-specific source
+package.  </p>
+
 <p> Support for the Dovecot version 1 SASL protocol is available
 in Postfix 2.3 and later.  At the time
 of writing, only server-side SASL support is available, so you can't
@@ -173,6 +178,11 @@ authentication method, specify ``./configure --enable-login''. </p>
 
 <h2><a name="build_postfix">Building Postfix with Cyrus SASL support</a></h2>
 
+<p> These instructions assume that you build Postfix from source
+code as described in the <a href="INSTALL.html">INSTALL</a> document. Some modification may   
+be required if you build Postfix from a vendor-specific source
+package.  </p>
+
 <p> The following
 assumes that the Cyrus SASL include files are in /usr/local/include,
 and that the Cyrus SASL libraries are in /usr/local/lib. </p>
index 9d6157aec8ab9da6837ce6fdfe49b5e1bb403e98..1aa59fe48a30fba8daf9d5ca7bc76e787ae5ba69 100644 (file)
@@ -95,9 +95,9 @@ cache files. </p>
 <tr> <td>Network<tt>-&gt; </tt> </td> <td align="center"
 bgcolor="#f0f0ff"> <br> <a href="smtpd.8.html">smtpd(8)</a> <br> &nbsp; </td> <td colspan="2">
 
-<tt> &lt;---seed---<br><br>&lt;-session-&gt; </tt> </td> <td
+<tt> &lt;---seed----<br><br>&lt;-key/cert-&gt; </tt> </td> <td
 align="center" bgcolor="#f0f0ff"> <br> <a href="tlsmgr.8.html">tlsmgr(8)</a> <br> &nbsp; </td>
-<td colspan="3"> <tt> ---seed---&gt;<br> <br>&lt;-session-&gt;
+<td colspan="3"> <tt> ----seed---&gt;<br> <br>&lt;-key/cert-&gt;
 
 </tt> </td> <td align="center" bgcolor="#f0f0ff"> <br> <a href="smtp.8.html">smtp(8)</a> <br>
 &nbsp; </td> <td> <tt> -&gt;</tt>Network </td> </tr>
@@ -122,6 +122,11 @@ align="center" bgcolor="#f0f0ff"> smtp<br> session<br> key cache
 
 <h2><a name="build_tls">Building Postfix with TLS support</a></h2>
 
+<p> These instructions assume that you build Postfix from source
+code as described in the <a href="INSTALL.html">INSTALL</a> document. Some modification may   
+be required if you build Postfix from a vendor-specific source
+package.  </p>
+
 <p> To build Postfix with TLS support, first we need to generate
 the <tt>make(1)</tt> files with the necessary definitions. This is
 done by invoking the command "<tt>make makefiles</tt>" in the Postfix
@@ -2431,17 +2436,17 @@ Enter PEM pass phrase:<b>whatever</b>
 </pre>
 </blockquote>
 
-<li> <p> Create an unpassworded private key for host FOO and create
+<li> <p> Create an unpassworded private key for host foo.porcupine.org and create
 an unsigned public key certificate. </p>
 
 <blockquote>
 <pre>
-% <b>openssl req -new -nodes -keyout FOO-key.pem -out FOO-req.pem -days 365</b>
+% <b>openssl req -new -nodes -keyout foo-key.pem -out foo-req.pem -days 365</b>
 Using configuration from /etc/ssl/openssl.cnf
 Generating a 1024 bit RSA private key
 ........................................++++++
 ....++++++
-writing new private key to 'FOO-key.pem'
+writing new private key to 'foo-key.pem'
 -----
 You are about to be asked to enter information that will be incorporated
 into your certificate request.
@@ -2455,7 +2460,7 @@ State or Province Name (full name) [Some-State]:<b>New York</b>
 Locality Name (eg, city) []:<b>Westchester</b>
 Organization Name (eg, company) [Internet Widgits Pty Ltd]:<b>Porcupine</b>
 Organizational Unit Name (eg, section) []:
-Common Name (eg, YOUR name) []:<b>FOO</b>
+Common Name (eg, YOUR name) []:<b>foo.porcupine.org</b>
 Email Address []:<b>wietse@porcupine.org</b>
 
 Please enter the following 'extra' attributes
@@ -2465,13 +2470,13 @@ An optional company name []:
 </pre>
 </blockquote>
 
-<li> <p> Sign the public key certificate for host FOO with the
+<li> <p> Sign the public key certificate for host foo.porcupine.org with the
 Certification Authority private key that we created a few
 steps ago. </p>
 
 <blockquote>
 <pre>
-% <b>openssl ca -out FOO-cert.pem -infiles FOO-req.pem</b>
+% <b>openssl ca -out foo-cert.pem -infiles foo-req.pem</b>
 Using configuration from /etc/ssl/openssl.cnf
 Enter PEM pass phrase:<b>whatever</b>
 Check that the request matches the signature
@@ -2481,7 +2486,7 @@ countryName           :PRINTABLE:'US'
 stateOrProvinceName   :PRINTABLE:'New York'
 localityName          :PRINTABLE:'Westchester'
 organizationName      :PRINTABLE:'Porcupine'
-commonName            :PRINTABLE:'FOO'
+commonName            :PRINTABLE:'foo.porcupine.org'
 emailAddress          :IA5STRING:'wietse@porcupine.org'
 Certificate is to be certified until Nov 21 19:40:56 2005 GMT (365 days)
 Sign the certificate? [y/n]:<b>y</b>
@@ -2499,9 +2504,9 @@ super-user privileges. </p>
 
 <blockquote>
 <pre>
-# <b>cp demoCA/cacert.pem FOO-key.pem FOO-cert.pem /etc/postfix</b>
-# <b>chmod 644 /etc/postfix/FOO-cert.pem /etc/postfix/cacert.pem</b>
-# <b>chmod 400 /etc/postfix/FOO-key.pem</b>
+# <b>cp demoCA/cacert.pem foo-key.pem foo-cert.pem /etc/postfix</b>
+# <b>chmod 644 /etc/postfix/foo-cert.pem /etc/postfix/cacert.pem</b>
+# <b>chmod 400 /etc/postfix/foo-key.pem</b>
 </pre>
 </blockquote>
 
@@ -2522,8 +2527,8 @@ but don't require them from all clients. </p>
        btree:/var/lib/postfix/smtp_tls_session_cache
     <a href="postconf.5.html#smtp_tls_security_level">smtp_tls_security_level</a> = may
     <a href="postconf.5.html#smtpd_tls_CAfile">smtpd_tls_CAfile</a> = /etc/postfix/cacert.pem
-    <a href="postconf.5.html#smtpd_tls_cert_file">smtpd_tls_cert_file</a> = /etc/postfix/FOO-cert.pem
-    <a href="postconf.5.html#smtpd_tls_key_file">smtpd_tls_key_file</a> = /etc/postfix/FOO-key.pem
+    <a href="postconf.5.html#smtpd_tls_cert_file">smtpd_tls_cert_file</a> = /etc/postfix/foo-cert.pem
+    <a href="postconf.5.html#smtpd_tls_key_file">smtpd_tls_key_file</a> = /etc/postfix/foo-key.pem
     <a href="postconf.5.html#smtpd_tls_received_header">smtpd_tls_received_header</a> = yes
     <a href="postconf.5.html#smtpd_tls_session_cache_database">smtpd_tls_session_cache_database</a> =
        btree:/var/lib/postfix/smtpd_tls_session_cache
index 949e74009429d113273283e2c49e5a71449cd797..ddfc4ab1cf1f8d9b2514f7bf50ddb3f4d10b2ef5 100644 (file)
@@ -346,6 +346,23 @@ SMTP(8)                                                                SMTP(8)
               The SASL plug-in type that the Postfix SMTP  client
               should use for authentication.
 
+       Available in Postfix version 2.5 and later:
+
+       <b><a href="postconf.5.html#smtp_sasl_auth_cache_name">smtp_sasl_auth_cache_name</a> (empty)</b>
+              An  optional table to prevent repeated SASL authen-
+              tication failures with the same remote SMTP  server
+              hostname, username and password.
+
+       <b><a href="postconf.5.html#smtp_sasl_auth_cache_time">smtp_sasl_auth_cache_time</a> (90d)</b>
+              The  maximal  age  of  an <a href="postconf.5.html#smtp_sasl_auth_cache_name">smtp_sasl_auth_cache_name</a>
+              entry before it is removed.
+
+       <b><a href="postconf.5.html#smtp_sasl_auth_soft_bounce">smtp_sasl_auth_soft_bounce</a> (yes)</b>
+              When a remote SMTP server rejects a SASL  authenti-
+              cation  request  with  a 535 reply code, defer mail
+              delivery instead of returning  mail  as  undeliver-
+              able.
+
 <b>STARTTLS SUPPORT CONTROLS</b>
        Detailed  information  about STARTTLS configuration may be
        found in the <a href="TLS_README.html">TLS_README</a> document.
index 180c320b93480ead8d3955f5d3b776187b051843..a6fc2500309f6ccb7b448144e64ea20423ff7ec7 100644 (file)
@@ -3901,6 +3901,28 @@ The default time unit is s (seconds).
 </p>
 
 
+</DD>
+
+<DT><b><a name="lmtp_sasl_auth_cache_name">lmtp_sasl_auth_cache_name</a>
+(default: empty)</b></DT><DD>
+
+<p> The LMTP-specific version of the <a href="postconf.5.html#smtp_sasl_auth_cache_name">smtp_sasl_auth_cache_name</a>
+configuration parameter.  See there for details. </p>
+
+<p> This feature is available in Postfix 2.5 and later. </p>
+
+
+</DD>
+
+<DT><b><a name="lmtp_sasl_auth_cache_time">lmtp_sasl_auth_cache_time</a>
+(default: 90d)</b></DT><DD>
+
+<p> The LMTP-specific version of the <a href="postconf.5.html#smtp_sasl_auth_cache_time">smtp_sasl_auth_cache_time</a>
+configuration parameter.  See there for details. </p>
+
+<p> This feature is available in Postfix 2.5 and later. </p>
+
+
 </DD>
 
 <DT><b><a name="lmtp_sasl_auth_enable">lmtp_sasl_auth_enable</a>
@@ -3911,6 +3933,17 @@ Enable SASL authentication in the Postfix LMTP client.
 </p>
 
 
+</DD>
+
+<DT><b><a name="lmtp_sasl_auth_soft_bounce">lmtp_sasl_auth_soft_bounce</a>
+(default: yes)</b></DT><DD>
+
+<p> The LMTP-specific version of the <a href="postconf.5.html#smtp_sasl_auth_soft_bounce">smtp_sasl_auth_soft_bounce</a>
+configuration parameter.  See there for details. </p>
+
+<p> This feature is available in Postfix 2.5 and later. </p>
+
+
 </DD>
 
 <DT><b><a name="lmtp_sasl_mechanism_filter">lmtp_sasl_mechanism_filter</a>
@@ -7764,8 +7797,9 @@ host, host:port, [host]:port, [address] or [address]:port; the form
 destinations, Postfix will try them in the specified order.  </p>
 
 <p> To prevent mailer loops between MX hosts and fall-back hosts,
-Postfix version 2.3 and later will not use the <a href="postconf.5.html#smtp_fallback_relay">smtp_fallback_relay</a>
-feature for destinations that it is MX host for. </p>
+Postfix version 2.2 and later will not use the fallback relays for
+destinations that it is MX host for (and DSN lookup is turned on).
+</p>
 
 
 </DD>
@@ -8153,6 +8187,52 @@ cached session is still usable.  </p>
 <p> This feature is available in Postfix 2.1 and later.  </p>
 
 
+</DD>
+
+<DT><b><a name="smtp_sasl_auth_cache_name">smtp_sasl_auth_cache_name</a>
+(default: empty)</b></DT><DD>
+
+<p> An optional table to prevent repeated SASL authentication
+failures with the same remote SMTP server hostname, username and
+password. Each table (key, value) pair contains a server name, a
+username and password, and the full server response. This information
+is stored when a remote SMTP server rejects an authentication attempt
+with a 535 reply code.  As long as the <a href="postconf.5.html#smtp_sasl_password_maps">smtp_sasl_password_maps</a>
+information does no change, and as long as the <a href="postconf.5.html#smtp_sasl_auth_cache_name">smtp_sasl_auth_cache_name</a>
+information does not expire (see <a href="postconf.5.html#smtp_sasl_auth_cache_time">smtp_sasl_auth_cache_time</a>) the
+Postfix SMTP client avoids SASL authentication attempts with the
+same server, username and password, and instead bounces or defers
+mail as controlled with the <a href="postconf.5.html#smtp_sasl_auth_soft_bounce">smtp_sasl_auth_soft_bounce</a> configuration
+parameter.  </p>
+
+<p> The table must be accessed via the proxywrite service, i.e. the
+map name must start with "<a href="proxymap.8.html">proxy</a>:". The table should be stored under
+the directory specified with the <a href="postconf.5.html#data_directory">data_directory</a> parameter. </p>
+
+<p> This feature uses cryptographic hashing to protect plain-text
+passwords, and requires that Postfix is compiled with TLS support.
+</p>
+
+<p> Example: </p>
+
+<pre>
+<a href="postconf.5.html#smtp_sasl_auth_cache_name">smtp_sasl_auth_cache_name</a> = <a href="proxymap.8.html">proxy</a>:btree:/var/lib/postfix/sasl_auth_cache
+</pre>
+
+<p> This feature is available in Postfix 2.5 and later. </p>
+
+
+</DD>
+
+<DT><b><a name="smtp_sasl_auth_cache_time">smtp_sasl_auth_cache_time</a>
+(default: 90d)</b></DT><DD>
+
+<p> The maximal age of an <a href="postconf.5.html#smtp_sasl_auth_cache_name">smtp_sasl_auth_cache_name</a> entry before it
+is removed. </p>
+
+<p> This feature is available in Postfix 2.5 and later. </p>
+
+
 </DD>
 
 <DT><b><a name="smtp_sasl_auth_enable">smtp_sasl_auth_enable</a>
@@ -8172,6 +8252,31 @@ Example:
 </pre>
 
 
+</DD>
+
+<DT><b><a name="smtp_sasl_auth_soft_bounce">smtp_sasl_auth_soft_bounce</a>
+(default: yes)</b></DT><DD>
+
+<p> When a remote SMTP server rejects a SASL authentication request
+with a 535 reply code, defer mail delivery instead of returning
+mail as undeliverable. The latter behavior was hard-coded prior to
+Postfix version 2.5. </p>
+
+<p> Note: the setting "yes" overrides the global <a href="postconf.5.html#soft_bounce">soft_bounce</a>
+parameter, but the setting "no" does not. </p>
+
+<p> Example: </p>
+
+<pre>
+# Default as of Postfix 2.5
+<a href="postconf.5.html#smtp_sasl_auth_soft_bounce">smtp_sasl_auth_soft_bounce</a> = yes
+# The old hard-coded default
+<a href="postconf.5.html#smtp_sasl_auth_soft_bounce">smtp_sasl_auth_soft_bounce</a> = no
+</pre>
+
+<p> This feature is available in Postfix 2.5 and later. </p>
+
+
 </DD>
 
 <DT><b><a name="smtp_sasl_mechanism_filter">smtp_sasl_mechanism_filter</a>
@@ -8676,6 +8781,9 @@ As in the example above, we show two matching fingerprints: </p>
     <a href="postconf.5.html#smtp_tls_policy_maps">smtp_tls_policy_maps</a> = hash:/etc/postfix/tls_policy
     <a href="postconf.5.html#smtp_tls_fingerprint_digest">smtp_tls_fingerprint_digest</a> = md5
 </pre>
+</blockquote>
+
+<blockquote>
 <pre>
 /etc/postfix/tls_policy:
     example.com        fingerprint
index a11b312aaa0561bba36bb01d63e96d0f975eec18..abdcf4ea8a925c716bbe644180dbcc9eaa24f1a7 100644 (file)
@@ -155,9 +155,13 @@ PROXYMAP(8)                                                        PROXYMAP(8)
               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#data_directory">data_directory</a> (see 'postconf -d' output)</b>
+              The directory with Postfix-writable data files (for
+              example: caches, pseudo-random numbers).
+
        <b><a href="postconf.5.html#daemon_timeout">daemon_timeout</a> (18000s)</b>
-              How  much time a Postfix daemon process may take to
-              handle a request  before  it  is  terminated  by  a
+              How much time a Postfix daemon process may take  to
+              handle  a  request  before  it  is  terminated by a
               built-in watchdog timer.
 
        <b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b>
@@ -165,25 +169,25 @@ PROXYMAP(8)                                                        PROXYMAP(8)
               over an internal communication channel.
 
        <b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b>
-              The maximum amount of time  that  an  idle  Postfix
-              daemon  process  waits  for  an incoming connection
+              The  maximum  amount  of  time that an idle Postfix
+              daemon process waits  for  an  incoming  connection
               before terminating voluntarily.
 
        <b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
-              The maximal number of incoming connections  that  a
-              Postfix  daemon  process will service before termi-
+              The  maximal  number of incoming connections that a
+              Postfix daemon process will service  before  termi-
               nating voluntarily.
 
        <b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
-              The process ID  of  a  Postfix  command  or  daemon
+              The  process  ID  of  a  Postfix  command or daemon
               process.
 
        <b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
-              The  process  name  of  a Postfix command or daemon
+              The process name of a  Postfix  command  or  daemon
               process.
 
        <b><a href="postconf.5.html#proxy_read_maps">proxy_read_maps</a> (see 'postconf -d' output)</b>
-              The lookup tables that the  <a href="proxymap.8.html"><b>proxymap</b>(8)</a>  server  is
+              The  lookup  tables  that the <a href="proxymap.8.html"><b>proxymap</b>(8)</a> server is
               allowed to access for the read-only service.
 
        Available in Postfix 2.5 and later:
@@ -193,7 +197,7 @@ PROXYMAP(8)                                                        PROXYMAP(8)
               example: caches, pseudo-random numbers).
 
        <b><a href="postconf.5.html#proxy_write_maps">proxy_write_maps</a> (see 'postconf -d' output)</b>
-              The lookup tables that the  <a href="proxymap.8.html"><b>proxymap</b>(8)</a>  server  is
+              The  lookup  tables  that the <a href="proxymap.8.html"><b>proxymap</b>(8)</a> server is
               allowed to access for the read-write service.
 
 <b>SEE ALSO</b>
@@ -204,7 +208,7 @@ PROXYMAP(8)                                                        PROXYMAP(8)
        <a href="DATABASE_README.html">DATABASE_README</a>, Postfix lookup table overview
 
 <b>LICENSE</b>
-       The Secure Mailer license must be  distributed  with  this
+       The  Secure  Mailer  license must be distributed with this
        software.
 
 <b>HISTORY</b>
index 949e74009429d113273283e2c49e5a71449cd797..ddfc4ab1cf1f8d9b2514f7bf50ddb3f4d10b2ef5 100644 (file)
@@ -346,6 +346,23 @@ SMTP(8)                                                                SMTP(8)
               The SASL plug-in type that the Postfix SMTP  client
               should use for authentication.
 
+       Available in Postfix version 2.5 and later:
+
+       <b><a href="postconf.5.html#smtp_sasl_auth_cache_name">smtp_sasl_auth_cache_name</a> (empty)</b>
+              An  optional table to prevent repeated SASL authen-
+              tication failures with the same remote SMTP  server
+              hostname, username and password.
+
+       <b><a href="postconf.5.html#smtp_sasl_auth_cache_time">smtp_sasl_auth_cache_time</a> (90d)</b>
+              The  maximal  age  of  an <a href="postconf.5.html#smtp_sasl_auth_cache_name">smtp_sasl_auth_cache_name</a>
+              entry before it is removed.
+
+       <b><a href="postconf.5.html#smtp_sasl_auth_soft_bounce">smtp_sasl_auth_soft_bounce</a> (yes)</b>
+              When a remote SMTP server rejects a SASL  authenti-
+              cation  request  with  a 535 reply code, defer mail
+              delivery instead of returning  mail  as  undeliver-
+              able.
+
 <b>STARTTLS SUPPORT CONTROLS</b>
        Detailed  information  about STARTTLS configuration may be
        found in the <a href="TLS_README.html">TLS_README</a> document.
index 509ee8b068aad1732aa466b58d15f3627b1d05ab..473edb021b4c94b48699249b023741d9608e464f 100644 (file)
@@ -138,25 +138,29 @@ TLSMGR(8)                                                            TLSMGR(8)
               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#data_directory">data_directory</a> (see 'postconf -d' output)</b>
+              The directory with Postfix-writable data files (for
+              example: caches, pseudo-random numbers).
+
        <b><a href="postconf.5.html#daemon_timeout">daemon_timeout</a> (18000s)</b>
-              How much time a Postfix daemon process may take  to
-              handle  a  request  before  it  is  terminated by a
+              How  much time a Postfix daemon process may take to
+              handle a request  before  it  is  terminated  by  a
               built-in watchdog timer.
 
        <b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
-              The process ID  of  a  Postfix  command  or  daemon
+              The  process  ID  of  a  Postfix  command or daemon
               process.
 
        <b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
-              The  process  name  of  a Postfix command or daemon
+              The process name of a  Postfix  command  or  daemon
               process.
 
        <b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
               The syslog facility of Postfix logging.
 
        <b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
-              The mail system  name  that  is  prepended  to  the
-              process  name  in  syslog  records, so that "smtpd"
+              The  mail  system  name  that  is  prepended to the
+              process name in syslog  records,  so  that  "smtpd"
               becomes, for example, "postfix/smtpd".
 
 <b>SEE ALSO</b>
@@ -171,7 +175,7 @@ TLSMGR(8)                                                            TLSMGR(8)
        <a href="TLS_README.html">TLS_README</a>, Postfix TLS configuration and operation
 
 <b>LICENSE</b>
-       The  Secure  Mailer  license must be distributed with this
+       The Secure Mailer license must be  distributed  with  this
        software.
 
 <b>AUTHOR(S)</b>
index b842e89a6a6b80f4cbc312587c388a997593cec4..141e5e04dc1e56952c1fbbfd355ca86218abc27d 100644 (file)
@@ -2141,8 +2141,23 @@ cached connection is still alive.
 .PP
 Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
 The default time unit is s (seconds).
+.SH lmtp_sasl_auth_cache_name (default: empty)
+The LMTP-specific version of the smtp_sasl_auth_cache_name
+configuration parameter.  See there for details.
+.PP
+This feature is available in Postfix 2.5 and later.
+.SH lmtp_sasl_auth_cache_time (default: 90d)
+The LMTP-specific version of the smtp_sasl_auth_cache_time
+configuration parameter.  See there for details.
+.PP
+This feature is available in Postfix 2.5 and later.
 .SH lmtp_sasl_auth_enable (default: no)
 Enable SASL authentication in the Postfix LMTP client.
+.SH lmtp_sasl_auth_soft_bounce (default: yes)
+The LMTP-specific version of the smtp_sasl_auth_soft_bounce
+configuration parameter.  See there for details.
+.PP
+This feature is available in Postfix 2.5 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.
@@ -4390,8 +4405,8 @@ host, host:port, [host]:port, [address] or [address]:port; the form
 destinations, Postfix will try them in the specified order.
 .PP
 To prevent mailer loops between MX hosts and fall-back hosts,
-Postfix version 2.3 and later will not use the smtp_fallback_relay
-feature for destinations that it is MX host for.
+Postfix version 2.2 and later will not use the fallback relays for
+destinations that it is MX host for (and DSN lookup is turned on).
 .SH smtp_generic_maps (default: empty)
 Optional lookup tables that perform address rewriting in the
 SMTP client, typically to transform a locally valid address into
@@ -4587,6 +4602,43 @@ order to finish a recipient address probe, or to verify that a
 cached session is still usable.
 .PP
 This feature is available in Postfix 2.1 and later.
+.SH smtp_sasl_auth_cache_name (default: empty)
+An optional table to prevent repeated SASL authentication
+failures with the same remote SMTP server hostname, username and
+password. Each table (key, value) pair contains a server name, a
+username and password, and the full server response. This information
+is stored when a remote SMTP server rejects an authentication attempt
+with a 535 reply code.  As long as the smtp_sasl_password_maps
+information does no change, and as long as the smtp_sasl_auth_cache_name
+information does not expire (see smtp_sasl_auth_cache_time) the
+Postfix SMTP client avoids SASL authentication attempts with the
+same server, username and password, and instead bounces or defers
+mail as controlled with the smtp_sasl_auth_soft_bounce configuration
+parameter.
+.PP
+The table must be accessed via the proxywrite service, i.e. the
+map name must start with "proxy:". The table should be stored under
+the directory specified with the data_directory parameter.
+.PP
+This feature uses cryptographic hashing to protect plain-text
+passwords, and requires that Postfix is compiled with TLS support.
+.PP
+Example:
+.PP
+.nf
+.na
+.ft C
+smtp_sasl_auth_cache_name = proxy:btree:/var/lib/postfix/sasl_auth_cache
+.fi
+.ad
+.ft R
+.PP
+This feature is available in Postfix 2.5 and later.
+.SH smtp_sasl_auth_cache_time (default: 90d)
+The maximal age of an smtp_sasl_auth_cache_name entry before it
+is removed.
+.PP
+This feature is available in Postfix 2.5 and later.
 .SH smtp_sasl_auth_enable (default: no)
 Enable SASL authentication in the Postfix SMTP client.  By default,
 the Postfix SMTP client uses no authentication.
@@ -4600,6 +4652,29 @@ smtp_sasl_auth_enable = yes
 .fi
 .ad
 .ft R
+.SH smtp_sasl_auth_soft_bounce (default: yes)
+When a remote SMTP server rejects a SASL authentication request
+with a 535 reply code, defer mail delivery instead of returning
+mail as undeliverable. The latter behavior was hard-coded prior to
+Postfix version 2.5.
+.PP
+Note: the setting "yes" overrides the global soft_bounce
+parameter, but the setting "no" does not.
+.PP
+Example:
+.PP
+.nf
+.na
+.ft C
+# Default as of Postfix 2.5
+smtp_sasl_auth_soft_bounce = yes
+# The old hard-coded default
+smtp_sasl_auth_soft_bounce = no
+.fi
+.ad
+.ft R
+.PP
+This feature is available in Postfix 2.5 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
@@ -4969,6 +5044,9 @@ As in the example above, we show two matching fingerprints:
 .fi
 .ad
 .ft R
+.in -4
+.sp
+.in +4
 .nf
 .na
 .ft C
index 025b307266e4cd92b5f3c090dcc49e03ad76f829..225dc3db43f81c51f6b63c1a708c6144443ff428 100644 (file)
@@ -160,6 +160,9 @@ The text below provides only a parameter summary. See
 .IP "\fBconfig_directory (see 'postconf -d' output)\fR"
 The default location of the Postfix main.cf and master.cf
 configuration files.
+.IP "\fBdata_directory (see 'postconf -d' output)\fR"
+The directory with Postfix-writable data files (for example:
+caches, pseudo-random numbers).
 .IP "\fBdaemon_timeout (18000s)\fR"
 How much time a Postfix daemon process may take to handle a
 request before it is terminated by a built-in watchdog timer.
index 873c5658cf75cda409040a1a9280af7561c467f4..830b7262547b4a9869ea71693a9935f6a32067f1 100644 (file)
@@ -302,6 +302,19 @@ the SASL plug-in implementation that is selected with
 .IP "\fBsmtp_sasl_type (cyrus)\fR"
 The SASL plug-in type that the Postfix SMTP client should use
 for authentication.
+.PP
+Available in Postfix version 2.5 and later:
+.IP "\fBsmtp_sasl_auth_cache_name (empty)\fR"
+An optional table to prevent repeated SASL authentication
+failures with the same remote SMTP server hostname, username and
+password.
+.IP "\fBsmtp_sasl_auth_cache_time (90d)\fR"
+The maximal age of an smtp_sasl_auth_cache_name entry before it
+is removed.
+.IP "\fBsmtp_sasl_auth_soft_bounce (yes)\fR"
+When a remote SMTP server rejects a SASL authentication request
+with a 535 reply code, defer mail delivery instead of returning
+mail as undeliverable.
 .SH "STARTTLS SUPPORT CONTROLS"
 .na
 .nf
index 5765ea3915eff92437ddaaa13914c1a268f72a1b..665f8f99c9118df72eb967866596a65f17f43305 100644 (file)
@@ -137,6 +137,9 @@ sources.
 .IP "\fBconfig_directory (see 'postconf -d' output)\fR"
 The default location of the Postfix main.cf and master.cf
 configuration files.
+.IP "\fBdata_directory (see 'postconf -d' output)\fR"
+The directory with Postfix-writable data files (for example:
+caches, pseudo-random numbers).
 .IP "\fBdaemon_timeout (18000s)\fR"
 How much time a Postfix daemon process may take to handle a
 request before it is terminated by a built-in watchdog timer.
index be7948d38adc7f572802a4919c0c0fba9c09ea2d..15ea442187dc9208f23fe7dcd600da29997c77e0 100755 (executable)
@@ -264,7 +264,10 @@ while (<>) {
     s;\blmtp_quit_timeout\b;<a href="postconf.5.html#lmtp_quit_timeout">$&</a>;g;
     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_cache_name\b;<a href="postconf.5.html#lmtp_sasl_auth_cache_name">$&</a>;g;
+    s;\blmtp_sasl_auth_cache_time\b;<a href="postconf.5.html#lmtp_sasl_auth_cache_time">$&</a>;g;
     s;\blmtp_sasl_auth_enable\b;<a href="postconf.5.html#lmtp_sasl_auth_enable">$&</a>;g;
+    s;\blmtp_sasl_auth_soft_bounce\b;<a href="postconf.5.html#lmtp_sasl_auth_soft_bounce">$&</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;
@@ -441,7 +444,10 @@ while (<>) {
     s;\bsmtp_randomize_addresses\b;<a href="postconf.5.html#smtp_randomize_addresses">$&</a>;g;
     s;\bsmtp_rcpt_timeout\b;<a href="postconf.5.html#smtp_rcpt_timeout">$&</a>;g;
     s;\bsmtp_rset_timeout\b;<a href="postconf.5.html#smtp_rset_timeout">$&</a>;g;
+    s;\bsmtp_sasl_auth_cache_name\b;<a href="postconf.5.html#smtp_sasl_auth_cache_name">$&</a>;g;
+    s;\bsmtp_sasl_auth_cache_time\b;<a href="postconf.5.html#smtp_sasl_auth_cache_time">$&</a>;g;
     s;\bsmtp_sasl_auth_enable\b;<a href="postconf.5.html#smtp_sasl_auth_enable">$&</a>;g;
+    s;\bsmtp_sasl_auth_soft_bounce\b;<a href="postconf.5.html#smtp_sasl_auth_soft_bounce">$&</a>;g;
     s;\bsmtp_sasl_mechanism_filter\b;<a href="postconf.5.html#smtp_sasl_mechanism_filter">$&</a>;g;
     s;\bsmtp_sasl_pass[-</Bb>]*\n* *[<Bb>]*word_maps\b;<a href="postconf.5.html#smtp_sasl_password_maps">$&</a>;g;
     s;\bsmtp_sasl_path\b;<a href="postconf.5.html#smtp_sasl_path">$&</a>;g;
index a025cd3e5c7ad1008e5464953f877c02015b4f6d..afe8a82eeea7135e800bcefdadc90a0e97f0101f 100644 (file)
@@ -37,7 +37,12 @@ information about Postfix databases.  </p>
 <p> CDB support is available with Postfix 2.2 and later releases.
 This document describes how to build Postfix with CDB support. </p>
 
-<h2>Building Postfix with CDB</h2>
+<h2>Building Postfix with CDB support</h2>
+
+<p> These instructions assume that you build Postfix from source
+code as described in the INSTALL document. Some modification may
+be required if you build Postfix from a vendor-specific source
+package.  </p>
 
 <p> Postfix is compatible with two CDB implementations: </p>
 
index 0fcdc646f021a5bccc83ace22af4ff3ad5e9601f..8cf9998d0e55bef26a620e3e1077e1ee98258f73 100644 (file)
@@ -55,6 +55,11 @@ it to each. </p>
 
 <h2><a name="build">Building Postfix with LDAP support</a></h2>
 
+<p> These instructions assume that you build Postfix from source
+code as described in the INSTALL document. Some modification may   
+be required if you build Postfix from a vendor-specific source
+package.  </p>
+
 <p> Note 1: Postfix no longer supports the LDAP version 1 interface.
 </p>
 
index 7176fc970da415a49b4601f24e5ef2c494aaa325..5085ed8a088e987ab423e691919b0f9c6e558c86 100644 (file)
@@ -552,7 +552,7 @@ Connection concurrency for this client </td> </tr>
 <tr> <td> {client_name} </td> <td> Always </td> <td> Client hostname,
 "unknown" when lookup or verification fails </td> </tr>
 
-<tr> <td> {client_port} </td> <td> Always <br> (Postfix &ge;2.5) </td>
+<tr> <td> {client_port} </td> <td> Always (Postfix &ge;2.5) </td>
 <td> Client TCP port </td> </tr>
 
 <tr> <td> {client_ptr} </td> <td> CONNECT, HELO, MAIL, DATA </td>
@@ -592,7 +592,9 @@ TLS protocol version </td> </tr>
 
 <p> Postfix sends specific sets of macros at different SMTP protocol
 stages.  The sets are configured with the parameters as described
-in the table (EOH = end of headers; EOM = end of message). </p>
+in the table (EOH = end of headers; EOM = end of message). The
+protocol version is a number that Postfix sends at the beginning
+of the Milter protocol handshake. </p>
 
 <blockquote>
 
index 7f56cf04f00869cdfb5ad662979657b7fdca9ef6..5ec69fccbf19f29f8dd5b6cac59379dd328039b2 100644 (file)
@@ -33,6 +33,11 @@ clients by using the Postfix proxymap(8) service. </p>
 
 <h2>Building Postfix with MySQL support</h2>
 
+<p> These instructions assume that you build Postfix from source
+code as described in the INSTALL document. Some modification may
+be required if you build Postfix from a vendor-specific source
+package.  </p>
+
 <p> Note: to use mysql with Debian GNU/Linux's Postfix, all you
 need is to install the postfix-mysql package and you're done.
 There is no need to recompile Postfix. </p>
index e00af3ed2d53972a585f41b861da48bf94b67ae8..f48a82dcea0eed50832b45ed335d0abfa7a65cef 100644 (file)
@@ -32,6 +32,11 @@ itself can be found at http://www.pcre.org/. </p>
 
 <h2>Building Postfix with PCRE support</h2>
 
+<p> These instructions assume that you build Postfix from source
+code as described in the INSTALL document. Some modification may
+be required if you build Postfix from a vendor-specific source
+package.  </p>
+
 <p> Note: to use pcre with Debian GNU/Linux's Postfix, all you
 need is to install the postfix-pcre package and you're done.  There
 is no need to recompile Postfix. </p>
index 60929e6b00987e551baaa9ccef0656da45afeb0a..eb31a9826a1de261097662bb23e1833eef8c244d 100644 (file)
@@ -33,6 +33,11 @@ clients by using the Postfix proxymap(8) service. </p>
 
 <h2>Building Postfix with PostgreSQL support</h2>
 
+<p> These instructions assume that you build Postfix from source
+code as described in the INSTALL document. Some modification may
+be required if you build Postfix from a vendor-specific source
+package.  </p>
+
 <p> Note: to use pgsql with Debian GNU/Linux's Postfix, all you
 need to do is to install the postfix-pgsql package and you're done.
 There is no need to recompile Postfix. </p>
index 3839d813dfa3b8164be7d8318726ab7114bc9e48..b0a88534fff0653787f6d7b38fd649356b2ec041 100644 (file)
@@ -117,6 +117,11 @@ Postfix versions. </p>
 <h2><a name="build_dovecot">Building Postfix with Dovecot SASL
 support</a></h2>
 
+<p> These instructions assume that you build Postfix from source
+code as described in the INSTALL document. Some modification may   
+be required if you build Postfix from a vendor-specific source
+package.  </p>
+
 <p> Support for the Dovecot version 1 SASL protocol is available
 in Postfix 2.3 and later.  At the time
 of writing, only server-side SASL support is available, so you can't
@@ -173,6 +178,11 @@ authentication method, specify ``./configure --enable-login''. </p>
 
 <h2><a name="build_postfix">Building Postfix with Cyrus SASL support</a></h2>
 
+<p> These instructions assume that you build Postfix from source
+code as described in the INSTALL document. Some modification may   
+be required if you build Postfix from a vendor-specific source
+package.  </p>
+
 <p> The following
 assumes that the Cyrus SASL include files are in /usr/local/include,
 and that the Cyrus SASL libraries are in /usr/local/lib. </p>
index 92889bc508bd6e5083ad0878002cabe9b86fc6c5..d171dfe17adfc0e3d1141cdaaff01e0e32ac1060 100644 (file)
@@ -95,9 +95,9 @@ cache files. </p>
 <tr> <td>Network<tt>-&gt; </tt> </td> <td align="center"
 bgcolor="#f0f0ff"> <br> <a href="smtpd.8.html">smtpd(8)</a> <br> &nbsp; </td> <td colspan="2">
 
-<tt> &lt;---seed---<br><br>&lt;-session-&gt; </tt> </td> <td
+<tt> &lt;---seed----<br><br>&lt;-key/cert-&gt; </tt> </td> <td
 align="center" bgcolor="#f0f0ff"> <br> <a href="tlsmgr.8.html">tlsmgr(8)</a> <br> &nbsp; </td>
-<td colspan="3"> <tt> ---seed---&gt;<br> <br>&lt;-session-&gt;
+<td colspan="3"> <tt> ----seed---&gt;<br> <br>&lt;-key/cert-&gt;
 
 </tt> </td> <td align="center" bgcolor="#f0f0ff"> <br> <a href="smtp.8.html">smtp(8)</a> <br>
 &nbsp; </td> <td> <tt> -&gt;</tt>Network </td> </tr>
@@ -122,6 +122,11 @@ align="center" bgcolor="#f0f0ff"> smtp<br> session<br> key cache
 
 <h2><a name="build_tls">Building Postfix with TLS support</a></h2>
 
+<p> These instructions assume that you build Postfix from source
+code as described in the INSTALL document. Some modification may   
+be required if you build Postfix from a vendor-specific source
+package.  </p>
+
 <p> To build Postfix with TLS support, first we need to generate
 the <tt>make(1)</tt> files with the necessary definitions. This is
 done by invoking the command "<tt>make makefiles</tt>" in the Postfix
@@ -2431,17 +2436,17 @@ Enter PEM pass phrase:<b>whatever</b>
 </pre>
 </blockquote>
 
-<li> <p> Create an unpassworded private key for host FOO and create
+<li> <p> Create an unpassworded private key for host foo.porcupine.org and create
 an unsigned public key certificate. </p>
 
 <blockquote>
 <pre>
-% <b>openssl req -new -nodes -keyout FOO-key.pem -out FOO-req.pem -days 365</b>
+% <b>openssl req -new -nodes -keyout foo-key.pem -out foo-req.pem -days 365</b>
 Using configuration from /etc/ssl/openssl.cnf
 Generating a 1024 bit RSA private key
 ........................................++++++
 ....++++++
-writing new private key to 'FOO-key.pem'
+writing new private key to 'foo-key.pem'
 -----
 You are about to be asked to enter information that will be incorporated
 into your certificate request.
@@ -2455,7 +2460,7 @@ State or Province Name (full name) [Some-State]:<b>New York</b>
 Locality Name (eg, city) []:<b>Westchester</b>
 Organization Name (eg, company) [Internet Widgits Pty Ltd]:<b>Porcupine</b>
 Organizational Unit Name (eg, section) []:
-Common Name (eg, YOUR name) []:<b>FOO</b>
+Common Name (eg, YOUR name) []:<b>foo.porcupine.org</b>
 Email Address []:<b>wietse@porcupine.org</b>
 
 Please enter the following 'extra' attributes
@@ -2465,13 +2470,13 @@ An optional company name []:
 </pre>
 </blockquote>
 
-<li> <p> Sign the public key certificate for host FOO with the
+<li> <p> Sign the public key certificate for host foo.porcupine.org with the
 Certification Authority private key that we created a few
 steps ago. </p>
 
 <blockquote>
 <pre>
-% <b>openssl ca -out FOO-cert.pem -infiles FOO-req.pem</b>
+% <b>openssl ca -out foo-cert.pem -infiles foo-req.pem</b>
 Using configuration from /etc/ssl/openssl.cnf
 Enter PEM pass phrase:<b>whatever</b>
 Check that the request matches the signature
@@ -2481,7 +2486,7 @@ countryName           :PRINTABLE:'US'
 stateOrProvinceName   :PRINTABLE:'New York'
 localityName          :PRINTABLE:'Westchester'
 organizationName      :PRINTABLE:'Porcupine'
-commonName            :PRINTABLE:'FOO'
+commonName            :PRINTABLE:'foo.porcupine.org'
 emailAddress          :IA5STRING:'wietse@porcupine.org'
 Certificate is to be certified until Nov 21 19:40:56 2005 GMT (365 days)
 Sign the certificate? [y/n]:<b>y</b>
@@ -2499,9 +2504,9 @@ super-user privileges. </p>
 
 <blockquote>
 <pre>
-# <b>cp demoCA/cacert.pem FOO-key.pem FOO-cert.pem /etc/postfix</b>
-# <b>chmod 644 /etc/postfix/FOO-cert.pem /etc/postfix/cacert.pem</b>
-# <b>chmod 400 /etc/postfix/FOO-key.pem</b>
+# <b>cp demoCA/cacert.pem foo-key.pem foo-cert.pem /etc/postfix</b>
+# <b>chmod 644 /etc/postfix/foo-cert.pem /etc/postfix/cacert.pem</b>
+# <b>chmod 400 /etc/postfix/foo-key.pem</b>
 </pre>
 </blockquote>
 
@@ -2522,8 +2527,8 @@ but don't require them from all clients. </p>
        btree:/var/lib/postfix/smtp_tls_session_cache
     smtp_tls_security_level = may
     smtpd_tls_CAfile = /etc/postfix/cacert.pem
-    smtpd_tls_cert_file = /etc/postfix/FOO-cert.pem
-    smtpd_tls_key_file = /etc/postfix/FOO-key.pem
+    smtpd_tls_cert_file = /etc/postfix/foo-cert.pem
+    smtpd_tls_key_file = /etc/postfix/foo-key.pem
     smtpd_tls_received_header = yes
     smtpd_tls_session_cache_database =
        btree:/var/lib/postfix/smtpd_tls_session_cache
index 038a7e84a7f27d65e3887d9ed8379e9c4e2478a7..2289fb2cdfb59acc856b4606cf2b97e87a94e935 100644 (file)
@@ -26,7 +26,8 @@
 # tool:
 #
 #   * Supported HTML elements are: blockquote, ul, li, dl, dt, dd,
-#     p, pre, b, i, h, and the escapes for < and >. Sorry, no tables.
+#     p, pre, b, i, h, and the escapes for < <= >= >. Sorry, no
+#     tables.
 #
 #   * HTML elements must be specified in lower case.
 #
 #   * Text between <!-- and --> is stripped out. The <!-- and -->
 #     must appear on separate lines.
 #
+#   * Blank lines are special for postconf2man: it replaces them by
+#     a "new paragraph" command. Don't put any blank lines inside
+#     <blockquote> text. Instead, put those blank lines between
+#     </blockquote> and <blockquote>.
+#
 #   * Text after a blank line must start with an HTML element.
 #
 #   Also:
@@ -1346,8 +1352,9 @@ host, host:port, [host]:port, [address] or [address]:port; the form
 destinations, Postfix will try them in the specified order.  </p>
 
 <p> To prevent mailer loops between MX hosts and fall-back hosts,
-Postfix version 2.3 and later will not use the smtp_fallback_relay
-feature for destinations that it is MX host for. </p>
+Postfix version 2.2 and later will not use the fallback relays for
+destinations that it is MX host for (and DSN lookup is turned on).
+</p>
 
 %PARAM fallback_relay 
 
@@ -10960,6 +10967,9 @@ As in the example above, we show two matching fingerprints: </p>
     smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
     smtp_tls_fingerprint_digest = md5
 </pre>
+</blockquote>
+
+<blockquote>
 <pre>
 /etc/postfix/tls_policy:
     example.com        fingerprint
@@ -11420,3 +11430,83 @@ software.  </p>
 
 <p> This feature is available in Postfix 2.5 and later. </p>
 
+%PARAM smtp_sasl_auth_soft_bounce yes
+
+<p> When a remote SMTP server rejects a SASL authentication request
+with a 535 reply code, defer mail delivery instead of returning
+mail as undeliverable. The latter behavior was hard-coded prior to
+Postfix version 2.5. </p>
+
+<p> Note: the setting "yes" overrides the global soft_bounce
+parameter, but the setting "no" does not. </p>
+
+<p> Example: </p>
+
+<pre>
+# Default as of Postfix 2.5
+smtp_sasl_auth_soft_bounce = yes
+# The old hard-coded default
+smtp_sasl_auth_soft_bounce = no
+</pre>
+
+<p> This feature is available in Postfix 2.5 and later. </p>
+
+%PARAM smtp_sasl_auth_cache_name
+
+<p> An optional table to prevent repeated SASL authentication
+failures with the same remote SMTP server hostname, username and
+password. Each table (key, value) pair contains a server name, a
+username and password, and the full server response. This information
+is stored when a remote SMTP server rejects an authentication attempt
+with a 535 reply code.  As long as the smtp_sasl_password_maps
+information does no change, and as long as the smtp_sasl_auth_cache_name
+information does not expire (see smtp_sasl_auth_cache_time) the
+Postfix SMTP client avoids SASL authentication attempts with the
+same server, username and password, and instead bounces or defers
+mail as controlled with the smtp_sasl_auth_soft_bounce configuration
+parameter.  </p>
+
+<p> The table must be accessed via the proxywrite service, i.e. the
+map name must start with "proxy:". The table should be stored under
+the directory specified with the data_directory parameter. </p>
+
+<p> This feature uses cryptographic hashing to protect plain-text
+passwords, and requires that Postfix is compiled with TLS support.
+</p>
+
+<p> Example: </p>
+
+<pre>
+smtp_sasl_auth_cache_name = proxy:btree:/var/lib/postfix/sasl_auth_cache
+</pre>
+
+<p> This feature is available in Postfix 2.5 and later. </p>
+
+%PARAM smtp_sasl_auth_cache_time 90d
+
+<p> The maximal age of an smtp_sasl_auth_cache_name entry before it
+is removed. </p>
+
+<p> This feature is available in Postfix 2.5 and later. </p>
+
+%PARAM lmtp_sasl_auth_soft_bounce yes
+
+<p> The LMTP-specific version of the smtp_sasl_auth_soft_bounce
+configuration parameter.  See there for details. </p>
+
+<p> This feature is available in Postfix 2.5 and later. </p>
+
+%PARAM lmtp_sasl_auth_cache_name
+
+<p> The LMTP-specific version of the smtp_sasl_auth_cache_name
+configuration parameter.  See there for details. </p>
+
+<p> This feature is available in Postfix 2.5 and later. </p>
+
+%PARAM lmtp_sasl_auth_cache_time 90d
+
+<p> The LMTP-specific version of the smtp_sasl_auth_cache_time
+configuration parameter.  See there for details. </p>
+
+<p> This feature is available in Postfix 2.5 and later. </p>
+
index 078d15b82c903dfdb67247ae5780a1f828cff013..55cecc7dd90d10ba9677004f47fbfcf364fc4898 100644 (file)
@@ -1574,6 +1574,27 @@ extern char *var_lmtp_sasl_path;
 #define DEF_CYRUS_SASL_AUTHZID 0
 extern int var_cyrus_sasl_authzid;
 
+ /*
+  * Special handling of AUTH 535 failures.
+  */
+#define VAR_SMTP_SASL_AUTH_SOFT_BOUNCE "smtp_sasl_auth_soft_bounce"
+#define DEF_SMTP_SASL_AUTH_SOFT_BOUNCE 1
+#define VAR_LMTP_SASL_AUTH_SOFT_BOUNCE "lmtp_sasl_auth_soft_bounce"
+#define DEF_LMTP_SASL_AUTH_SOFT_BOUNCE 1
+extern bool var_smtp_sasl_auth_soft_bounce;
+
+#define VAR_SMTP_SASL_AUTH_CACHE_NAME  "smtp_sasl_auth_cache_name"
+#define DEF_SMTP_SASL_AUTH_CACHE_NAME  ""
+#define VAR_LMTP_SASL_AUTH_CACHE_NAME  "lmtp_sasl_auth_cache_name"
+#define DEF_LMTP_SASL_AUTH_CACHE_NAME  ""
+extern char *var_smtp_sasl_auth_cache_name;
+
+#define VAR_SMTP_SASL_AUTH_CACHE_TIME  "smtp_sasl_auth_cache_time"
+#define DEF_SMTP_SASL_AUTH_CACHE_TIME  "90d"
+#define VAR_LMTP_SASL_AUTH_CACHE_TIME  "lmtp_sasl_auth_cache_time"
+#define DEF_LMTP_SASL_AUTH_CACHE_TIME  "90d"
+extern int var_smtp_sasl_auth_cache_time;
+
  /*
   * LMTP client. Timeouts inspired by RFC 1123. The LMTP recipient limit
   * determines how many recipient addresses the LMTP client sends along with
@@ -2040,7 +2061,8 @@ extern int var_local_rcpt_code;
 extern char *var_proxy_read_maps;
 
 #define VAR_PROXY_WRITE_MAPS   "proxy_write_maps"
-#define DEF_PROXY_WRITE_MAPS   ""      /* Add here: "$" VAR_AUTH_FAIL_MAP */
+#define DEF_PROXY_WRITE_MAPS   "$" VAR_SMTP_SASL_AUTH_CACHE_NAME \
+                               " $" VAR_LMTP_SASL_AUTH_CACHE_NAME
 extern char *var_proxy_write_maps;
 
  /*
index d8e7ab37fbcc132ad80f6e3f6528b014b90ee0f1..32550eb9df3f032a8cfb62fa6c00d13bfa9ad252 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      "20080109"
+#define MAIL_RELEASE_DATE      "20080114"
 #define MAIL_VERSION_NUMBER    "2.5"
 
 #ifdef SNAPSHOT
index 6247b601afb218de59a9c3eb24449112954ffa98..238c1d10771e69a012685c25ec9d910cfc23f4ea 100644 (file)
@@ -295,7 +295,7 @@ static const NAME_MASK smfif_table[] = {
 #define SMFIA_INET6            '6'     /* inet6 */
 
  /*
-  * External macro set numbers, to identify the optional macro name lists
+  * External macro class numbers, to identify the optional macro name lists
   * that may be sent after the initial negotiation header.
   */
 #define SMFIM_CONNECT  0               /* macros for connect */
@@ -318,7 +318,7 @@ static const NAME_CODE smfim_table[] = {
 };
 
  /*
-  * Mapping from external macro set numbers to our internal MILTER_MACROS
+  * Mapping from external macro class numbers to our internal MILTER_MACROS
   * structure members, without using a switch statement.
   */
 static const size_t milter8_macro_offsets[] = {
@@ -331,8 +331,8 @@ static const size_t milter8_macro_offsets[] = {
     offsetof(MILTER_MACROS, eoh_macros),/* Note: SMFIM_EOH > SMFIM_EOM */
 };
 
-#define MILTER8_MACRO_PTR(__macros, __type) \
-       ((char **) (((char *) (__macros)) + milter8_macro_offsets[(__type)]))
+#define MILTER8_MACRO_PTR(__macros, __class) \
+       ((char **) (((char *) (__macros)) + milter8_macro_offsets[(__class)]))
 
  /*
   * How much buffer space is available for sending body content.
index 13a0da53f0b4671bbe3e4385f2ea425fb117a567..ad68d6e1b46d81954f5b00206bce9be5ded06dd1 100644 (file)
@@ -920,7 +920,7 @@ static void get_service_attr(PIPE_ATTR *attr, char **argv)
        /*
         * null_sender=string
         */
-       else if (strncasecmp("null_sender=", *argv, sizeof("eol=") - 1) == 0) {
+       else if (strncasecmp("null_sender=", *argv, sizeof("null_sender=") - 1) == 0) {
            vstring_strcpy(attr->null_sender, *argv + sizeof("null_sender=") - 1);
        }
 
index 937f370df70ab81d56f770e01a716e69663d65fd..593986978eec55c3a61070b8b418d59983b2c3ed 100644 (file)
 /* .IP "\fBconfig_directory (see 'postconf -d' output)\fR"
 /*     The default location of the Postfix main.cf and master.cf
 /*     configuration files.
+/* .IP "\fBdata_directory (see 'postconf -d' output)\fR"
+/*     The directory with Postfix-writable data files (for example:
+/*     caches, pseudo-random numbers).
 /* .IP "\fBdaemon_timeout (18000s)\fR"
 /*     How much time a Postfix daemon process may take to handle a
 /*     request before it is terminated by a built-in watchdog timer.
index 48c9f8b5b13ff2d7aae0a698029ee47edc271456..f5ae8f07f976542a6234380401ebcbfc61f90ad6 100644 (file)
@@ -1,11 +1,13 @@
 SHELL  = /bin/sh
 SRCS   = smtp.c smtp_connect.c smtp_proto.c smtp_chat.c smtp_session.c \
        smtp_addr.c smtp_trouble.c smtp_state.c smtp_rcpt.c \
-       smtp_sasl_proto.c smtp_sasl_glue.c smtp_reuse.c smtp_map11.c
+       smtp_sasl_proto.c smtp_sasl_glue.c smtp_reuse.c smtp_map11.c \
+       smtp_sasl_auth_cache.c
 OBJS   = smtp.o smtp_connect.o smtp_proto.o smtp_chat.o smtp_session.o \
        smtp_addr.o smtp_trouble.o smtp_state.o smtp_rcpt.o \
-       smtp_sasl_proto.o smtp_sasl_glue.o smtp_reuse.o smtp_map11.o
-HDRS   = smtp.h smtp_sasl.h smtp_addr.h smtp_reuse.h
+       smtp_sasl_proto.o smtp_sasl_glue.o smtp_reuse.o smtp_map11.o \
+       smtp_sasl_auth_cache.o
+HDRS   = smtp.h smtp_sasl.h smtp_addr.h smtp_reuse.h smtp_sasl_auth_cache.h
 TESTSRC        = 
 DEFS   = -I. -I$(INC_DIR) -D$(SYSTYPE)
 CFLAGS = $(DEBUG) $(OPT) $(DEFS)
@@ -149,7 +151,6 @@ smtp_addr.o: ../../include/msg_stats.h
 smtp_addr.o: ../../include/myaddrinfo.h
 smtp_addr.o: ../../include/mymalloc.h
 smtp_addr.o: ../../include/name_code.h
-smtp_addr.o: ../../include/name_mask.h
 smtp_addr.o: ../../include/own_inet_addr.h
 smtp_addr.o: ../../include/recipient_list.h
 smtp_addr.o: ../../include/resolve_clnt.h
@@ -270,7 +271,6 @@ smtp_map11.o: ../../include/mime_state.h
 smtp_map11.o: ../../include/msg.h
 smtp_map11.o: ../../include/msg_stats.h
 smtp_map11.o: ../../include/name_code.h
-smtp_map11.o: ../../include/name_mask.h
 smtp_map11.o: ../../include/quote_822_local.h
 smtp_map11.o: ../../include/quote_flags.h
 smtp_map11.o: ../../include/recipient_list.h
@@ -361,7 +361,6 @@ smtp_rcpt.o: ../../include/msg.h
 smtp_rcpt.o: ../../include/msg_stats.h
 smtp_rcpt.o: ../../include/mymalloc.h
 smtp_rcpt.o: ../../include/name_code.h
-smtp_rcpt.o: ../../include/name_mask.h
 smtp_rcpt.o: ../../include/recipient_list.h
 smtp_rcpt.o: ../../include/resolve_clnt.h
 smtp_rcpt.o: ../../include/scache.h
@@ -394,7 +393,6 @@ smtp_reuse.o: ../../include/msg.h
 smtp_reuse.o: ../../include/msg_stats.h
 smtp_reuse.o: ../../include/mymalloc.h
 smtp_reuse.o: ../../include/name_code.h
-smtp_reuse.o: ../../include/name_mask.h
 smtp_reuse.o: ../../include/recipient_list.h
 smtp_reuse.o: ../../include/resolve_clnt.h
 smtp_reuse.o: ../../include/scache.h
@@ -409,6 +407,40 @@ smtp_reuse.o: ../../include/vstring.h
 smtp_reuse.o: smtp.h
 smtp_reuse.o: smtp_reuse.c
 smtp_reuse.o: smtp_reuse.h
+smtp_sasl_auth_cache.o: ../../include/argv.h
+smtp_sasl_auth_cache.o: ../../include/attr.h
+smtp_sasl_auth_cache.o: ../../include/base64_code.h
+smtp_sasl_auth_cache.o: ../../include/deliver_request.h
+smtp_sasl_auth_cache.o: ../../include/dict.h
+smtp_sasl_auth_cache.o: ../../include/dict_proxy.h
+smtp_sasl_auth_cache.o: ../../include/dsn.h
+smtp_sasl_auth_cache.o: ../../include/dsn_buf.h
+smtp_sasl_auth_cache.o: ../../include/dsn_util.h
+smtp_sasl_auth_cache.o: ../../include/header_body_checks.h
+smtp_sasl_auth_cache.o: ../../include/header_opts.h
+smtp_sasl_auth_cache.o: ../../include/htable.h
+smtp_sasl_auth_cache.o: ../../include/maps.h
+smtp_sasl_auth_cache.o: ../../include/match_list.h
+smtp_sasl_auth_cache.o: ../../include/match_ops.h
+smtp_sasl_auth_cache.o: ../../include/mime_state.h
+smtp_sasl_auth_cache.o: ../../include/msg.h
+smtp_sasl_auth_cache.o: ../../include/msg_stats.h
+smtp_sasl_auth_cache.o: ../../include/mymalloc.h
+smtp_sasl_auth_cache.o: ../../include/name_code.h
+smtp_sasl_auth_cache.o: ../../include/recipient_list.h
+smtp_sasl_auth_cache.o: ../../include/resolve_clnt.h
+smtp_sasl_auth_cache.o: ../../include/scache.h
+smtp_sasl_auth_cache.o: ../../include/string_list.h
+smtp_sasl_auth_cache.o: ../../include/stringops.h
+smtp_sasl_auth_cache.o: ../../include/sys_defs.h
+smtp_sasl_auth_cache.o: ../../include/tls.h
+smtp_sasl_auth_cache.o: ../../include/tok822.h
+smtp_sasl_auth_cache.o: ../../include/vbuf.h
+smtp_sasl_auth_cache.o: ../../include/vstream.h
+smtp_sasl_auth_cache.o: ../../include/vstring.h
+smtp_sasl_auth_cache.o: smtp.h
+smtp_sasl_auth_cache.o: smtp_sasl_auth_cache.c
+smtp_sasl_auth_cache.o: smtp_sasl_auth_cache.h
 smtp_sasl_glue.o: ../../include/argv.h
 smtp_sasl_glue.o: ../../include/attr.h
 smtp_sasl_glue.o: ../../include/deliver_request.h
@@ -428,7 +460,6 @@ smtp_sasl_glue.o: ../../include/msg.h
 smtp_sasl_glue.o: ../../include/msg_stats.h
 smtp_sasl_glue.o: ../../include/mymalloc.h
 smtp_sasl_glue.o: ../../include/name_code.h
-smtp_sasl_glue.o: ../../include/name_mask.h
 smtp_sasl_glue.o: ../../include/recipient_list.h
 smtp_sasl_glue.o: ../../include/resolve_clnt.h
 smtp_sasl_glue.o: ../../include/scache.h
@@ -444,6 +475,7 @@ smtp_sasl_glue.o: ../../include/vstring.h
 smtp_sasl_glue.o: ../../include/xsasl.h
 smtp_sasl_glue.o: smtp.h
 smtp_sasl_glue.o: smtp_sasl.h
+smtp_sasl_glue.o: smtp_sasl_auth_cache.h
 smtp_sasl_glue.o: smtp_sasl_glue.c
 smtp_sasl_proto.o: ../../include/argv.h
 smtp_sasl_proto.o: ../../include/attr.h
@@ -463,7 +495,6 @@ smtp_sasl_proto.o: ../../include/msg.h
 smtp_sasl_proto.o: ../../include/msg_stats.h
 smtp_sasl_proto.o: ../../include/mymalloc.h
 smtp_sasl_proto.o: ../../include/name_code.h
-smtp_sasl_proto.o: ../../include/name_mask.h
 smtp_sasl_proto.o: ../../include/recipient_list.h
 smtp_sasl_proto.o: ../../include/resolve_clnt.h
 smtp_sasl_proto.o: ../../include/scache.h
@@ -497,7 +528,6 @@ smtp_session.o: ../../include/msg.h
 smtp_session.o: ../../include/msg_stats.h
 smtp_session.o: ../../include/mymalloc.h
 smtp_session.o: ../../include/name_code.h
-smtp_session.o: ../../include/name_mask.h
 smtp_session.o: ../../include/recipient_list.h
 smtp_session.o: ../../include/resolve_clnt.h
 smtp_session.o: ../../include/scache.h
@@ -531,7 +561,6 @@ smtp_state.o: ../../include/msg.h
 smtp_state.o: ../../include/msg_stats.h
 smtp_state.o: ../../include/mymalloc.h
 smtp_state.o: ../../include/name_code.h
-smtp_state.o: ../../include/name_mask.h
 smtp_state.o: ../../include/recipient_list.h
 smtp_state.o: ../../include/resolve_clnt.h
 smtp_state.o: ../../include/scache.h
@@ -598,7 +627,6 @@ smtp_unalias.o: ../../include/msg.h
 smtp_unalias.o: ../../include/msg_stats.h
 smtp_unalias.o: ../../include/myaddrinfo.h
 smtp_unalias.o: ../../include/name_code.h
-smtp_unalias.o: ../../include/name_mask.h
 smtp_unalias.o: ../../include/recipient_list.h
 smtp_unalias.o: ../../include/resolve_clnt.h
 smtp_unalias.o: ../../include/scache.h
index 7ab5241e9e9fb87a2e8745574bdcb4358fdee4cd..5f7c41b5a1b7c14b62c542deb25216af00513ee2 100644 (file)
@@ -43,6 +43,7 @@
        VAR_LMTP_TCP_PORT, DEF_LMTP_TCP_PORT, &var_lmtp_tcp_port, 0, 0,
        VAR_LMTP_PIX_BUG_WORDS, DEF_LMTP_PIX_BUG_WORDS, &var_smtp_pix_bug_words, 0, 0,
        VAR_LMTP_PIX_BUG_MAPS, DEF_LMTP_PIX_BUG_MAPS, &var_smtp_pix_bug_maps, 0, 0,
+       VAR_LMTP_SASL_AUTH_CACHE_NAME, DEF_LMTP_SASL_AUTH_CACHE_NAME, &var_smtp_sasl_auth_cache_name, 0, 0,
        VAR_CYRUS_CONF_PATH, DEF_CYRUS_CONF_PATH, &var_cyrus_conf_path, 0, 0,
        VAR_LMTP_HEAD_CHKS, DEF_LMTP_HEAD_CHKS, &var_smtp_head_chks, 0, 0,
        VAR_LMTP_MIME_CHKS, DEF_LMTP_MIME_CHKS, &var_smtp_mime_chks, 0, 0,
@@ -69,6 +70,7 @@
        VAR_LMTP_STARTTLS_TMOUT, DEF_LMTP_STARTTLS_TMOUT, &var_smtp_starttls_tmout, 1, 0,
 #endif
        VAR_SCACHE_PROTO_TMOUT, DEF_SCACHE_PROTO_TMOUT, &var_scache_proto_tmout, 1, 0,
+       VAR_LMTP_SASL_AUTH_CACHE_TIME, DEF_LMTP_SASL_AUTH_CACHE_TIME, &var_smtp_sasl_auth_cache_time, 0, 0,
        0,
     };
     static const CONFIG_INT_TABLE lmtp_int_table[] = {
 #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_AUTH_SOFT_BOUNCE, DEF_LMTP_SASL_AUTH_SOFT_BOUNCE, &var_smtp_sasl_auth_soft_bounce,
        0,
     };
index 963256c96950e6ce4458519049ed0fbd2a4a4189..4871787817aaa191eddee2e8295f6cb77cdcd027 100644 (file)
 /* .IP "\fBsmtp_sasl_type (cyrus)\fR"
 /*     The SASL plug-in type that the Postfix SMTP client should use
 /*     for authentication.
+/* .PP
+/*     Available in Postfix version 2.5 and later:
+/* .IP "\fBsmtp_sasl_auth_cache_name (empty)\fR"
+/*     An optional table to prevent repeated SASL authentication
+/*     failures with the same remote SMTP server hostname, username and
+/*     password.
+/* .IP "\fBsmtp_sasl_auth_cache_time (90d)\fR"
+/*     The maximal age of an smtp_sasl_auth_cache_name entry before it
+/*     is removed.
+/* .IP "\fBsmtp_sasl_auth_soft_bounce (yes)\fR"
+/*     When a remote SMTP server rejects a SASL authentication request
+/*     with a 535 reply code, defer mail delivery instead of returning
+/*     mail as undeliverable.
 /* STARTTLS SUPPORT CONTROLS
 /* .ad
 /* .fi
@@ -749,6 +762,11 @@ char   *var_smtp_mime_chks;
 char   *var_smtp_nest_chks;
 char   *var_smtp_body_chks;
 
+ /* Special handling of 535 AUTH errors. */
+char   *var_smtp_sasl_auth_cache_name;
+int     var_smtp_sasl_auth_cache_time;
+bool    var_smtp_sasl_auth_soft_bounce;
+
  /*
   * Global variables.
   */
index e8e7887e9c37f354ff9a4f12e10b50515adf987e..61cf8b33cfb887f6ef155a8fe542380205168a22 100644 (file)
@@ -44,6 +44,7 @@
        VAR_LMTP_TCP_PORT, DEF_LMTP_TCP_PORT, &var_lmtp_tcp_port, 0, 0,
        VAR_SMTP_PIX_BUG_WORDS, DEF_SMTP_PIX_BUG_WORDS, &var_smtp_pix_bug_words, 0, 0,
        VAR_SMTP_PIX_BUG_MAPS, DEF_SMTP_PIX_BUG_MAPS, &var_smtp_pix_bug_maps, 0, 0,
+       VAR_SMTP_SASL_AUTH_CACHE_NAME, DEF_SMTP_SASL_AUTH_CACHE_NAME, &var_smtp_sasl_auth_cache_name, 0, 0,
        VAR_CYRUS_CONF_PATH, DEF_CYRUS_CONF_PATH, &var_cyrus_conf_path, 0, 0,
        VAR_SMTP_HEAD_CHKS, DEF_SMTP_HEAD_CHKS, &var_smtp_head_chks, 0, 0,
        VAR_SMTP_MIME_CHKS, DEF_SMTP_MIME_CHKS, &var_smtp_mime_chks, 0, 0,
@@ -70,6 +71,7 @@
        VAR_SMTP_STARTTLS_TMOUT, DEF_SMTP_STARTTLS_TMOUT, &var_smtp_starttls_tmout, 1, 0,
 #endif
        VAR_SCACHE_PROTO_TMOUT, DEF_SCACHE_PROTO_TMOUT, &var_scache_proto_tmout, 1, 0,
+       VAR_SMTP_SASL_AUTH_CACHE_TIME, DEF_SMTP_SASL_AUTH_CACHE_TIME, &var_smtp_sasl_auth_cache_time, 0, 0,
        0,
     };
     static const CONFIG_INT_TABLE smtp_int_table[] = {
 #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_AUTH_SOFT_BOUNCE, DEF_SMTP_SASL_AUTH_SOFT_BOUNCE, &var_smtp_sasl_auth_soft_bounce,
        0,
     };
diff --git a/postfix/src/smtp/smtp_sasl_auth_cache.c b/postfix/src/smtp/smtp_sasl_auth_cache.c
new file mode 100644 (file)
index 0000000..ed98217
--- /dev/null
@@ -0,0 +1,266 @@
+/*++
+/* NAME
+/*     smtp_sasl_auth_cache 3
+/* SUMMARY
+/*     Postfix SASL authentication reply cache
+/* SYNOPSIS
+/*     #include "smtp.h"
+/*     #include "smtp_sasl_auth_cache.h"
+/*
+/*     SMTP_SASL_AUTH_CACHE *smtp_sasl_auth_cache_init(map, ttl)
+/*     const char *map
+/*     int     ttl;
+/*
+/*     void    smtp_sasl_auth_cache_store(auth_cache, session, resp)
+/*     SMTP_SASL_AUTH_CACHE *auth_cache;
+/*     const SMTP_SESSION *session;
+/*     const SMTP_RESP *resp;
+/*
+/*     int     smtp_sasl_auth_cache_find(auth_cache, session)
+/*     SMTP_SASL_AUTH_CACHE *auth_cache;
+/*     const SMTP_SESSION *session;
+/*
+/*     char    *smtp_sasl_auth_cache_dsn(auth_cache)
+/*     SMTP_SASL_AUTH_CACHE *auth_cache;
+/*
+/*     char    *smtp_sasl_auth_cache_text(auth_cache)
+/*     SMTP_SASL_AUTH_CACHE *auth_cache;
+/* DESCRIPTION
+/*     This module maintains a cache of SASL authentication server replies.
+/*     This can be used to avoid repeated login failure errors.
+/*
+/*     smtp_sasl_auth_cache_init() opens or creates the named cache.
+/*
+/*     smtp_sasl_auth_cache_store() stores information about a
+/*     SASL login attempt together with the server status and
+/*     complete response.
+/*
+/*     smtp_sasl_auth_cache_find() returns non-zero when a cache
+/*     entry exists for the given host, username and password.
+/*
+/*     smtp_sasl_auth_cache_dsn() and smtp_sasl_auth_cache_text()
+/*     return the status and complete server response as found
+/*     with smtp_sasl_auth_cache_find().
+/*
+/*     Arguments:
+/* .IP map
+/*     Lookup table name. The name must be singular and must start
+/*     with "proxy:".
+/* .IP ttl
+/*     The time after which a cache entry is considered expired.
+/* .IP session
+/*     Session context.
+/* .IP resp
+/*     Remote SMTP server response, to be stored into the cache.
+/* DIAGNOSTICS
+/*     All errors are fatal.
+/* LICENSE
+/* .ad
+/* .fi
+/*     The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/*     Original author:
+/*     Keean Schupke
+/*     Fry-IT Ltd.
+/*
+/*     Updated by:
+/*     Wietse Venema
+/*     IBM T.J. Watson Research
+/*     P.O. Box 704
+/*     Yorktown Heights, NY 10598, USA
+/*--*/
+
+ /*
+  * System library.
+  */
+#include <sys_defs.h>
+
+ /*
+  * Utility library
+  */
+#include <msg.h>
+#include <mymalloc.h>
+#include <stringops.h>
+#include <base64_code.h>
+#include <dict.h>
+
+ /*
+  * Global library
+  */
+#include <dsn_util.h>
+#include <dict_proxy.h>
+
+ /*
+  * Application-specific
+  */
+#include "smtp.h"
+#include "smtp_sasl_auth_cache.h"
+
+ /*
+  * XXX This feature stores passwords, so we must mask them with a strong
+  * cryptographic hash. This requires OpenSSL support.
+  * 
+  * XXX It would be even better if the stored hash were salted.
+  */
+#ifdef HAVE_SASL_AUTH_CACHE
+
+/* smtp_sasl_auth_cache_init - per-process initialization (pre jail) */
+
+SMTP_SASL_AUTH_CACHE *smtp_sasl_auth_cache_init(const char *map, int ttl)
+{
+    const char *myname = "smtp_sasl_auth_cache_init";
+    SMTP_SASL_AUTH_CACHE *auth_cache;
+
+    /*
+     * Sanity checks.
+     */
+#define HAS_MULTIPLE_VALUES(s) ((s)[strcspn((s),  ", \t\r\n")] != 0)
+
+    if (*map == 0)
+       msg_panic("%s: empty SASL authentication cache name", myname);
+    if (ttl < 0)
+       msg_panic("%s: bad SASL authentication cache ttl: %d", myname, ttl);
+    if (HAS_MULTIPLE_VALUES(map))
+       msg_fatal("SASL authentication cache name \"%s\" "
+                 "contains multiple values", map);
+
+    /*
+     * XXX To avoid multiple writers the map needs to be maintained by the
+     * proxywrite service. We would like to have a DICT_FLAG_REQ_PROXY flag
+     * so that the library can enforce this, but that requires moving the
+     * dict_proxy module one level down in the build dependency hierachy.
+     */
+#define CACHE_DICT_OPEN_FLAGS \
+       (DICT_FLAG_DUP_REPLACE | DICT_FLAG_SYNC_UPDATE)
+
+    if (strncmp(map, DICT_TYPE_PROXY, sizeof(DICT_TYPE_PROXY)) - 1 != 0
+       && map[sizeof(DICT_TYPE_PROXY) - 1] != ':')
+       msg_fatal("SASL authentication cache name \"%s\" must start with \""
+                 DICT_TYPE_PROXY "\":", map);
+
+    auth_cache = (SMTP_SASL_AUTH_CACHE *) mymalloc(sizeof(*auth_cache));
+    auth_cache->dict = dict_open(map, O_CREAT | O_RDWR, CACHE_DICT_OPEN_FLAGS);
+    auth_cache->ttl = ttl;
+    auth_cache->dsn = mymalloc(100);
+    auth_cache->text = mymalloc(100);
+    return (auth_cache);
+}
+
+ /*
+  * Each cache lookup key contains a server host name and user name. Each
+  * cache value contains a time stamp, a hashed password, and the server
+  * response. With this organization, we don't have to worry about cache
+  * pollution, because we can detect if a cache entry has expired, or if the
+  * password has changed.
+  */
+
+/* smtp_sasl_make_auth_cache_key - format auth failure cache lookup key */
+
+static char *smtp_sasl_make_auth_cache_key(const char *host, const char *user)
+{
+    VSTRING *buf = vstring_alloc(100);
+
+    vstring_sprintf(buf, "%s;%s", host, user);
+    return (vstring_export(buf));
+}
+
+/* smtp_sasl_make_auth_cache_pass - hash the auth failure cache password */
+
+static char *smtp_sasl_make_auth_cache_pass(const char *password)
+{
+    VSTRING *buf = vstring_alloc(2 * SHA_DIGEST_LENGTH);
+
+    base64_encode(buf, (const char *) SHA1((const unsigned char *) password,
+                                          strlen(password), 0),
+                 SHA_DIGEST_LENGTH);
+    return (vstring_export(buf));
+}
+
+/* smtp_sasl_make_auth_cache_value - format auth failure cache value */
+
+static char *smtp_sasl_make_auth_cache_value(const char *password,
+                                                    const char *dsn,
+                                                    const char *rep_str)
+{
+    VSTRING *val_buf = vstring_alloc(100);
+    char   *pwd_hash;
+    unsigned long now = (unsigned long) time((time_t *) 0);
+
+    pwd_hash = smtp_sasl_make_auth_cache_pass(password);
+    vstring_sprintf(val_buf, "%lu;%s;%s;%s", now, pwd_hash, dsn, rep_str);
+    myfree(pwd_hash);
+    return (vstring_export(val_buf));
+}
+
+/* smtp_sasl_auth_cache_valid - validate auth failure cache value */
+
+static int smtp_sasl_auth_cache_valid(SMTP_SASL_AUTH_CACHE *auth_cache,
+                                             const char *entry,
+                                             const char *password)
+{
+    ssize_t len = strlen(entry);
+    char   *cache_hash = mymalloc(len);
+    char   *curr_hash;
+    unsigned long now = (unsigned long) time((time_t *) 0);
+    unsigned long time_stamp;
+    int     valid;
+
+    auth_cache->dsn = myrealloc(auth_cache->dsn, len);
+    auth_cache->text = myrealloc(auth_cache->text, len);
+
+    if (sscanf(entry, "%lu;%[^;];%[^;];%[^\n]", &time_stamp, cache_hash,
+              auth_cache->dsn, auth_cache->text) != 4
+       || !dsn_valid(auth_cache->dsn)) {
+       msg_warn("bad smtp_sasl_auth_cache entry: %.100s", entry);
+       valid = 0;
+    } else if (time_stamp + auth_cache->ttl < now) {
+       valid = 0;
+    } else {
+       curr_hash = smtp_sasl_make_auth_cache_pass(password);
+       valid = (strcmp(cache_hash, curr_hash) == 0);
+       myfree(curr_hash);
+    }
+    myfree(cache_hash);
+    return (valid);
+}
+
+/* smtp_sasl_auth_cache_find - search auth failure cache */
+
+int     smtp_sasl_auth_cache_find(SMTP_SASL_AUTH_CACHE *auth_cache,
+                                         const SMTP_SESSION *session)
+{
+    char   *key;
+    const char *entry;
+    int     valid = 0;
+
+    key = smtp_sasl_make_auth_cache_key(session->host, session->sasl_username);
+    if ((entry = dict_get(auth_cache->dict, key)) != 0)
+       if ((valid = smtp_sasl_auth_cache_valid(auth_cache, entry,
+                                               session->sasl_passwd)) == 0)
+           /* Remove expired, password changed, or malformed cache entry. */
+           if (dict_del(auth_cache->dict, key) == 0)
+               msg_warn("SASL auth failure map %s: entry not deleted: %s",
+                        auth_cache->dict->name, key);
+    myfree(key);
+    return (valid);
+}
+
+/* smtp_sasl_auth_cache_store - update auth failure cache */
+
+void    smtp_sasl_auth_cache_store(SMTP_SASL_AUTH_CACHE *auth_cache,
+                                          const SMTP_SESSION *session,
+                                          const SMTP_RESP *resp)
+{
+    char   *key;
+    char   *value;
+
+    key = smtp_sasl_make_auth_cache_key(session->host, session->sasl_username);
+    value = smtp_sasl_make_auth_cache_value(session->sasl_passwd,
+                                           resp->dsn, resp->str);
+    dict_put(auth_cache->dict, key, value);
+
+    myfree(value);
+    myfree(key);
+}
+
+#endif
diff --git a/postfix/src/smtp/smtp_sasl_auth_cache.h b/postfix/src/smtp/smtp_sasl_auth_cache.h
new file mode 100644 (file)
index 0000000..71271a2
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef _SMTP_SASL_AUTH_CACHE_H_INCLUDED_
+#define _SMTP_SASL_AUTH_CACHE_H_INCLUDED_
+
+/*++
+/* NAME
+/*     smtp_sasl_auth_cache 3h
+/* SUMMARY
+/*     Postfix SASL authentication failure cache
+/* SYNOPSIS
+/*     #include "smtp.h"
+/*     #include "smtp_sasl_auth_cache.h"
+/* DESCRIPTION
+/* .nf
+
+ /*
+  * Utility library.
+  */
+#include <dict.h>
+
+ /*
+  * This code stores hashed passwords which requires OpenSSL.
+  */
+#ifdef USE_TLS
+#define HAVE_SASL_AUTH_CACHE
+
+ /*
+  * External interface.
+  */
+typedef struct {
+    DICT   *dict;
+    int     ttl;
+    char   *dsn;
+    char   *text;
+} SMTP_SASL_AUTH_CACHE;
+
+extern SMTP_SASL_AUTH_CACHE *smtp_sasl_auth_cache_init(const char *, int);
+extern void smtp_sasl_auth_cache_store(SMTP_SASL_AUTH_CACHE *, const SMTP_SESSION *, const SMTP_RESP *);
+extern int smtp_sasl_auth_cache_find(SMTP_SASL_AUTH_CACHE *, const SMTP_SESSION *);
+
+#define smtp_sasl_auth_cache_dsn(cp)   ((cp)->dsn)
+#define smtp_sasl_auth_cache_text(cp)  ((cp)->text)
+
+#endif
+
+/* LICENSE
+/* .ad
+/* .fi
+/*     The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/*     Initial implementation by:
+/*     Till Franke
+/*     SuSE Rhein/Main AG
+/*     65760 Eschborn, Germany
+/*
+/*     Adopted by:
+/*     Wietse Venema
+/*     IBM T.J. Watson Research
+/*     P.O. Box 704
+/*     Yorktown Heights, NY 10598, USA
+/*--*/
+
+#endif
index 7b225c3eed14b50270646f0708e8fabf842550b1..41d150e3caabbbdda7e0e7189fec389eefcd53a9 100644 (file)
   */
 #include "smtp.h"
 #include "smtp_sasl.h"
+#include "smtp_sasl_auth_cache.h"
 
 #ifdef USE_SASL_AUTH
 
@@ -142,6 +143,14 @@ STRING_LIST *smtp_sasl_mechs;
   */
 static XSASL_CLIENT_IMPL *smtp_sasl_impl;
 
+ /*
+  * The 535 SASL authentication failure cache.
+  */
+#ifdef HAVE_SASL_AUTH_CACHE
+static SMTP_SASL_AUTH_CACHE *smtp_sasl_auth_cache;
+
+#endif
+
 /* smtp_sasl_passwd_lookup - password lookup routine */
 
 int     smtp_sasl_passwd_lookup(SMTP_SESSION *session)
@@ -227,6 +236,20 @@ void    smtp_sasl_initialize(void)
     if (*var_smtp_sasl_mechs)
        smtp_sasl_mechs = string_list_init(MATCH_FLAG_NONE,
                                           var_smtp_sasl_mechs);
+
+    /*
+     * Initialize the 535 SASL authentication failure cache.
+     */
+    if (*var_smtp_sasl_auth_cache_name) {
+#ifdef HAVE_SASL_AUTH_CACHE
+       smtp_sasl_auth_cache =
+           smtp_sasl_auth_cache_init(var_smtp_sasl_auth_cache_name,
+                                     var_smtp_sasl_auth_cache_time);
+#else
+       msg_warn("not compiled with TLS support -- "
+                "ignoring the " VAR_SMTP_SASL_AUTH_CACHE_NAME " setting");
+#endif
+    }
 }
 
 /* smtp_sasl_connect - per-session client initialization */
@@ -279,6 +302,25 @@ int     smtp_sasl_authenticate(SMTP_SESSION *session, DSN_BUF *why)
        msg_info("%s: %s: SASL mechanisms %s",
                 myname, session->namaddrport, session->sasl_mechanism_list);
 
+    /*
+     * Avoid repeated login failures after a recent 535 error.
+     */
+#ifdef HAVE_SASL_AUTH_CACHE
+    if (smtp_sasl_auth_cache
+       && smtp_sasl_auth_cache_find(smtp_sasl_auth_cache, session)) {
+       char   *resp_dsn = smtp_sasl_auth_cache_dsn(smtp_sasl_auth_cache);
+       char   *resp_str = smtp_sasl_auth_cache_text(smtp_sasl_auth_cache);
+
+       if (var_smtp_sasl_auth_soft_bounce && resp_dsn[0] == '5')
+           resp_dsn[0] = '4';
+       dsb_update(why, resp_dsn, DSB_DEF_ACTION, DSB_MTYPE_DNS,
+                  session->host, var_procname, resp_str,
+                  "SASL [CACHED] authentication failed; server %s said: %s",
+                  session->host, resp_str);
+       return (0);
+    }
+#endif
+
     /*
      * Start the client side authentication protocol.
      */
@@ -340,6 +382,13 @@ int     smtp_sasl_authenticate(SMTP_SESSION *session, DSN_BUF *why)
      * We completed the authentication protocol.
      */
     if (resp->code / 100 != 2) {
+#ifdef HAVE_SASL_AUTH_CACHE
+       /* Update the 535 authentication failure cache. */
+       if (smtp_sasl_auth_cache && resp->code == 535)
+           smtp_sasl_auth_cache_store(smtp_sasl_auth_cache, session, resp);
+#endif
+       if (var_smtp_sasl_auth_soft_bounce && resp->code / 100 == 5)
+           STR(resp->dsn_buf)[0] = '4';
        dsb_update(why, resp->dsn, DSB_DEF_ACTION,
                   DSB_MTYPE_DNS, session->host,
                   var_procname, resp->str,
index 68775495a8bef76a274c716160658041f00d117a..7588ea913bf603448ae7ce3a70c2d199339c0c16 100644 (file)
@@ -3766,8 +3766,7 @@ static void smtpd_start_tls(SMTPD_STATE *state)
      * we exclude xclient authorized hosts from event count/rate control.
      */
     if (var_smtpd_cntls_limit > 0
-       && state->tls_context
-       && state->tls_context->session_reused == 0
+       && (state->tls_context == 0 || state->tls_context->session_reused == 0)
        && SMTPD_STAND_ALONE(state) == 0
        && !xclient_allowed
        && anvil_clnt
@@ -3778,9 +3777,10 @@ static void smtpd_start_tls(SMTPD_STATE *state)
        state->error_mask |= MAIL_ERROR_POLICY;
        msg_warn("New TLS session rate limit exceeded: %d from %s for service %s",
                 rate, state->namaddr, state->service);
-       smtpd_chat_reply(state,
-                   "421 4.7.0 %s Error: too many new TLS sessions from %s",
-                        var_myhostname, state->namaddr);
+       if (state->tls_context)
+           smtpd_chat_reply(state,
+                       "421 4.7.0 %s Error: too many new TLS sessions from %s",
+                            var_myhostname, state->namaddr);
        /* XXX Use regular return to signal end of session. */
        vstream_longjmp(state->client, SMTP_ERR_QUIET);
     }
index acf2fa959bf2ad15ebf535ea34da13961a2b4198..906f5b808eb8c3b35eec361e85d8b3c0bed749bd 100644 (file)
 /* .IP "\fBconfig_directory (see 'postconf -d' output)\fR"
 /*     The default location of the Postfix main.cf and master.cf
 /*     configuration files.
+/* .IP "\fBdata_directory (see 'postconf -d' output)\fR"
+/*     The directory with Postfix-writable data files (for example:
+/*     caches, pseudo-random numbers).
 /* .IP "\fBdaemon_timeout (18000s)\fR"
 /*     How much time a Postfix daemon process may take to handle a
 /*     request before it is terminated by a built-in watchdog timer.
index a43098de3e45c132f339bec5aa2021d89d623aa4..0c8f4d9865a3270227081fe9ae3ac51360034e53 100644 (file)
 
 /* __FreeBSD_version version is major+minor */
 
-#if __FreeBSD_version >= 200000
-#define HAS_DUPLEX_PIPE
-#endif
-
 #if __FreeBSD_version >= 220000
 #define HAS_DEV_URANDOM                        /* introduced in 2.1.5 */
 #endif
 #define SOCKOPT_SIZE   socklen_t
 #endif
 
+#if __FreeBSD_version >= 420000
+#define HAS_DUPLEX_PIPE                        /* 4.1 breaks with kqueue(2) */
+#endif
+
 /* OpenBSD version is year+month */
 
 #if OpenBSD >= 199805                  /* XXX */