]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.8-20100916
authorWietse Venema <wietse@porcupine.org>
Thu, 16 Sep 2010 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:36:33 +0000 (06:36 +0000)
postfix/HISTORY
postfix/README_FILES/POSTSCREEN_README
postfix/html/POSTSCREEN_README.html
postfix/proto/POSTSCREEN_README.html
postfix/src/global/mail_version.h
postfix/src/postscreen/postscreen_dnsbl.c
postfix/src/postscreen/postscreen_smtpd.c

index 918563b10cd7d01c2940d617866763490068aa69..8b9509bbb8ef9922a5d7ebc19e05911c767f32b6 100644 (file)
@@ -15996,4 +15996,16 @@ Apologies for any names omitted.
 20100915
 
        Bugfix (introduced 20100914): missing precondition for
-       call-back notification.  File: postscreen/dnsblog.c.
+       call-back notification.  File: postscreen/postscreen_dnsbl.c.
+
+       Bugfix (introduced 20100914): the "postscreen_greet_wait"
+       delay speedup worked only for DNSBL listed sites.  File:
+       postscreen/postscreen_dnsbl.c.
+
+       Workaround: better handling of pregreeting spambots. The
+       postscreen built-in SMTP engine no longer sends a 220 banner
+       to a client that falls into the pregeet trap.  This eliminates
+       many "non-SMTP command" records in postscreen logging, as
+       the SMTP client and server no longer get out of sync.  It
+       also results in better logging of sender/recipient information.
+       file: postscreen/postscreen-smtpd.c.
index a11a3d05c8cf344d63ea434b17ee04e09aa084a1..6851341ea38463cab5f8efea441535da4cc61bb5 100644 (file)
@@ -423,19 +423,34 @@ mail:
  1. Comment out the "smtp inet ... smtpd" service in master.cf, including any
     "-o parameter=value" entries that follow.
 
+    /etc/postfix/master.cf:
+        #smtp      inet  n       -       n       -       -       smtpd
+        #    -o parameter=value ...
+
  2. Uncomment the new "smtpd pass ... smtpd" service in master.cf, and
     duplicate any "-o parameter=value" entries from the smtpd service that was
     commented out in step 1.
 
+    /etc/postfix/master.cf:
+        smtpd     pass  -       -       n       -       -       smtpd
+            -o parameter=value ...
+
  3. Uncomment the new "smtp inet ... postscreen" service in master.cf.
 
+    /etc/postfix/master.cf:
+        smtp      inet  n       -       n       -       1       postscreen
+
  4. Uncomment the new "dnsblog unix ... dnsblog" service in master.cf. This
     service does DNSBL lookups for postscreen(8) and logs results.
 
+    /etc/postfix/master.cf:
+        dnsblog   unix  -       -       n       -       0       dnsblog
+
  5. To enable DNSBL lookups, list some DNS blocklist sites in main.cf,
     separated by whitespace. Different sites can have different weights. For
     example:
 
+    /etc/postfix/main.cf:
         postscreen_dnsbl_threshold = 2
         postscreen_dnsbl_sites = zen.spamhaus.org*2 example.com*1 example.net*1
 
@@ -520,14 +535,29 @@ processes:
  1. Comment out the "smtp inet ... postscreen" service in master.cf, including
     any "-o parameter=value" entries that follow.
 
+    /etc/postfix/master.cf:
+        #smtp      inet  n       -       n       -       1       postscreen
+        #    -o parameter=value ...
+
  2. Comment out the "dnsblog unix ... dnsblog" service in master.cf.
 
+    /etc/postfix/master.cf:
+        #dnsblog   unix  -       -       n       -       0       dnsblog
+
  3. Comment out the "smtpd pass ... smtpd" service in master.cf, including any
     "-o parameter=value" entries that follow.
 
+    /etc/postfix/master.cf:
+        #smtpd     pass  -       -       n       -       -       smtpd
+        #    -o parameter=value ...
+
  4. Uncomment the "smtp inet ... smtpd" service in master.cf, including any "-
     o parameter=value" entries that follow.
 
+    /etc/postfix/master.cf:
+        smtp      inet  n       -       n       -       -       smtpd
+            -o parameter=value ...
+
  5. Read the new configuration with "postfix reload".
 
 H\bHi\bis\bst\bto\bor\bri\bic\bca\bal\bl n\bno\bot\bte\bes\bs a\ban\bnd\bd c\bcr\bre\bed\bdi\bit\bts\bs
@@ -538,13 +568,13 @@ in OpenBSD spamd, and in MailChannels Traffic Control.
 Wietse threw together a crude prototype with pregreet and dnsbl support in June
 2009, because he needed something new for a Mailserver conference presentation
 in July. Ralf Hildebrandt ran this code on several servers to collect real-
-world evidence. This version used the dnsblog(8) ad-hoc DNS client program.
+world statistics. This version used the dnsblog(8) ad-hoc DNS client program.
 
 Wietse needed new material for a LISA conference presentation in November 2010,
 so he added support for DNSBL weights and filters in August, followed by a
 major code rewrite, deep protocol tests, helo/sender/recipient logging, and
 stress-adaptive behavior in September. Ralf Hildebrandt ran this code on
-several servers to collect real-world evidence. This version still used the
-same delay for pregreet and DNBL tests, as well as the embarrassing dnsblog(8)
+several servers to collect real-world statistics. This version still used the
+same delay for pregreet and DNSBL tests, as well as the embarrassing dnsblog(8)
 ad-hoc DNS client.
 
index 3843d51a0f9835d01875f3ea93e9dd89a64d530c..d9734d344f5398c3f4af058f4cff29754c4adccd 100644 (file)
@@ -585,22 +585,45 @@ without blocking mail: </p>
 in <a href="master.5.html">master.cf</a>, including any "<tt>-o parameter=value</tt>" entries
 that follow.  </p>
 
+<pre>
+/etc/postfix/<a href="master.5.html">master.cf</a>:
+    #smtp      inet  n       -       n       -       -       smtpd
+    #    -o parameter=value ...
+</pre>
+
 <li> <p> Uncomment the new "<tt>smtpd pass ... smtpd</tt>" service
 in <a href="master.5.html">master.cf</a>, and duplicate any "<tt>-o parameter=value</tt>" entries
 from the smtpd service that was commented out in step 1. </p>
 
+<pre>
+/etc/postfix/<a href="master.5.html">master.cf</a>:
+    smtpd     pass  -       -       n       -       -       smtpd
+        -o parameter=value ...
+</pre>
+
 <li> <p> Uncomment the new "<tt>smtp inet ... postscreen</tt>"
 service in <a href="master.5.html">master.cf</a>. </p>
 
+<pre>
+/etc/postfix/<a href="master.5.html">master.cf</a>:
+    smtp      inet  n       -       n       -       1       postscreen
+</pre>
+
 <li> <p> Uncomment the new "<tt>dnsblog  unix ... dnsblog</tt>"
 service in <a href="master.5.html">master.cf</a>.  This service does DNSBL lookups for <a href="postscreen.8.html">postscreen(8)</a>
 and logs results. </p>
 
+<pre>
+/etc/postfix/<a href="master.5.html">master.cf</a>:
+    dnsblog   unix  -       -       n       -       0       dnsblog
+</pre>
+
 <li> <p> To enable DNSBL lookups, list some DNS blocklist sites in
 <a href="postconf.5.html">main.cf</a>, separated by whitespace. Different sites can have different
 weights. For example:
 
 <pre>
+/etc/postfix/<a href="postconf.5.html">main.cf</a>:
     <a href="postconf.5.html#postscreen_dnsbl_threshold">postscreen_dnsbl_threshold</a> = 2
     <a href="postconf.5.html#postscreen_dnsbl_sites">postscreen_dnsbl_sites</a> = zen.spamhaus.org*2 example.com*1 example.net*1
 </pre>
@@ -714,17 +737,41 @@ SMTP server processes: </p>
 in <a href="master.5.html">master.cf</a>, including any "<tt>-o parameter=value</tt>" entries
 that follow. </p>
 
+<pre>
+/etc/postfix/<a href="master.5.html">master.cf</a>:
+    #smtp      inet  n       -       n       -       1       postscreen
+    #    -o parameter=value ...
+</pre>
+
 <li> <p> Comment out the "<tt>dnsblog  unix ... dnsblog</tt>" service
 in <a href="master.5.html">master.cf</a>.  </p>
 
+<pre>
+/etc/postfix/<a href="master.5.html">master.cf</a>:
+    #dnsblog   unix  -       -       n       -       0       dnsblog
+</pre>
+
 <li> <p> Comment out the "<tt>smtpd pass ... smtpd</tt>" service
 in <a href="master.5.html">master.cf</a>, including any "<tt>-o parameter=value</tt>" entries
 that follow. </p>
 
+<pre>
+/etc/postfix/<a href="master.5.html">master.cf</a>:
+    #smtpd     pass  -       -       n       -       -       smtpd
+    #    -o parameter=value ...
+</pre>
+
+
 <li> <p> Uncomment the "<tt>smtp  inet ... smtpd</tt>" service in
 <a href="master.5.html">master.cf</a>, including any "<tt>-o parameter=value</tt>" entries that
 follow.  </p>
 
+<pre>
+/etc/postfix/<a href="master.5.html">master.cf</a>:
+    smtp      inet  n       -       n       -       -       smtpd
+        -o parameter=value ...
+</pre>
+
 <li> <p> Read the new configuration with "<tt>postfix reload</tt>".
 </p>
 
@@ -739,7 +786,7 @@ Control.  </p>
 <p> Wietse threw together a crude prototype with pregreet and dnsbl
 support in June 2009, because he needed something new for a Mailserver
 conference presentation in July. Ralf Hildebrandt ran this code on
-several servers to collect real-world evidence. This version used
+several servers to collect real-world statistics. This version used
 the <a href="dnsblog.8.html">dnsblog(8)</a> ad-hoc DNS client program. </p>
 
 <p> Wietse needed new material for a LISA conference presentation
@@ -747,9 +794,9 @@ in November 2010, so he added support for DNSBL weights and filters
 in August, followed by a major code rewrite, deep protocol tests,
 helo/sender/recipient logging, and stress-adaptive behavior in
 September. Ralf Hildebrandt ran this code on several servers to
-collect real-world evidence. This version still used the same delay
-for pregreet and DNBL tests, as well as the embarrassing <a href="dnsblog.8.html">dnsblog(8)</a>
-ad-hoc DNS client.  </p>
+collect real-world statistics. This version still used the same
+delay for pregreet and DNSBL tests, as well as the embarrassing
+<a href="dnsblog.8.html">dnsblog(8)</a> ad-hoc DNS client.  </p>
 
 </body>
 
index 036015f0d32b2abe91398e46dc16d4d393006db9..a7cdd5367c87bc7cad140706e4512c3d2497ddc2 100644 (file)
@@ -585,22 +585,45 @@ without blocking mail: </p>
 in master.cf, including any "<tt>-o parameter=value</tt>" entries
 that follow.  </p>
 
+<pre>
+/etc/postfix/master.cf:
+    #smtp      inet  n       -       n       -       -       smtpd
+    #    -o parameter=value ...
+</pre>
+
 <li> <p> Uncomment the new "<tt>smtpd pass ... smtpd</tt>" service
 in master.cf, and duplicate any "<tt>-o parameter=value</tt>" entries
 from the smtpd service that was commented out in step 1. </p>
 
+<pre>
+/etc/postfix/master.cf:
+    smtpd     pass  -       -       n       -       -       smtpd
+        -o parameter=value ...
+</pre>
+
 <li> <p> Uncomment the new "<tt>smtp inet ... postscreen</tt>"
 service in master.cf. </p>
 
+<pre>
+/etc/postfix/master.cf:
+    smtp      inet  n       -       n       -       1       postscreen
+</pre>
+
 <li> <p> Uncomment the new "<tt>dnsblog  unix ... dnsblog</tt>"
 service in master.cf.  This service does DNSBL lookups for postscreen(8)
 and logs results. </p>
 
+<pre>
+/etc/postfix/master.cf:
+    dnsblog   unix  -       -       n       -       0       dnsblog
+</pre>
+
 <li> <p> To enable DNSBL lookups, list some DNS blocklist sites in
 main.cf, separated by whitespace. Different sites can have different
 weights. For example:
 
 <pre>
+/etc/postfix/main.cf:
     postscreen_dnsbl_threshold = 2
     postscreen_dnsbl_sites = zen.spamhaus.org*2 example.com*1 example.net*1
 </pre>
@@ -714,17 +737,41 @@ SMTP server processes: </p>
 in master.cf, including any "<tt>-o parameter=value</tt>" entries
 that follow. </p>
 
+<pre>
+/etc/postfix/master.cf:
+    #smtp      inet  n       -       n       -       1       postscreen
+    #    -o parameter=value ...
+</pre>
+
 <li> <p> Comment out the "<tt>dnsblog  unix ... dnsblog</tt>" service
 in master.cf.  </p>
 
+<pre>
+/etc/postfix/master.cf:
+    #dnsblog   unix  -       -       n       -       0       dnsblog
+</pre>
+
 <li> <p> Comment out the "<tt>smtpd pass ... smtpd</tt>" service
 in master.cf, including any "<tt>-o parameter=value</tt>" entries
 that follow. </p>
 
+<pre>
+/etc/postfix/master.cf:
+    #smtpd     pass  -       -       n       -       -       smtpd
+    #    -o parameter=value ...
+</pre>
+
+
 <li> <p> Uncomment the "<tt>smtp  inet ... smtpd</tt>" service in
 master.cf, including any "<tt>-o parameter=value</tt>" entries that
 follow.  </p>
 
+<pre>
+/etc/postfix/master.cf:
+    smtp      inet  n       -       n       -       -       smtpd
+        -o parameter=value ...
+</pre>
+
 <li> <p> Read the new configuration with "<tt>postfix reload</tt>".
 </p>
 
@@ -739,7 +786,7 @@ Control.  </p>
 <p> Wietse threw together a crude prototype with pregreet and dnsbl
 support in June 2009, because he needed something new for a Mailserver
 conference presentation in July. Ralf Hildebrandt ran this code on
-several servers to collect real-world evidence. This version used
+several servers to collect real-world statistics. This version used
 the dnsblog(8) ad-hoc DNS client program. </p>
 
 <p> Wietse needed new material for a LISA conference presentation
@@ -747,9 +794,9 @@ in November 2010, so he added support for DNSBL weights and filters
 in August, followed by a major code rewrite, deep protocol tests,
 helo/sender/recipient logging, and stress-adaptive behavior in
 September. Ralf Hildebrandt ran this code on several servers to
-collect real-world evidence. This version still used the same delay
-for pregreet and DNBL tests, as well as the embarrassing dnsblog(8)
-ad-hoc DNS client.  </p>
+collect real-world statistics. This version still used the same
+delay for pregreet and DNSBL tests, as well as the embarrassing
+dnsblog(8) ad-hoc DNS client.  </p>
 
 </body>
 
index d065a2c6d56d2e50f74329fbd145fd16e1115fa6..db92c69537aac967fd62d4b241002a28209dc116 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      "20100915"
+#define MAIL_RELEASE_DATE      "20100916"
 #define MAIL_VERSION_NUMBER    "2.8"
 
 #ifdef SNAPSHOT
index fffc6b49b7b37207b0dad6550d443f1c1c4aeb3c..794a008dcc29303d1e73fa7b683b4987aed1da5f 100644 (file)
@@ -326,7 +326,6 @@ static void ps_dnsbl_receive(int event, char *context)
                     ATTR_TYPE_STR, MAIL_ATTR_ACT_CLIENT_ADDR, reply_client,
                     ATTR_TYPE_STR, MAIL_ATTR_RBL_ADDR, reply_addr,
                     ATTR_TYPE_END) == 3
-       && *STR(reply_addr) != 0
        && (score = (PS_DNSBL_SCORE *)
            htable_find(dnsbl_score_cache, STR(reply_client))) != 0) {
 
@@ -341,22 +340,25 @@ static void ps_dnsbl_receive(int event, char *context)
            msg_info("%s: client=\"%s\" score=%d domain=\"%s\" reply=\"%s\"",
                     myname, STR(reply_client), score->total,
                     STR(reply_dnsbl), STR(reply_addr));
-       head = (PS_DNSBL_HEAD *) htable_find(dnsbl_site_cache, STR(reply_dnsbl));
-       site = (head ? head->first : (PS_DNSBL_SITE *) 0);
-       for (reply_argv = 0; site != 0; site = site->next) {
-           if (site->filter == 0
-               || ps_dnsbl_match(site->filter, reply_argv ? reply_argv :
+       if (*STR(reply_addr) != 0) {
+           head = (PS_DNSBL_HEAD *)
+               htable_find(dnsbl_site_cache, STR(reply_dnsbl));
+           site = (head ? head->first : (PS_DNSBL_SITE *) 0);
+           for (reply_argv = 0; site != 0; site = site->next) {
+               if (site->filter == 0
+                   || ps_dnsbl_match(site->filter, reply_argv ? reply_argv :
                         (reply_argv = argv_split(STR(reply_addr), " ")))) {
-               score->dnsbl = head->safe_dnsbl;
-               score->total += site->weight;
-               if (msg_verbose > 1)
-                   msg_info("%s: filter=\"%s\" weight=%d score=%d",
-                            myname, site->filter ? site->filter : "null",
-                            site->weight, score->total);
+                   score->dnsbl = head->safe_dnsbl;
+                   score->total += site->weight;
+                   if (msg_verbose > 1)
+                       msg_info("%s: filter=\"%s\" weight=%d score=%d",
+                              myname, site->filter ? site->filter : "null",
+                                site->weight, score->total);
+               }
            }
+           if (reply_argv != 0)
+               argv_free(reply_argv);
        }
-       if (reply_argv != 0)
-           argv_free(reply_argv);
 
        /*
         * Notify the requestor(s) that the result is ready to be picked up.
@@ -367,6 +369,7 @@ static void ps_dnsbl_receive(int event, char *context)
        if (score->pending_lookups == 0)
            PS_CALL_BACK_NOTIFY(score, PS_NULL_EVENT);
     }
+    /* Here, score may be a null pointer. */
     vstream_fclose(stream);
 }
 
index 281c41181f3d1d5ed23489633d12f4b556fd13b6..33955f0a32d05ecf156f94005dcfa544bb7477fd 100644 (file)
@@ -830,9 +830,11 @@ void    ps_smtpd_tests(PS_STATE *state)
                     PS_STATE_FLAG_BARLF_TODO);
 
     /*
-     * Send the SMTP banner.
+     * Send no SMTP banner to pregreeting clients. This eliminates a lot of
+     * "NON-SMTP COMMAND" events, and improves sender/recipient logging.
      */
-    if (PS_SEND_REPLY(state, ps_smtpd_greeting) != 0) {
+    if ((state->flags & PS_STATE_FLAG_PREGR_FAIL) == 0
+       && PS_SEND_REPLY(state, ps_smtpd_greeting) != 0) {
        ps_hangup_event(state);
        return;
     }