]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.10-20121123
authorWietse Venema <wietse@porcupine.org>
Fri, 23 Nov 2012 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:38:21 +0000 (06:38 +0000)
23 files changed:
postfix/HISTORY
postfix/Makefile.in
postfix/README_FILES/POSTSCREEN_README
postfix/README_FILES/SASL_README
postfix/README_FILES/TLS_README
postfix/RELEASE_NOTES
postfix/WISHLIST
postfix/html/POSTSCREEN_README.html
postfix/html/SASL_README.html
postfix/html/TLS_README.html
postfix/html/memcache_table.5.html
postfix/makedefs
postfix/man/man5/memcache_table.5
postfix/proto/POSTSCREEN_README.html
postfix/proto/SASL_README.html
postfix/proto/TLS_README.html
postfix/proto/memcache_table
postfix/src/global/mail_version.h
postfix/src/postscreen/postscreen.h
postfix/src/postscreen/postscreen_smtpd.c
postfix/src/postscreen/postscreen_state.c
postfix/src/qmqpd/qmqpd.c
postfix/src/smtpd/smtpd_check.c

index abae11caec7a1c3d406c2ef4dd6bc2fc0036d5b8..485b4298f83245150c338f7c1bafd16150362546 100644 (file)
@@ -18079,3 +18079,44 @@ Apologies for any names omitted.
        Bugfix: smtpd_relay_restrictions compatibility shim did not
        detect "empty" value.  Sahil Tandon. The same problem existed
        with the inet_protocols shim. File: conf/post-install.
+
+20121105
+
+       Cleanup: the postscreen(8) "deep protocol" tests now log
+       the SMTP command that precedes a protocol violation.  Files:
+       postscreen/postscreen_smtpd.c, proto/POSTSCREEN_README.html.
+
+       Bugfix (introduced: Postfix 1.1): wrong string termination
+       when handling a MBOX From_ line at the start of a message.
+       File: qmqpd/qmqpd.c.
+
+20121110
+
+       Cleanup: specify $(WARN) on the MacOS X compiler command
+       line to suppress "nested comment" and possibly other unwanted
+       warnings. Problem reported by Jim Reid. File: makedefs,
+       Makefile.in.
+
+20121119
+
+       Documentation: added a note that key_format is required
+       when postscreen(8) and verify(8) share the same memcache
+       (with different persistent backup databases, or course)
+       otherwise automatic cache cleanup breaks due to a name
+       collision for the "last cache cleanup" database record.
+       File: proto/memcache.
+
+20121122
+
+       Cleanup: the safety-check for smtpd_recipient_restrictions
+       and smtpd_relay_restrictions now detects permit before
+       reject.  File: smtpd/smtpd_check.c.
+
+       Cleanup: the safety-check for smtpd_recipient_restrictions
+       and smtpd_relay_restrictions is no longer case-sensitive.
+       File: smtpd/smtpd_check.c.
+
+20121123
+
+       Cleanup: consistent escaping of commands in postscreen deep
+       protocol test logging. File: postscreen/postscreen_smtpd.c.
index e45ba73a01f90b4cdbcf47ab23653663442088a7..a16c89fdfc6ed7746ad0e535ff16d3bc51ff22cb 100644 (file)
@@ -1,5 +1,5 @@
 SHELL  = /bin/sh
-WARN    = -Wmissing-prototypes -Wformat
+WARN    = -Wmissing-prototypes -Wformat -Wno-comment
 OPTS   = 'CC=$(CC)'
 DIRS   = src/util src/global src/dns src/tls src/xsasl src/milter src/master \
        src/postfix src/fsstone src/smtpstone \
index 4a1d66498523b99c096482a2d8bab8bf4c879d52..6c59a5d143b9192a435e9463c1ed214bb445b0c0 100644 (file)
@@ -18,17 +18,17 @@ by allowing whitelisted clients to skip tests, postscreen(8) minimizes its
 impact on legitimate email traffic.
 
 postscreen(8) should not be used on SMTP ports that receive mail from end-user
-clients (MUAs). In a typical deployment, postscreen(8) is used on the "port 25"
-service, while MUA clients submit mail via the submission service (port 587)
-which normally requires client authentication, or via a "port 25" server that
-provides no MX service (i.e. a dedicated server that provides submission
-service on port 25).
+clients (MUAs). In a typical deployment, postscreen(8) handles the MX service
+on TCP port 25, while MUA clients submit mail via the submission service on TCP
+port 587 which requires client authentication. Alternatively, a site could set
+up a dedicated, non-postscreen, "port 25" server that provides submission
+service and client authentication, but no MX service.
 
 postscreen(8) is part of a multi-layer defense.
 
   * As the first layer, postscreen(8) blocks connections from zombies and other
     spambots that are responsible for about 90% of all spam. It is implemented
-    as a single process to make this defense as cheap as possible.
+    as a single process to make this defense as inexpensive as possible.
 
   * The second layer implements more complex SMTP-level access checks with
     Postfix SMTP servers, policy daemons, and Milter applications.
@@ -415,11 +415,12 @@ in SMTP engine anyway. This is to make postscreen(8) logging more informative.
 
 When a client sends non-SMTP commands, postscreen(8) logs this as:
 
-    N\bNO\bON\bN-\b-S\bSM\bMT\bTP\bP C\bCO\bOM\bMM\bMA\bAN\bND\bD f\bfr\bro\bom\bm [address]:port command
+    N\bNO\bON\bN-\b-S\bSM\bMT\bTP\bP C\bCO\bOM\bMM\bMA\bAN\bND\bD f\bfr\bro\bom\bm [address]:port a\baf\bft\bte\ber\br command: text
 
 Translation: the SMTP client at [address]:port sent a command that matches the
 postscreen_forbidden_commands parameter, or that has the syntax of a message
-header label.
+header label (text followed by optional space and ":"). The "a\baf\bft\bte\ber\br command"
+portion is logged with Postfix 2.10 and later.
 
 The postscreen_non_smtp_command_action parameter specifies the action that is
 taken next. See "When tests fail after the 220 SMTP server greeting" below.
@@ -439,10 +440,11 @@ in SMTP engine anyway. This is to make postscreen(8) logging more informative.
 
 When a client sends bare newline characters, postscreen(8) logs this as:
 
-    B\bBA\bAR\bRE\bE N\bNE\bEW\bWL\bLI\bIN\bNE\bE f\bfr\bro\bom\bm [address]:port
+    B\bBA\bAR\bRE\bE N\bNE\bEW\bWL\bLI\bIN\bNE\bE f\bfr\bro\bom\bm [address]:port a\baf\bft\bte\ber\br command
 
 Translation: the SMTP client at [address]:port sent a bare newline character,
-that is newline not preceded by carriage return.
+that is newline not preceded by carriage return. The "a\baf\bft\bte\ber\br command" portion is
+logged with Postfix 2.10 and later.
 
 The postscreen_bare_newline_action parameter specifies the action that is taken
 next. See "When tests fail after the 220 SMTP server greeting" below.
@@ -484,23 +486,26 @@ The following errors are reported by the built-in SMTP engine. This engine
 never accepts mail, therefore it has per-session limits on the number of
 commands and on the session length.
 
-    C\bCO\bOM\bMM\bMA\bAN\bND\bD T\bTI\bIM\bME\bE L\bLI\bIM\bMI\bIT\bT f\bfr\bro\bom\bm [address]:port
+    C\bCO\bOM\bMM\bMA\bAN\bND\bD T\bTI\bIM\bME\bE L\bLI\bIM\bMI\bIT\bT f\bfr\bro\bom\bm [address]:port a\baf\bft\bte\ber\br command
 
 Translation: the SMTP client at [address]:port reached the per-command time
 limit as specified with the postscreen_command_time_limit parameter. The
-session is terminated immediately.
+session is terminated immediately. The "a\baf\bft\bte\ber\br command" portion is logged with
+Postfix 2.10 and later.
 
-    C\bCO\bOM\bMM\bMA\bAN\bND\bD C\bCO\bOU\bUN\bNT\bT L\bLI\bIM\bMI\bIT\bT f\bfr\bro\bom\bm [address]:port
+    C\bCO\bOM\bMM\bMA\bAN\bND\bD C\bCO\bOU\bUN\bNT\bT L\bLI\bIM\bMI\bIT\bT f\bfr\bro\bom\bm [address]:port a\baf\bft\bte\ber\br command
 
 Translation: the SMTP client at [address]:port reached the per-session command
 count limit as specified with the postscreen_command_count_limit parameter. The
-session is terminated immediately.
+session is terminated immediately. The "a\baf\bft\bte\ber\br command" portion is logged with
+Postfix 2.10 and later.
 
-    C\bCO\bOM\bMM\bMA\bAN\bND\bD L\bLE\bEN\bNG\bGT\bTH\bH L\bLI\bIM\bMI\bIT\bT f\bfr\bro\bom\bm [address]:port
+    C\bCO\bOM\bMM\bMA\bAN\bND\bD L\bLE\bEN\bNG\bGT\bTH\bH L\bLI\bIM\bMI\bIT\bT f\bfr\bro\bom\bm [address]:port a\baf\bft\bte\ber\br command
 
 Translation: the SMTP client at [address]:port reached the per-command length
 limit, as specified with the line_length_limit parameter. The session is
-terminated immediately.
+terminated immediately. The "a\baf\bft\bte\ber\br command" portion is logged with Postfix 2.10
+and later.
 
 When an SMTP client makes too many connections at the same time, or when all
 postscreen(8) ports are busy, postscreen(8) rejects the connection with a 421
index 5d8bbaa6beab6e47ff8d45a3f3ca7f6dc692820f..c35481991adcd142ef711198234eede25735ec80 100644 (file)
@@ -55,7 +55,8 @@ different steps:
     addresses the client may use.
 
 Successful authentication in the Postfix SMTP server requires a functional SASL
-framework. Configuring SASL should therefore always be the first step.
+framework. Configuring SASL should therefore always be the first step, before
+configuring Postfix.
 
 You can read more about the following topics:
 
index c716989eac841ec04436fe279c49c784ef3c1872..4694f931f17f683335b642c4f5689c1487b5b978 100644 (file)
@@ -147,7 +147,7 @@ Their DSA counterparts:
         smtpd_tls_dcert_file = /etc/postfix/server-dsa.pem
         smtpd_tls_dkey_file = $smtpd_tls_dcert_file
 
-Their ECDSA counterparts (Postfix >= 2.6 + OpenSSL >= 0.9.9):
+Their ECDSA counterparts (Postfix >= 2.6 + OpenSSL >= 1.0.0):
 
     /etc/postfix/main.cf:
         # Most clients will not be ECDSA capable, so you will likely also need
@@ -540,7 +540,7 @@ To generate your own set of DH parameters, use:
     % o\bop\bpe\ben\bns\bss\bsl\bl g\bge\ben\bnd\bdh\bh -\b-o\bou\but\bt /\b/e\bet\btc\bc/\b/p\bpo\bos\bst\btf\bfi\bix\bx/\b/d\bdh\bh_\b_1\b10\b02\b24\b4.\b.p\bpe\bem\bm -\b-2\b2 1\b10\b02\b24\b4
 
 Support for elliptic curve cryptography is available with Postfix 2.6 and
-OpenSSL 0.9.9 or later. To enable ephemeral elliptic curve Diffie-Hellman
+OpenSSL 1.0.0 or later. To enable ephemeral elliptic curve Diffie-Hellman
 (EECDH) key-exchange, set "smtpd_tls_eecdh_grade = strong" or
 "smtpd_tls_eecdh_grade = ultra". The "ultra" setting is substantially more CPU
 intensive, and "strong" is sufficiently secure for most situations.
@@ -1085,7 +1085,7 @@ Their DSA counterparts:
         smtp_tls_dcert_file = /etc/postfix/client-dsa.pem
         smtp_tls_dkey_file = $smtp_tls_dcert_file
 
-Their ECDSA counterparts (Postfix >= 2.6 + OpenSSL >= 0.9.9):
+Their ECDSA counterparts (Postfix >= 2.6 + OpenSSL >= 1.0.0):
 
     /etc/postfix/main.cf:
         smtp_tls_eccert_file = /etc/postfix/client-ecdsa.pem
index 117af91e99d896e1308c6910032573dd85603e68..dfb95f1f216ad6b2f1fe28899c87c6b242be520e 100644 (file)
@@ -14,6 +14,20 @@ specifies the release date of a stable release or snapshot release.
 If you upgrade from Postfix 2.8 or earlier, read RELEASE_NOTES-2.9
 before proceeding.
 
+Incompatible changes with snapshot 20121123
+===========================================
+
+The postscreen deep protocol tests now log the last command before
+a protocol error ("UNIMPLEMENTED" when the last command is not
+implemented, "CONNECT" when there was no prior command). The
+changed logfile messages are:
+
+NON-SMTP COMMAND from [address]:port after command: text
+BARE NEWLINE from [address]:port after command
+COMMAND TIME LIMIT from [address]:port after command
+COMMAND COUNT LIMIT from [address]:port after command
+COMMAND LENGTH LIMIT from [address]:port after command
+
 Incompatible changes with snapshot 20121007
 ===========================================
 
index 8a53994128470528446dc601b568931691f3caaa..b9dd0be81f618a747b4415e120bb91574f0a2056 100644 (file)
@@ -11,6 +11,10 @@ Wish list:
        Don't forget Apple's code donation for fetching mail from
        IMAP server.
 
+       smtpd_muble_restrictions rule names are case-insensitive.
+       restriction_classes values are case-sensitive but should
+       be case-insensitive for consistency with smtpd_muble_restrictions.
+
        Make "rename" the default when postmapping a DB file
        (later: use copy+rename for postmap -i, postmap -d).
 
index f2ded3c7c975cc09eef997eaa891ddd2faa6b4a1..ba47369e93bc0dfefc8705cfdebc9217612ea415 100644 (file)
@@ -35,11 +35,11 @@ pass its tests; by allowing whitelisted clients to skip tests,
 
 <p> <a href="postscreen.8.html">postscreen(8)</a> should not be used on SMTP ports that receive
 mail from end-user clients (MUAs). In a typical deployment,
-<a href="postscreen.8.html">postscreen(8)</a> is used on the "port 25" service, while MUA clients
-submit mail via the submission service (port 587) which normally
-requires client authentication, or via a "port 25" server that
-provides no MX service (i.e. a dedicated server that provides
-submission service on port 25). </p>
+<a href="postscreen.8.html">postscreen(8)</a> handles the MX service on TCP port 25, while MUA
+clients submit mail via the submission service on TCP port 587 which
+requires client authentication. Alternatively, a site could set up
+a dedicated, non-postscreen, "port 25" server that provides submission
+service and client authentication, but no MX service.  </p>
 
 <p> <a href="postscreen.8.html">postscreen(8)</a> is part of a multi-layer defense. <p>
 
@@ -48,11 +48,12 @@ submission service on port 25). </p>
 <li> <p> As the first layer, <a href="postscreen.8.html">postscreen(8)</a> blocks connections from
 zombies and other spambots that are responsible for about 90% of
 all spam.  It is implemented as a single process to make this defense
-as cheap as possible. </p>
+as inexpensive as possible. </p>
 
 <li> <p> The second layer implements more complex SMTP-level access
-checks with Postfix SMTP servers, policy daemons, and Milter
-applications. </p>
+checks with <a href="SMTPD_ACCESS_README.html">Postfix SMTP servers</a>, 
+<a href="SMTPD_POLICY_README.html">policy daemons</a>, and 
+<a href="MILTER_README.html">Milter applications</a>. </p>
 
 <li> <p> The third layer performs light-weight content inspection
 with the Postfix built-in <a href="postconf.5.html#header_checks">header_checks</a> and <a href="postconf.5.html#body_checks">body_checks</a>. This can
@@ -60,8 +61,10 @@ block unacceptable attachments such as executable programs, and
 worms or viruses with easy-to-recognize signatures. </p>
 
 <li> <p> The fourth layer provides heavy-weight content inspection
-with external content filters. Typical examples are Amavisd-new,
-SpamAssassin, and Milter applications. </p>
+with external content filters. Typical examples are <a
+href="http://www.ijs.si/software/amavisd/">Amavisd-new</a>, <a
+href="http://spamassassin.apache.org/">SpamAssassin</a>, and <a
+href="MILTER_README.html">Milter applications</a>. </p>
 
 </ul>
 
@@ -562,12 +565,15 @@ logging more informative.  </p>
 as: </p>
 
 <pre>
-    <b>NON-SMTP COMMAND from</b> <i>[address]:port command</i>
+    <b>NON-SMTP COMMAND from</b> <i>[address]:port</i> <b>after</b> <i>command: text</i>
 </pre>
 
 <p> Translation: the SMTP client at <i>[address]:port</i> sent a
-<i>command</i> that matches the <a href="postconf.5.html#postscreen_forbidden_commands">postscreen_forbidden_commands</a>
-parameter, or that has the syntax of a message header label. </p>
+command that matches the <a href="postconf.5.html#postscreen_forbidden_commands">postscreen_forbidden_commands</a>
+parameter, or that has the syntax of a message header label (text 
+followed by optional space and ":").
+The "<tt><b>after</b> <i>command</i></tt>" portion is logged with
+Postfix 2.10 and later. </p>
 
 <p> The <a href="postconf.5.html#postscreen_non_smtp_command_action">postscreen_non_smtp_command_action</a> parameter specifies
 the action that is taken next.  See "<a href="#fail_after_220">When
@@ -594,12 +600,14 @@ this as:
 </p>
 
 <pre>
-    <b>BARE NEWLINE from</b> <i>[address]:port</i>
+    <b>BARE NEWLINE from</b> <i>[address]:port</i> <b>after</b> <i>command</i>
 </pre>
 
 <p> Translation: the SMTP client at <i>[address]:port</i> sent a bare
 newline character, that is newline not preceded by carriage
-return. </p>
+return.
+The "<tt><b>after</b> <i>command</i></tt>" portion is logged with
+Postfix 2.10 and later. </p>
 
 <p> The <a href="postconf.5.html#postscreen_bare_newline_action">postscreen_bare_newline_action</a> parameter specifies the
 action that is taken next.  See "<a href="#fail_after_220">When
@@ -676,29 +684,35 @@ This engine never accepts mail, therefore it has per-session limits
 on the number of commands and on the session length. </p>
 
 <pre>
-    <b>COMMAND TIME LIMIT</b> <b>from</b> <i>[address]:port</i>
+    <b>COMMAND TIME LIMIT</b> <b>from</b> <i>[address]:port</i> <b>after</b> <i>command</i>
 </pre>
 
 <p> Translation: the SMTP client at <i>[address]:port</i> reached the
 per-command time limit as specified with the <a href="postconf.5.html#postscreen_command_time_limit">postscreen_command_time_limit</a>
-parameter.  The session is terminated immediately. </p>
+parameter.  The session is terminated immediately.
+The "<tt><b>after</b> <i>command</i></tt>" portion is logged with
+Postfix 2.10 and later. </p>
 
 <pre>
-    <b>COMMAND COUNT LIMIT from</b> <i>[address]:port</i>
+    <b>COMMAND COUNT LIMIT from</b> <i>[address]:port</i> <b>after</b> <i>command</i>
 </pre>
 
 <p> Translation: the SMTP client at <i>[address]:port</i> reached the
 per-session command count limit as specified with the
 <a href="postconf.5.html#postscreen_command_count_limit">postscreen_command_count_limit</a> parameter.  The session is terminated
-immediately. </p>
+immediately.
+The "<tt><b>after</b> <i>command</i></tt>" portion is logged with
+Postfix 2.10 and later. </p>
 
 <pre>
-    <b>COMMAND LENGTH LIMIT from</b> <i>[address]:port</i>
+    <b>COMMAND LENGTH LIMIT from</b> <i>[address]:port</i> <b>after</b> <i>command</i>
 </pre>
 
 <p> Translation: the SMTP client at <i>[address]:port</i> reached the
 per-command length limit, as specified with the <a href="postconf.5.html#line_length_limit">line_length_limit</a>
-parameter.  The session is terminated immediately. </p>
+parameter.  The session is terminated immediately.
+The "<tt><b>after</b> <i>command</i></tt>" portion is logged with
+Postfix 2.10 and later. </p>
 
 <p> When an SMTP client makes too many connections at the same time,
 or when all <a href="postscreen.8.html">postscreen(8)</a> ports are busy, <a href="postscreen.8.html">postscreen(8)</a> rejects the
index 18ed0cf013a014f23db5fec5462ce7af6c4455e6..f39feefcd7803b2a02c8e6fa14990018befdcf13 100644 (file)
@@ -87,7 +87,7 @@ what envelope sender addresses the client may use. </p> </li>
 
 <p> Successful authentication in the Postfix SMTP server requires
 a functional SASL framework. Configuring SASL should therefore
-always be the first step. </p>
+always be the first step, before configuring Postfix. </p>
 
 <p> You can read more about the following topics: </p>
 
index 8459dc3180b25f9e551fd54ce0479947a2a2750e..cea177f4a320d593ace631e36beda49c663c76f8 100644 (file)
@@ -245,7 +245,7 @@ $<a href="postconf.5.html#smtpd_tls_CAfile">smtpd_tls_CAfile</a> or install it i
 </pre>  
 </blockquote>
 
-<p> Their ECDSA counterparts (Postfix &ge; 2.6 + OpenSSL &ge; 0.9.9): </p>
+<p> Their ECDSA counterparts (Postfix &ge; 2.6 + OpenSSL &ge; 1.0.0): </p>
 
 <blockquote>
 <pre>
@@ -773,7 +773,7 @@ settings. </p>
 </blockquote>
 
 <p> Support for elliptic curve cryptography is available with Postfix
-2.6 and OpenSSL 0.9.9 or later.  To enable ephemeral elliptic curve
+2.6 and OpenSSL 1.0.0 or later.  To enable ephemeral elliptic curve
 Diffie-Hellman (EECDH) key-exchange, set "<a href="postconf.5.html#smtpd_tls_eecdh_grade">smtpd_tls_eecdh_grade</a> =
 strong" or "<a href="postconf.5.html#smtpd_tls_eecdh_grade">smtpd_tls_eecdh_grade</a> = ultra". The "ultra" setting is
 substantially more CPU intensive, and "strong" is sufficiently
@@ -1474,7 +1474,7 @@ $<a href="postconf.5.html#smtp_tls_CAfile">smtp_tls_CAfile</a> or install it in
 </pre>  
 </blockquote>
 
-<p> Their ECDSA counterparts (Postfix &ge; 2.6 + OpenSSL &ge; 0.9.9): </p>
+<p> Their ECDSA counterparts (Postfix &ge; 2.6 + OpenSSL &ge; 1.0.0): </p>
 
 <blockquote>
 <pre>
index 36af14727550f2bf5866d1dcaca5894d96de05e0..ce087b74f8a5dc465541440e339902480684c6f9 100644 (file)
@@ -69,57 +69,68 @@ MEMCACHE_TABLE(5)                                            MEMCACHE_TABLE(5)
               Access to remote proxymap servers is under develop-
               ment.
 
-              NOTE  1: When using memcache with persistent backup
-              as <a href="postscreen.8.html"><b>postscreen</b>(8)</a> or <a href="verify.8.html"><b>verify</b>(8)</a> cache, disable  auto-
-              matic  cache cleanup (*_cache_cleanup_interval = 0)
-              in all Postfix instances except  for  one  instance
-              that will be responsible for cache cleanup.
-
-              NOTE  2:  In the case of a proxied backup database,
-              the  full  backup  database  name  (including   the
-              "<a href="proxymap.8.html">proxy</a>:"  prefix) must be specified in the proxymap
-              server's <a href="postconf.5.html#proxy_read_maps">proxy_read_maps</a> or  <a href="postconf.5.html#proxy_write_maps">proxy_write_maps</a>  set-
-              ting  (depending on whether the access is read-only
-              or read-write).
+              NOTE  1: When sharing a persistent <a href="postscreen.8.html"><b>postscreen</b>(8)</a> or
+              <a href="verify.8.html"><b>verify</b>(8)</a> cache, disable  automatic  cache  cleanup
+              (set  *_cache_cleanup_interval = 0) except with one
+              Postfix instance that will be responsible for cache
+              cleanup.
+
+              NOTE  2:  When different tables share the same mem-
+              cache database, each table should use the  <b>key_for-</b>
+              <b>mat</b>  feature  (see below) to prepend its own unique
+              string to the  lookup  key.   Otherwise,  automatic
+              <a href="postscreen.8.html"><b>postscreen</b>(8)</a>  or  <a href="verify.8.html"><b>verify</b>(8)</a>  cache cleanup may not
+              work.
+
+              NOTE 3: When the backup database is  accessed  with
+              "<a href="proxymap.8.html">proxy</a>:"  lookups,  the  full  backup database name
+              (including the "<a href="proxymap.8.html">proxy</a>:" prefix) must  be  specified
+              in   the   proxymap   server's  <a href="postconf.5.html#proxy_read_maps">proxy_read_maps</a>  or
+              <a href="postconf.5.html#proxy_write_maps">proxy_write_maps</a> setting (depending on whether  the
+              access is read-only or read-write).
 
        <b>flags (default: 0)</b>
-              Optional flags that should be stored along  with  a
+              Optional  flags  that should be stored along with a
               memcache update. The flags are ignored when looking
               up information.
 
        <b>ttl (default: 3600)</b>
               The expiration time in seconds of memcache updates.
 
-              NOTE   1:   When   using   a   memcache   table  as
+              NOTE  1:   When   using   a   memcache   table   as
               <a href="postscreen.8.html"><b>postscreen</b>(8)</a> or <a href="verify.8.html"><b>verify</b>(8)</a> cache without persistent
               backup,  specify  a  zero  *_cache_cleanup_interval
-              value with all Postfix instances that use the  mem-
-              cache,  and specify the largest <a href="postscreen.8.html"><b>postscreen</b>(8)</a> *_ttl
-              value or <a href="verify.8.html"><b>verify</b>(8)</a> *_expire_time value as the  mem-
+              value  with all Postfix instances that use the mem-
+              cache, and specify the largest <a href="postscreen.8.html"><b>postscreen</b>(8)</a>  *_ttl
+              value  or <a href="verify.8.html"><b>verify</b>(8)</a> *_expire_time value as the mem-
               cache table's <b>ttl</b> value.
 
-              NOTE  2:  According to memcache protocol documenta-
-              tion, a value greater than 30  days  (2592000  sec-
-              onds)  specifies absolute UNIX time. Smaller values
+              NOTE 2: According to memcache  protocol  documenta-
+              tion,  a  value  greater than 30 days (2592000 sec-
+              onds) specifies absolute UNIX time. Smaller  values
               are relative to the time of the update.
 
 <b>MEMCACHE KEY PARAMETERS</b>
        <b>key_format (default: %s)</b>
-              Format of the lookup and update  keys  in  memcache
-              requests.   By  default,  these are the same as the
-              lookup and update keys that are given to the  Post-
+              Format  of  the  lookup and update keys in memcache
+              requests.  By default, these are the  same  as  the
+              lookup  and update keys that are given to the Post-
               fix memcache client.
 
-              NOTE: The <b>key_format</b> feature is not used for <b>backup</b>
-              database requests.
+              NOTE 1: The <b>key_format</b>  feature  is  not  used  for
+              <b>backup</b> database requests.
 
-              When the same memcache database is  used  to  cache
-              information  from  multiple tables, you can use the
-              <b>key_format</b> feature  to  avoid  name  collisions  by
-              prepending a fixed string.  Examples:
+              NOTE  2:  When different tables share the same mem-
+              cache database, each table should prepend  its  own
+              unique  string to the lookup key.  Otherwise, auto-
+              matic <a href="postscreen.8.html"><b>postscreen</b>(8)</a> or <a href="verify.8.html"><b>verify</b>(8)</a> cache cleanup  may
+              not work.
+
+              Examples:
 
                   key_format = aliases:%s
-                  key_format = access:%s
+                  key_format = verify:%s
+                  key_format = postscreen:%s
 
               The <b>key_format</b> parameter supports the following '%'
               expansions:
index 050c878783d2468732140f4164a803688c92900a..f0151f35d13790924945e00b668e665351193860 100644 (file)
@@ -454,6 +454,7 @@ ReliantUNIX-?.5.43) SYSTYPE=ReliantUnix543
     Darwin.*)   SYSTYPE=MACOSX
                # Use the native compiler by default
                : ${CC=cc}
+               CCARGS="$CCARGS \$(WARN)"
                # Darwin > 1.3 uses awk and flat_namespace
                case $RELEASE in
                 1.[0-3]) AWK=gawk;;
index 692cc8d3426a89d71b662cc662e49d7c18e9b7e2..9809420e38f4c8e38e390cd9eee93068db44d732 100644 (file)
@@ -74,18 +74,22 @@ information in the persistent database. Specify a Postfix
 
 Access to remote proxymap servers is under development.
 
-NOTE 1: When using memcache with persistent backup as
-\fBpostscreen\fR(8) or \fBverify\fR(8) cache, disable
-automatic cache cleanup (*_cache_cleanup_interval = 0) in
-all Postfix instances except for one instance that will be
-responsible for cache cleanup.
-
-NOTE 2: In the case of a proxied backup database, the full
-backup database
-name (including the "proxy:" prefix) must be specified in
-the proxymap server's proxy_read_maps or proxy_write_maps
-setting (depending on whether the access is read-only or
-read-write).
+NOTE 1: When sharing a persistent \fBpostscreen\fR(8) or
+\fBverify\fR(8) cache, disable automatic cache cleanup (set
+*_cache_cleanup_interval = 0) except with one Postfix
+instance that will be responsible for cache cleanup.
+
+NOTE 2: When different tables share the same memcache
+database, each table should use the \fBkey_format\fR feature
+(see below) to prepend its own unique string to the lookup
+key.  Otherwise, automatic \fBpostscreen\fR(8) or \fBverify\fR(8)
+cache cleanup may not work.
+
+NOTE 3: When the backup database is accessed with "proxy:"
+lookups, the full backup database name (including the
+"proxy:" prefix) must be specified in the proxymap server's
+proxy_read_maps or proxy_write_maps setting (depending on
+whether the access is read-only or read-write).
 .IP "\fBflags (default: 0)\fR"
 Optional flags that should be stored along with a memcache
 update. The flags are ignored when looking up information.
@@ -113,17 +117,20 @@ Format of the lookup and update keys in memcache requests.
 By default, these are the same as the lookup and update
 keys that are given to the Postfix memcache client.
 
-NOTE: The \fBkey_format\fR feature is not used for \fBbackup\fR
+NOTE 1: The \fBkey_format\fR feature is not used for \fBbackup\fR
 database requests.
 
-When the same memcache database is used to cache information
-from multiple tables, you can use the \fBkey_format\fR
-feature to avoid name collisions by prepending a fixed
-string.  Examples:
+NOTE 2: When different tables share the same memcache
+database, each table should prepend its own unique string
+to the lookup key.  Otherwise, automatic \fBpostscreen\fR(8)
+or \fBverify\fR(8) cache cleanup may not work.
+
+Examples:
 
 .nf
     key_format = aliases:%s
-    key_format = access:%s
+    key_format = verify:%s
+    key_format = postscreen:%s
 .fi
 
 The \fBkey_format\fR parameter supports the following '%'
index fb10721afd9ac9cf4643f57ed18da8f661ed8c78..c7a4f020e73027eade595f906b91a26b3c5dc6fb 100644 (file)
@@ -35,11 +35,11 @@ postscreen(8) minimizes its impact on legitimate email traffic.
 
 <p> postscreen(8) should not be used on SMTP ports that receive
 mail from end-user clients (MUAs). In a typical deployment,
-postscreen(8) is used on the "port 25" service, while MUA clients
-submit mail via the submission service (port 587) which normally
-requires client authentication, or via a "port 25" server that
-provides no MX service (i.e. a dedicated server that provides
-submission service on port 25). </p>
+postscreen(8) handles the MX service on TCP port 25, while MUA
+clients submit mail via the submission service on TCP port 587 which
+requires client authentication. Alternatively, a site could set up
+a dedicated, non-postscreen, "port 25" server that provides submission
+service and client authentication, but no MX service.  </p>
 
 <p> postscreen(8) is part of a multi-layer defense. <p>
 
@@ -48,11 +48,12 @@ submission service on port 25). </p>
 <li> <p> As the first layer, postscreen(8) blocks connections from
 zombies and other spambots that are responsible for about 90% of
 all spam.  It is implemented as a single process to make this defense
-as cheap as possible. </p>
+as inexpensive as possible. </p>
 
 <li> <p> The second layer implements more complex SMTP-level access
-checks with Postfix SMTP servers, policy daemons, and Milter
-applications. </p>
+checks with <a href="SMTPD_ACCESS_README.html">Postfix SMTP servers</a>, 
+<a href="SMTPD_POLICY_README.html">policy daemons</a>, and 
+<a href="MILTER_README.html">Milter applications</a>. </p>
 
 <li> <p> The third layer performs light-weight content inspection
 with the Postfix built-in header_checks and body_checks. This can
@@ -60,8 +61,10 @@ block unacceptable attachments such as executable programs, and
 worms or viruses with easy-to-recognize signatures. </p>
 
 <li> <p> The fourth layer provides heavy-weight content inspection
-with external content filters. Typical examples are Amavisd-new,
-SpamAssassin, and Milter applications. </p>
+with external content filters. Typical examples are <a
+href="http://www.ijs.si/software/amavisd/">Amavisd-new</a>, <a
+href="http://spamassassin.apache.org/">SpamAssassin</a>, and <a
+href="MILTER_README.html">Milter applications</a>. </p>
 
 </ul>
 
@@ -562,12 +565,15 @@ logging more informative.  </p>
 as: </p>
 
 <pre>
-    <b>NON-SMTP COMMAND from</b> <i>[address]:port command</i>
+    <b>NON-SMTP COMMAND from</b> <i>[address]:port</i> <b>after</b> <i>command: text</i>
 </pre>
 
 <p> Translation: the SMTP client at <i>[address]:port</i> sent a
-<i>command</i> that matches the postscreen_forbidden_commands
-parameter, or that has the syntax of a message header label. </p>
+command that matches the postscreen_forbidden_commands
+parameter, or that has the syntax of a message header label (text 
+followed by optional space and ":").
+The "<tt><b>after</b> <i>command</i></tt>" portion is logged with
+Postfix 2.10 and later. </p>
 
 <p> The postscreen_non_smtp_command_action parameter specifies
 the action that is taken next.  See "<a href="#fail_after_220">When
@@ -594,12 +600,14 @@ this as:
 </p>
 
 <pre>
-    <b>BARE NEWLINE from</b> <i>[address]:port</i>
+    <b>BARE NEWLINE from</b> <i>[address]:port</i> <b>after</b> <i>command</i>
 </pre>
 
 <p> Translation: the SMTP client at <i>[address]:port</i> sent a bare
 newline character, that is newline not preceded by carriage
-return. </p>
+return.
+The "<tt><b>after</b> <i>command</i></tt>" portion is logged with
+Postfix 2.10 and later. </p>
 
 <p> The postscreen_bare_newline_action parameter specifies the
 action that is taken next.  See "<a href="#fail_after_220">When
@@ -676,29 +684,35 @@ This engine never accepts mail, therefore it has per-session limits
 on the number of commands and on the session length. </p>
 
 <pre>
-    <b>COMMAND TIME LIMIT</b> <b>from</b> <i>[address]:port</i>
+    <b>COMMAND TIME LIMIT</b> <b>from</b> <i>[address]:port</i> <b>after</b> <i>command</i>
 </pre>
 
 <p> Translation: the SMTP client at <i>[address]:port</i> reached the
 per-command time limit as specified with the postscreen_command_time_limit
-parameter.  The session is terminated immediately. </p>
+parameter.  The session is terminated immediately.
+The "<tt><b>after</b> <i>command</i></tt>" portion is logged with
+Postfix 2.10 and later. </p>
 
 <pre>
-    <b>COMMAND COUNT LIMIT from</b> <i>[address]:port</i>
+    <b>COMMAND COUNT LIMIT from</b> <i>[address]:port</i> <b>after</b> <i>command</i>
 </pre>
 
 <p> Translation: the SMTP client at <i>[address]:port</i> reached the
 per-session command count limit as specified with the
 postscreen_command_count_limit parameter.  The session is terminated
-immediately. </p>
+immediately.
+The "<tt><b>after</b> <i>command</i></tt>" portion is logged with
+Postfix 2.10 and later. </p>
 
 <pre>
-    <b>COMMAND LENGTH LIMIT from</b> <i>[address]:port</i>
+    <b>COMMAND LENGTH LIMIT from</b> <i>[address]:port</i> <b>after</b> <i>command</i>
 </pre>
 
 <p> Translation: the SMTP client at <i>[address]:port</i> reached the
 per-command length limit, as specified with the line_length_limit
-parameter.  The session is terminated immediately. </p>
+parameter.  The session is terminated immediately.
+The "<tt><b>after</b> <i>command</i></tt>" portion is logged with
+Postfix 2.10 and later. </p>
 
 <p> When an SMTP client makes too many connections at the same time,
 or when all postscreen(8) ports are busy, postscreen(8) rejects the
index 1581b5efbd703bfaeea63f64422bc64850282aba..1146a36a1a0011a4d576813afbb3e72f15fdcd96 100644 (file)
@@ -87,7 +87,7 @@ what envelope sender addresses the client may use. </p> </li>
 
 <p> Successful authentication in the Postfix SMTP server requires
 a functional SASL framework. Configuring SASL should therefore
-always be the first step. </p>
+always be the first step, before configuring Postfix. </p>
 
 <p> You can read more about the following topics: </p>
 
index 960f7d299261ab0a05c7dec517d58caa29abf465..f0b2f94f51c4d171c5097d016fdf6f552e787b91 100644 (file)
@@ -245,7 +245,7 @@ $smtpd_tls_CAfile or install it in the $smtpd_tls_CApath directory. </p>
 </pre>  
 </blockquote>
 
-<p> Their ECDSA counterparts (Postfix &ge; 2.6 + OpenSSL &ge; 0.9.9): </p>
+<p> Their ECDSA counterparts (Postfix &ge; 2.6 + OpenSSL &ge; 1.0.0): </p>
 
 <blockquote>
 <pre>
@@ -773,7 +773,7 @@ settings. </p>
 </blockquote>
 
 <p> Support for elliptic curve cryptography is available with Postfix
-2.6 and OpenSSL 0.9.9 or later.  To enable ephemeral elliptic curve
+2.6 and OpenSSL 1.0.0 or later.  To enable ephemeral elliptic curve
 Diffie-Hellman (EECDH) key-exchange, set "smtpd_tls_eecdh_grade =
 strong" or "smtpd_tls_eecdh_grade = ultra". The "ultra" setting is
 substantially more CPU intensive, and "strong" is sufficiently
@@ -1474,7 +1474,7 @@ $smtp_tls_CAfile or install it in the $smtp_tls_CApath directory. </p>
 </pre>  
 </blockquote>
 
-<p> Their ECDSA counterparts (Postfix &ge; 2.6 + OpenSSL &ge; 0.9.9): </p>
+<p> Their ECDSA counterparts (Postfix &ge; 2.6 + OpenSSL &ge; 1.0.0): </p>
 
 <blockquote>
 <pre>
index c065e65da9f43d2f4124dcafdec59885b5ca726e..de9e2fd91195afd3b1b8b1cb752c0f3cff3ece98 100644 (file)
 #
 #      Access to remote proxymap servers is under development.
 #
-#      NOTE 1: When using memcache with persistent backup as
-#      \fBpostscreen\fR(8) or \fBverify\fR(8) cache, disable
-#      automatic cache cleanup (*_cache_cleanup_interval = 0) in
-#      all Postfix instances except for one instance that will be
-#      responsible for cache cleanup.
-#
-#      NOTE 2: In the case of a proxied backup database, the full
-#      backup database
-#      name (including the "proxy:" prefix) must be specified in
-#      the proxymap server's proxy_read_maps or proxy_write_maps
-#      setting (depending on whether the access is read-only or
-#      read-write).
+#      NOTE 1: When sharing a persistent \fBpostscreen\fR(8) or
+#      \fBverify\fR(8) cache, disable automatic cache cleanup (set
+#      *_cache_cleanup_interval = 0) except with one Postfix
+#      instance that will be responsible for cache cleanup.
+#
+#      NOTE 2: When different tables share the same memcache
+#      database, each table should use the \fBkey_format\fR feature
+#      (see below) to prepend its own unique string to the lookup
+#      key.  Otherwise, automatic \fBpostscreen\fR(8) or \fBverify\fR(8)
+#      cache cleanup may not work.
+#
+#      NOTE 3: When the backup database is accessed with "proxy:"
+#      lookups, the full backup database name (including the
+#      "proxy:" prefix) must be specified in the proxymap server's
+#      proxy_read_maps or proxy_write_maps setting (depending on
+#      whether the access is read-only or read-write).
 # .IP "\fBflags (default: 0)\fR"
 #      Optional flags that should be stored along with a memcache
 #      update. The flags are ignored when looking up information.
 #      By default, these are the same as the lookup and update
 #      keys that are given to the Postfix memcache client.
 #
-#      NOTE: The \fBkey_format\fR feature is not used for \fBbackup\fR
+#      NOTE 1: The \fBkey_format\fR feature is not used for \fBbackup\fR
 #      database requests.
 #
-#      When the same memcache database is used to cache information
-#      from multiple tables, you can use the \fBkey_format\fR
-#      feature to avoid name collisions by prepending a fixed
-#      string.  Examples:
+#      NOTE 2: When different tables share the same memcache
+#      database, each table should prepend its own unique string
+#      to the lookup key.  Otherwise, automatic \fBpostscreen\fR(8)
+#      or \fBverify\fR(8) cache cleanup may not work.
+#
+#      Examples:
 #
 # .nf
 #          key_format = aliases:%s
-#          key_format = access:%s
+#          key_format = verify:%s
+#          key_format = postscreen:%s
 # .fi
 #
 #      The \fBkey_format\fR parameter supports the following '%'
index d8b20a6165fa9eedb291785e8b306696dc940dc4..09466a4dd6ae675a8150d4eca459fa91a036a81f 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      "20121031"
+#define MAIL_RELEASE_DATE      "20121123"
 #define MAIL_VERSION_NUMBER    "2.10"
 
 #ifdef SNAPSHOT
index 860a134b6feda164111333d4a413ad51ae4e4a91..3fe0a9b6bf53c23ed38b4edcfb94562da6977735 100644 (file)
@@ -73,6 +73,7 @@ typedef struct {
     /* smtpd(8) compatibility */
     int     ehlo_discard_mask;         /* EHLO filter */
     VSTRING *expand_buf;               /* macro expansion */
+    const char *where;                 /* SMTP protocol state */
 } PSC_STATE;
 
 #define PSC_TIME_STAMP_NEW             (0)     /* test was never passed */
@@ -210,6 +211,13 @@ typedef struct {
 #define PSC_STATE_MASK_ANY_UPDATE \
        (PSC_STATE_MASK_ANY_PASS | PSC_STATE_FLAG_PENAL_UPDATE)
 
+ /*
+  * Meta-commands for state->where that reflect the initial command processor
+  * state and commands that aren't implemented.
+  */
+#define PSC_SMTPD_CMD_CONNECT          "CONNECT"
+#define PSC_SMTPD_CMD_UNIMPL           "UNIMPLEMENTED"
+
  /*
   * See log_adhoc.c for discussion.
   */
index 7e319f7131ba86fa528cb0ccf2c045eb56e03d5e..77bb8f4758ffbb69d8cab628eaff95f063906c1b 100644 (file)
@@ -224,6 +224,15 @@ static void psc_smtpd_read_event(int, char *);
     PSC_CLEAR_EVENT_REQUEST(vstream_fileno((state)->smtp_client_stream), \
                           psc_smtpd_time_event, (char *) (state));
 
+ /*
+  * Make control characters and other non-text visible.
+  */
+#define PSC_SMTPD_ESCAPE_TEXT(dest, src, src_len, max_len) do { \
+       ssize_t _s_len = (src_len); \
+       ssize_t _m_len = (max_len); \
+       (void) escape((dest), (src), _s_len < _m_len ? _s_len : _m_len); \
+    } while (0)
+
  /*
   * Command parser support.
   */
@@ -664,7 +673,8 @@ static void psc_smtpd_time_event(int event, char *context)
                 state->smtp_client_addr, state->smtp_client_port,
                 psc_print_state_flags(state->flags, myname));
 
-    msg_info("COMMAND TIME LIMIT from [%s]:%s", PSC_CLIENT_ADDR_PORT(state));
+    msg_info("COMMAND TIME LIMIT from [%s]:%s after %s",
+            PSC_CLIENT_ADDR_PORT(state), state->where);
     PSC_CLEAR_EVENT_DROP_SESSION_STATE(state, psc_smtpd_time_event,
                                       psc_smtpd_timeout_reply);
 }
@@ -715,6 +725,7 @@ static void psc_smtpd_read_event(int event, char *context)
        int     want;
        int     next_state;
     };
+    const char *saved_where;
 
 #define PSC_SMTPD_CMD_ST_ANY           0
 #define PSC_SMTPD_CMD_ST_CR            1
@@ -778,8 +789,8 @@ static void psc_smtpd_read_event(int event, char *context)
             */
            if (state->read_state == PSC_SMTPD_CMD_ST_ANY
                && VSTRING_LEN(state->cmd_buffer) >= var_line_limit) {
-               msg_info("COMMAND LENGTH LIMIT from [%s]:%s",
-                        PSC_CLIENT_ADDR_PORT(state));
+               msg_info("COMMAND LENGTH LIMIT from [%s]:%s after %s",
+                        PSC_CLIENT_ADDR_PORT(state), state->where);
                PSC_CLEAR_EVENT_DROP_SESSION_STATE(state, psc_smtpd_time_event,
                                                   psc_smtpd_421_reply);
                return;
@@ -815,8 +826,10 @@ static void psc_smtpd_read_event(int event, char *context)
            if (ch == '\n') {
                if ((state->flags & PSC_STATE_MASK_BARLF_TODO_SKIP)
                    == PSC_STATE_FLAG_BARLF_TODO) {
-                   msg_info("BARE NEWLINE from [%s]:%s",
-                            PSC_CLIENT_ADDR_PORT(state));
+                   PSC_SMTPD_ESCAPE_TEXT(psc_temp, STR(state->cmd_buffer),
+                                  VSTRING_LEN(state->cmd_buffer) - 1, 100);
+                   msg_info("BARE NEWLINE from [%s]:%s after %s",
+                            PSC_CLIENT_ADDR_PORT(state), STR(psc_temp));
                    PSC_FAIL_SESSION_STATE(state, PSC_STATE_FLAG_BARLF_FAIL);
                    PSC_UNPASS_SESSION_STATE(state, PSC_STATE_FLAG_BARLF_PASS);
                    state->barlf_stamp = PSC_TIME_STAMP_DISABLED;       /* XXX */
@@ -914,9 +927,14 @@ static void psc_smtpd_read_event(int event, char *context)
         * 
         * Caution: cmdp->name and cmdp->action may be null on loop exit.
         */
-       for (cmdp = command_table; cmdp->name != 0; cmdp++)
-           if (strcasecmp(command, cmdp->name) == 0)
+       saved_where = state->where;
+       state->where = PSC_SMTPD_CMD_UNIMPL;
+       for (cmdp = command_table; cmdp->name != 0; cmdp++) {
+           if (strcasecmp(command, cmdp->name) == 0) {
+               state->where = cmdp->name;
                break;
+           }
+       }
 
        if ((state->flags & PSC_STATE_FLAG_SMTPD_X21)
            && cmdp->action != psc_quit_cmd) {
@@ -932,8 +950,11 @@ static void psc_smtpd_read_event(int event, char *context)
                || (*var_psc_forbid_cmds
                    && string_list_match(psc_forbid_cmds, command)))) {
            printable(command, '?');
-           msg_info("NON-SMTP COMMAND from [%s]:%s %.100s %.100s",
-                    PSC_CLIENT_ADDR_PORT(state), command, cmd_buffer_ptr);
+           PSC_SMTPD_ESCAPE_TEXT(psc_temp, cmd_buffer_ptr,
+                                 strlen(cmd_buffer_ptr), 100);
+           msg_info("NON-SMTP COMMAND from [%s]:%s after %s: %.100s %s",
+                    PSC_CLIENT_ADDR_PORT(state), saved_where,
+                    command, STR(psc_temp));
            PSC_FAIL_SESSION_STATE(state, PSC_STATE_FLAG_NSMTP_FAIL);
            PSC_UNPASS_SESSION_STATE(state, PSC_STATE_FLAG_NSMTP_PASS);
            state->nsmtp_stamp = PSC_TIME_STAMP_DISABLED;       /* XXX */
@@ -967,9 +988,8 @@ static void psc_smtpd_read_event(int event, char *context)
        if ((state->flags & PSC_STATE_MASK_PIPEL_TODO_SKIP)
            == PSC_STATE_FLAG_PIPEL_TODO && !PSC_SMTPD_BUFFER_EMPTY(state)) {
            printable(command, '?');
-           escape(psc_temp, PSC_SMTPD_PEEK_DATA(state),
-                  PSC_SMTPD_PEEK_LEN(state) < 100 ?
-                  PSC_SMTPD_PEEK_LEN(state) : 100);
+           PSC_SMTPD_ESCAPE_TEXT(psc_temp, PSC_SMTPD_PEEK_DATA(state),
+                                 PSC_SMTPD_PEEK_LEN(state), 100);
            msg_info("COMMAND PIPELINING from [%s]:%s after %.100s: %s",
                     PSC_CLIENT_ADDR_PORT(state), command, STR(psc_temp));
            PSC_FAIL_SESSION_STATE(state, PSC_STATE_FLAG_PIPEL_FAIL);
@@ -1033,8 +1053,8 @@ static void psc_smtpd_read_event(int event, char *context)
        /* Command COUNT limit test. */
        if (++state->command_count > var_psc_cmd_count
            && cmdp->action != psc_quit_cmd) {
-           msg_info("COMMAND COUNT LIMIT from [%s]:%s",
-                    PSC_CLIENT_ADDR_PORT(state));
+           msg_info("COMMAND COUNT LIMIT from [%s]:%s after %s",
+                    PSC_CLIENT_ADDR_PORT(state), saved_where);
            PSC_CLEAR_EVENT_DROP_SESSION_STATE(state, psc_smtpd_time_event,
                                               psc_smtpd_421_reply);
            return;
index e199eb88554e20bd6e299a250f4848f176ce2f34..5b97ce0325b0a5c1586074781276fa6a495fbce3 100644 (file)
@@ -173,6 +173,7 @@ PSC_STATE *psc_new_session_state(VSTREAM *stream,
     state->read_state = 0;
     state->ehlo_discard_mask = 0;              /* XXX Should be ~0 */
     state->expand_buf = 0;
+    state->where = PSC_SMTPD_CMD_CONNECT;
 
     /*
      * Update the stress level.
index 559c2e0996d86945ab300a835ebb05c55c73fc8c..c720704f22fe19ad73dbf59aa1c4e054e33c6afa 100644 (file)
@@ -473,7 +473,7 @@ static void qmqpd_write_content(QMQPD_STATE *state)
        if (first) {
            if (strncmp(start + strspn(start, ">"), "From ", 5) == 0) {
                rec_fprintf(state->cleanup, rec_type,
-                           "X-Mailbox-Line: %*s", len, start);
+                           "X-Mailbox-Line: %.*s", len, start);
                continue;
            }
            first = 0;
index 09ea4bf96818fee9eaee29a2b5b2daf2de2cce8d..52ebc66c1171a6a73f889907fa547eb10af4ded1 100644 (file)
@@ -518,13 +518,20 @@ static int has_required(ARGV *restrictions, const char **required)
      * Recursively check list membership.
      */
     for (rest = restrictions->argv; *rest; rest++) {
-       if (strcmp(*rest, WARN_IF_REJECT) == 0 && rest[1] != 0) {
+       if (strcasecmp(*rest, WARN_IF_REJECT) == 0 && rest[1] != 0) {
            rest += 1;
            continue;
        }
+       if (strcasecmp(*rest, PERMIT_ALL) == 0) {
+           if (rest[1] != 0)
+               msg_warn("restriction `%s' after `%s' is ignored",
+                        rest[1], rest[0]);
+           return (0);
+       }
        for (reqd = required; *reqd; reqd++)
-           if (strcmp(*rest, *reqd) == 0)
+           if (strcasecmp(*rest, *reqd) == 0)
                return (1);
+       /* XXX This lookup operation should not be case-sensitive. */
        if ((expansion = (ARGV *) htable_find(smtpd_rest_classes, *rest)) != 0)
            if (has_required(expansion, required))
                return (1);
@@ -684,6 +691,7 @@ void    smtpd_check_init(void)
        while ((name = mystrtok(&cp, RESTRICTION_SEPARATORS)) != 0) {
            if ((value = mail_conf_lookup_eval(name)) == 0 || *value == 0)
                msg_fatal("restriction class `%s' needs a definition", name);
+           /* XXX This store operation should not be case-sensitive. */
            htable_enter(smtpd_rest_classes, name,
                         (char *) smtpd_check_parse(SMTPD_CHECK_PARSE_ALL,
                                                    value));