]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.12-20140508
authorWietse Venema <wietse@porcupine.org>
Thu, 8 May 2014 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sat, 10 May 2014 05:59:40 +0000 (01:59 -0400)
postfix/HISTORY
postfix/README_FILES/SMTPD_POLICY_README
postfix/html/SMTPD_POLICY_README.html
postfix/proto/SMTPD_POLICY_README.html
postfix/src/global/mail_version.h
postfix/src/smtp/smtp.h
postfix/src/smtp/smtp_connect.c
postfix/src/smtp/smtp_proto.c
postfix/src/smtp/smtp_trouble.c

index 706d8335991c436c5e5f232d4493dd4d7102e879..41b21d70f42c1c29aad4b06259a046e1032884f8 100644 (file)
@@ -19711,3 +19711,13 @@ Apologies for any names omitted.
        reported by Sahil Tandon, predicate error found by Viktor,
        redundant connection restore request eliminated by Wietse.
        File: smtp/smtp_connect.c.
+
+       Cleanup: the macros that control SMTP connection reuse
+       poorly reflected their purpose. "DEAD" is replaced with
+       "FORBIDDEN" (no I/O allowed) and "BAD" is replaced with
+       "THROTTLED" (anything that causes the queue manager to back
+       off from some destination). Files: smtp.h, smtp_coonnect.c,
+       smtp_proto.c, smtp_trouble.c.
+
+       Cleanup: enable SMTP connection cache lookup by destination
+       while a surge of mail is drying up. File: smtp_connect.c.
index 70c6bd0a60a302534e3ce05ef4fcc909e388c392..17d816f43f1c6a330aad6df33e2773adcabee3e5 100644 (file)
@@ -73,6 +73,8 @@ a delegated SMTPD access policy request:
     stress=
     P\bPo\bos\bst\btf\bfi\bix\bx v\bve\ber\brs\bsi\bio\bon\bn 2\b2.\b.9\b9 a\ban\bnd\bd l\bla\bat\bte\ber\br:\b:
     ccert_pubkey_fingerprint=68:B3:29:DA:98:93:E3:40:99:C7:D8:AD:5C:B9:C9:40
+    P\bPo\bos\bst\btf\bfi\bix\bx v\bve\ber\brs\bsi\bio\bon\bn 2\b2.\b.1\b12\b2 a\ban\bnd\bd l\bla\bat\bte\ber\br:\b:
+    client_port=1234
     [empty line]
 
 Notes:
index 5770535b483d6e66e66a7d4dfc808ce295000516..aaccc22f5c31abb8a80e2f3809639b215b04208b 100644 (file)
@@ -104,6 +104,8 @@ etrn_domain=
 stress=
 <b>Postfix version 2.9 and later:</b>
 ccert_pubkey_fingerprint=68:B3:29:DA:98:93:E3:40:99:C7:D8:AD:5C:B9:C9:40
+<b>Postfix version 2.12 and later:</b>
+client_port=1234
 [empty line]
 </pre>
 </blockquote>
index 8a38c0ee161c5e8e05cd647e8d1592da5217c611..37e8cc02bbf6fd16263a5b3efd03d75c8852a612 100644 (file)
@@ -104,6 +104,8 @@ etrn_domain=
 stress=
 <b>Postfix version 2.9 and later:</b>
 ccert_pubkey_fingerprint=68:B3:29:DA:98:93:E3:40:99:C7:D8:AD:5C:B9:C9:40
+<b>Postfix version 2.12 and later:</b>
+client_port=1234
 [empty line]
 </pre>
 </blockquote>
index 0f5cb367e70a12679d2c73bc57cd79ecccd03e56..73c31170a3049e5104744fbd293bc53f7343e6a1 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      "20140507"
+#define MAIL_RELEASE_DATE      "20140508"
 #define MAIL_VERSION_NUMBER    "2.12"
 
 #ifdef SNAPSHOT
index e966ff6b1073699a2bf8fd2549b1fbde05905ef7..70f8dbe67282d8163e2f2bc1517c5248ffba0f4b 100644 (file)
@@ -322,7 +322,7 @@ typedef struct SMTP_SESSION {
 
     time_t  expire_time;               /* session reuse expiration time */
     int     reuse_count;               /* # of times reused (for logging) */
-    int     dead;                      /* No further I/O allowed */
+    int     forbidden;                 /* No further I/O allowed */
 
 #ifdef USE_SASL_AUTH
     char   *sasl_mechanism_list;       /* server mechanism list */
@@ -416,7 +416,7 @@ extern HBC_CALL_BACKS smtp_hbc_callbacks[];
   * connections and other reasons why connections cannot be cached.
   */
 #define THIS_SESSION_IS_CACHED \
-       (!THIS_SESSION_IS_DEAD && session->expire_time > 0)
+       (!THIS_SESSION_IS_FORBIDDEN && session->expire_time > 0)
 
 #define THIS_SESSION_IS_EXPIRED \
        (THIS_SESSION_IS_CACHED \
@@ -424,27 +424,27 @@ extern HBC_CALL_BACKS smtp_hbc_callbacks[];
                || (var_smtp_reuse_count > 0 \
                    && session->reuse_count >= var_smtp_reuse_count)))
 
-#define THIS_SESSION_IS_BAD \
-       (!THIS_SESSION_IS_DEAD && session->expire_time < 0)
+#define THIS_SESSION_IS_THROTTLED \
+       (!THIS_SESSION_IS_FORBIDDEN && session->expire_time < 0)
 
-#define THIS_SESSION_IS_DEAD \
-       (session->dead != 0)
+#define THIS_SESSION_IS_FORBIDDEN \
+       (session->forbidden != 0)
 
  /* Bring the bad news. */
 
 #define DONT_CACHE_THIS_SESSION \
        (session->expire_time = 0)
 
-#define DONT_CACHE_BAD_SESSION \
+#define DONT_CACHE_THROTTLED_SESSION \
        (session->expire_time = -1)
 
-#define DONT_USE_DEAD_SESSION \
-       (session->dead = 1)
+#define DONT_USE_FORBIDDEN_SESSION \
+       (session->forbidden = 1)
 
  /* Initialization. */
 
 #define USE_NEWBORN_SESSION \
-       (session->dead = 0)
+       (session->forbidden = 0)
 
 #define CACHE_THIS_SESSION_UNTIL(when) \
        (session->expire_time = (when))
index 3ae3af90b31d4b03923d937148a42a14c4006d60..19c374fa6638137a4fbb1d21449789565f00a383 100644 (file)
@@ -368,7 +368,7 @@ static void smtp_cleanup_session(SMTP_STATE *state)
 {
     DELIVER_REQUEST *request = state->request;
     SMTP_SESSION *session = state->session;
-    int     bad_session;
+    int     throttled;
 
     /*
      * Inform the postmaster of trouble.
@@ -397,7 +397,7 @@ static void smtp_cleanup_session(SMTP_STATE *state)
      * physical bindings; caching a session under its own hostname provides
      * no performance benefit, given the way smtp_connect() works.
      */
-    bad_session = THIS_SESSION_IS_BAD;         /* smtp_quit() may fail */
+    throttled = THIS_SESSION_IS_THROTTLED;     /* smtp_quit() may fail */
     if (THIS_SESSION_IS_EXPIRED)
        smtp_quit(state);                       /* also disables caching */
     if (THIS_SESSION_IS_CACHED
@@ -417,7 +417,7 @@ static void smtp_cleanup_session(SMTP_STATE *state)
      * next-hop destination. Otherwise we could end up skipping over the
      * available and more preferred servers.
      */
-    if (HAVE_NEXTHOP_STATE(state) && !bad_session)
+    if (HAVE_NEXTHOP_STATE(state) && !throttled)
        FREE_NEXTHOP_STATE(state);
 
     /*
@@ -539,7 +539,7 @@ static void smtp_connect_local(SMTP_STATE *state, const char *path)
         */
        if ((session->features & SMTP_FEATURE_FROM_CACHE) == 0
            && smtp_helo(state) != 0) {
-           if (!THIS_SESSION_IS_DEAD
+           if (!THIS_SESSION_IS_FORBIDDEN
                && vstream_ferror(session->stream) == 0
                && vstream_feof(session->stream) == 0)
                smtp_quit(state);
@@ -889,11 +889,13 @@ static void smtp_connect_inet(SMTP_STATE *state, const char *nexthop,
         * 
         * Opportunistic (a.k.a. on-demand) session caching on request by the
         * queue manager. This is turned temporarily when a destination has a
-        * high volume of mail in the active queue.
+        * high volume of mail in the active queue. When the surge reaches
+        * its end, the queue manager requests that connections be retrieved
+        * but not stored.
         */
        if (addr_list && (state->misc_flags & SMTP_MISC_FLAG_FIRST_NEXTHOP)) {
            smtp_cache_policy(state, domain);
-           if (state->misc_flags & SMTP_MISC_FLAG_CONN_STORE)
+           if (state->misc_flags & SMTP_MISC_FLAG_CONN_CACHE_MASK)
                SET_NEXTHOP_STATE(state, dest);
        }
 
@@ -1004,7 +1006,7 @@ static void smtp_connect_inet(SMTP_STATE *state, const char *nexthop,
                     * When a TLS handshake fails, the stream is marked
                     * "dead" to avoid further I/O over a broken channel.
                     */
-                   if (!THIS_SESSION_IS_DEAD
+                   if (!THIS_SESSION_IS_FORBIDDEN
                        && vstream_ferror(session->stream) == 0
                        && vstream_feof(session->stream) == 0)
                        smtp_quit(state);
index fbae51f2d597948911a729b639e9ef7d34556708..1661eee83fb8758361583d738ba7e4daee63347b 100644 (file)
@@ -826,7 +826,7 @@ static int smtp_start_tls(SMTP_STATE *state)
         * We must avoid further I/O, the peer is in an undefined state.
         */
        (void) vstream_fpurge(session->stream, VSTREAM_PURGE_BOTH);
-       DONT_USE_DEAD_SESSION;
+       DONT_USE_FORBIDDEN_SESSION;
 
        /*
         * If TLS is optional, try delivery to the same server over a
@@ -2002,7 +2002,7 @@ static int smtp_loop(SMTP_STATE *state, NOCLOBBER int send_state,
                                             "unreadable mail queue entry");
                    /* Bailing out, abort stream with prejudice */
                    (void) vstream_fpurge(session->stream, VSTREAM_PURGE_BOTH);
-                   DONT_USE_DEAD_SESSION;
+                   DONT_USE_FORBIDDEN_SESSION;
                    /* If bounce_append() succeeded, status is still 0 */
                    if (state->status == 0)
                        (void) mark_corrupt(state->src);
index b3b4aacc58c1e601be1398652d9d2822b95c0c9b..2262e6cf04cf4298a6483fa1aa1f90585ba4c351 100644 (file)
@@ -265,7 +265,7 @@ static int smtp_bulk_fail(SMTP_STATE *state, int throttle_queue)
      * Don't cache this session. We can't talk to this server.
      */
     if (throttle_queue && session)
-       DONT_CACHE_BAD_SESSION;
+       DONT_CACHE_THROTTLED_SESSION;
 
     return (-1);
 }