]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.4-20181226
authorWietse Venema <wietse@porcupine.org>
Wed, 26 Dec 2018 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Thu, 27 Dec 2018 04:37:14 +0000 (23:37 -0500)
12 files changed:
postfix/HISTORY
postfix/README_FILES/POSTSCREEN_README
postfix/html/POSTSCREEN_README.html
postfix/html/postconf.5.html
postfix/man/man5/postconf.5
postfix/proto/POSTSCREEN_README.html
postfix/proto/postconf.proto
postfix/src/global/mail_version.h
postfix/src/postscreen/postscreen.h
postfix/src/postscreen/postscreen_state.c
postfix/src/posttls-finger/posttls-finger.c
postfix/src/util/dict_file.c

index d2ac8112a52ebb4190a8f8027ba97011ed7463cf..3b5d3fdfdd04a4bca871cc8173d9d8b18d87f81a 100644 (file)
@@ -23890,3 +23890,29 @@ Apologies for any names omitted.
        default_rbl_reply, command_execution_directory, luser_relay,
        smtpd_reject_footer. These have their own documented $name
        substitution mechanism. File: proto/postconf.proto.
+
+20181202
+
+       Bugfix: posttls-finger reported an error for UNIX-domain
+       connections, even if they did not fail. Found by Coverity.
+       File: posttls-finger/posttls-finger.c.
+
+20181208
+
+       Documentation: add even more redundancy to the rate-delay
+       description. File: proto/postconf.proto.
+
+20181210
+
+       Cleanup: code deduplication. File: util/dict_file.c.
+
+20181226
+
+       Cleanup: code deduplication and better encapsulation with
+       PSC_DEL_CLIENT_STATE() and PSC_DEL_SERVER_STATE() macros.
+       Files: postscreen/postscreen.h, postscreen/postscreen_state.c.
+
+       Documentation: POSTSCREEN_README did not describe the
+       postscreen_post_queue_limit, and attributed the wrong reject
+       message to the postscreen_pre_queue_limit. Problem reported
+       by Michael Orlitzky. File: proto/POSTSCREEN_README.html.
index 0931ba3ceb421afb36c61b1b1e81d4110fcf4628..78da5dd88a63a1620aa2b04be4a850815ce18601 100644 (file)
@@ -508,15 +508,21 @@ limit, as specified with the line_length_limit parameter. The session is
 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
-status code and logs:
+When an SMTP client makes too many connections at the same time, postscreen(8)
+rejects the connection with a 421 status code and logs:
 
     N\bNO\bOQ\bQU\bUE\bEU\bUE\bE:\b: r\bre\bej\bje\bec\bct\bt:\b: C\bCO\bON\bNN\bNE\bEC\bCT\bT f\bfr\bro\bom\bm [address]:port:\b: t\bto\boo\bo m\bma\ban\bny\by c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs
+
+The postscreen_client_connection_count_limit parameter controls this limit.
+
+When an SMTP client connects after postscreen(8) has reached a connection count
+limit, postscreen(8) rejects the connection with a 421 status code and logs:
+
+    N\bNO\bOQ\bQU\bUE\bEU\bUE\bE:\b: r\bre\bej\bje\bec\bct\bt:\b: C\bCO\bON\bNN\bNE\bEC\bCT\bT f\bfr\bro\bom\bm [address]:port:\b: a\bal\bll\bl s\bsc\bcr\bre\bee\ben\bni\bin\bng\bg p\bpo\bor\brt\bts\bs b\bbu\bus\bsy\by
     N\bNO\bOQ\bQU\bUE\bEU\bUE\bE:\b: r\bre\bej\bje\bec\bct\bt:\b: C\bCO\bON\bNN\bNE\bEC\bCT\bT f\bfr\bro\bom\bm [address]:port:\b: a\bal\bll\bl s\bse\ber\brv\bve\ber\br p\bpo\bor\brt\bts\bs b\bbu\bus\bsy\by
 
-The postscreen_client_connection_count_limit and postscreen_pre_queue_limit
-parameters control these limits.
+The postscreen_pre_queue_limit and postscreen_post_queue_limit parameters
+control these limits.
 
 W\bWh\bhe\ben\bn a\bal\bll\bl t\bte\bes\bst\bts\bs s\bsu\buc\bcc\bce\bee\bed\bd
 
index d326fcf19d860c5cbe36f85c4dbc94808913c245..4405f1e3e5104d89bc95d5279caec19e8f540bac 100644 (file)
@@ -714,16 +714,25 @@ 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
-connection with a 421 status code and logs: </p>
+<a href="postscreen.8.html">postscreen(8)</a> rejects the connection with a 421 status code and logs: </p>
 
 <pre>
     <b>NOQUEUE: reject: CONNECT from</b> <i>[address]:port</i><b>: too many connections</b>
+</pre>
+
+<p> The <a href="postconf.5.html#postscreen_client_connection_count_limit">postscreen_client_connection_count_limit</a> parameter controls this limit. </p>
+
+<p> When an SMTP client connects after <a href="postscreen.8.html">postscreen(8)</a> has reached a
+connection count limit, <a href="postscreen.8.html">postscreen(8)</a> rejects the connection with
+a 421 status code and logs: </p>
+
+<pre>
+    <b>NOQUEUE: reject: CONNECT from</b> <i>[address]:port</i><b>: all screening ports busy</b>
     <b>NOQUEUE: reject: CONNECT from</b> <i>[address]:port</i><b>: all server ports busy</b>
 </pre>
 
-<p> The <a href="postconf.5.html#postscreen_client_connection_count_limit">postscreen_client_connection_count_limit</a> and
-<a href="postconf.5.html#postscreen_pre_queue_limit">postscreen_pre_queue_limit</a> parameters control these limits.  </p>
+<p> The <a href="postconf.5.html#postscreen_pre_queue_limit">postscreen_pre_queue_limit</a> and <a href="postconf.5.html#postscreen_post_queue_limit">postscreen_post_queue_limit</a>
+parameters control these limits.  </p>
 
 <h2> <a name="victory">When all tests succeed</a> </h2>
 
index 5f0ee856dbd11092728c6fb4509fdf3599b9dfab..decaaa4ce87a1c2d54630bddafbc35561876a162 100644 (file)
@@ -2276,8 +2276,10 @@ is the <a href="master.5.html">master.cf</a> name of the message delivery transp
 (default: 0s)</b></DT><DD>
 
 <p> The default amount of delay that is inserted between individual
-deliveries to the same destination. If non-zero, all deliveries to
-the same destination will happen one at a time. </p>
+message deliveries to the same destination and over the same message
+delivery transport. Specify a non-zero value to rate-limit those
+message deliveries to at most one per $<a href="postconf.5.html#default_destination_rate_delay">default_destination_rate_delay</a>.
+</p>
 
 <p> The resulting behavior depends on the value of the corresponding
 per-destination recipient limit.
@@ -2675,9 +2677,10 @@ Example:
 (default: 0s)</b></DT><DD>
 
 <p> The default amount of delay that is inserted between individual
-deliveries over the same message delivery transport, regardless of
-destination. If non-zero, all deliveries over the same message
-delivery transport will happen one at a time. </p>
+message deliveries over the same message delivery transport,
+regardless of destination. Specify a non-zero value to rate-limit
+those message deliveries to at most one per $<a href="postconf.5.html#default_transport_rate_delay">default_transport_rate_delay</a>.
+</p>
 
 <p>Use <a href="postconf.5.html#transport_transport_rate_delay"><i>transport</i>_transport_rate_delay</a> to specify a
 transport-specific override, where the initial <i>transport</i> is
index fb0f6ed1916bd66eb4b889e2e8eacc45b292d47b..b55a9a9e78cfa99129a586455ed327beb02b29e1 100644 (file)
@@ -1451,8 +1451,9 @@ is the master.cf name of the message delivery transport.
 This feature is available in Postfix 2.5 and later.
 .SH default_destination_rate_delay (default: 0s)
 The default amount of delay that is inserted between individual
-deliveries to the same destination. If non\-zero, all deliveries to
-the same destination will happen one at a time.
+message deliveries to the same destination and over the same message
+delivery transport. Specify a non\-zero value to rate\-limit those
+message deliveries to at most one per $default_destination_rate_delay.
 .PP
 The resulting behavior depends on the value of the corresponding
 per\-destination recipient limit.
@@ -1710,9 +1711,9 @@ default_transport = uucp:relayhostname
 .ft R
 .SH default_transport_rate_delay (default: 0s)
 The default amount of delay that is inserted between individual
-deliveries over the same message delivery transport, regardless of
-destination. If non\-zero, all deliveries over the same message
-delivery transport will happen one at a time.
+message deliveries over the same message delivery transport,
+regardless of destination. Specify a non\-zero value to rate\-limit
+those message deliveries to at most one per $default_transport_rate_delay.
 .PP
 Use \fItransport\fR_transport_rate_delay to specify a
 transport\-specific override, where the initial \fItransport\fR is
index 072022c67195a140b782819da754b4aa4862239d..66f8f87707a257a6594cc3108d4281af783f614d 100644 (file)
@@ -714,16 +714,25 @@ 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
-connection with a 421 status code and logs: </p>
+postscreen(8) rejects the connection with a 421 status code and logs: </p>
 
 <pre>
     <b>NOQUEUE: reject: CONNECT from</b> <i>[address]:port</i><b>: too many connections</b>
+</pre>
+
+<p> The postscreen_client_connection_count_limit parameter controls this limit. </p>
+
+<p> When an SMTP client connects after postscreen(8) has reached a
+connection count limit, postscreen(8) rejects the connection with
+a 421 status code and logs: </p>
+
+<pre>
+    <b>NOQUEUE: reject: CONNECT from</b> <i>[address]:port</i><b>: all screening ports busy</b>
     <b>NOQUEUE: reject: CONNECT from</b> <i>[address]:port</i><b>: all server ports busy</b>
 </pre>
 
-<p> The postscreen_client_connection_count_limit and
-postscreen_pre_queue_limit parameters control these limits.  </p>
+<p> The postscreen_pre_queue_limit and postscreen_post_queue_limit
+parameters control these limits.  </p>
 
 <h2> <a name="victory">When all tests succeed</a> </h2>
 
index 933e07107af78a99f5f3145829a99bc1467cac93..7833e2a3a8064b283c76957f7b05577f21277792 100644 (file)
@@ -13305,9 +13305,10 @@ this case: "_recipient_refill_delay").  </p>
 %PARAM default_transport_rate_delay 0s
 
 <p> The default amount of delay that is inserted between individual
-deliveries over the same message delivery transport, regardless of
-destination. If non-zero, all deliveries over the same message
-delivery transport will happen one at a time. </p>
+message deliveries over the same message delivery transport,
+regardless of destination. Specify a non-zero value to rate-limit
+those message deliveries to at most one per $default_transport_rate_delay.
+</p>
 
 <p>Use <i>transport</i>_transport_rate_delay to specify a
 transport-specific override, where the initial <i>transport</i> is
@@ -13341,8 +13342,10 @@ name is the master.cf name of the message delivery transport. </p>
 %PARAM default_destination_rate_delay 0s
 
 <p> The default amount of delay that is inserted between individual
-deliveries to the same destination. If non-zero, all deliveries to
-the same destination will happen one at a time. </p>
+message deliveries to the same destination and over the same message
+delivery transport. Specify a non-zero value to rate-limit those
+message deliveries to at most one per $default_destination_rate_delay.
+</p>
 
 <p> The resulting behavior depends on the value of the corresponding
 per-destination recipient limit.
index d7428cc0735aa4b150239a33057dd567004e1301..f1165b348ecc18f76b4447ba0ee8701e3dba6bf5 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      "20181202"
+#define MAIL_RELEASE_DATE      "20181226"
 #define MAIL_VERSION_NUMBER    "3.4"
 
 #ifdef SNAPSHOT
index 4c7248f65b9d347451c038b106b62d908cf8e39d..0f9d41817a8b6891a14a055294e1db758968840a 100644 (file)
@@ -456,6 +456,11 @@ extern HTABLE *psc_client_concurrency;     /* per-client concurrency */
        (state)->smtp_server_fd = (fd); \
        psc_post_queue_length++; \
     } while (0)
+#define PSC_DEL_SERVER_STATE(state) do { \
+       close((state)->smtp_server_fd); \
+       (state)->smtp_server_fd = (-1); \
+       psc_post_queue_length--; \
+    } while (0)
 #define PSC_DEL_CLIENT_STATE(state) do { \
        event_server_disconnect((state)->smtp_client_stream); \
        (state)->smtp_client_stream = 0; \
index aced47d6337e43c2ea88eafe01041d9bfec83a33..5f610e6a9af6c76b4136915a455ee065dd7ed580 100644 (file)
@@ -25,6 +25,9 @@
 /*     PSC_STATE *state;
 /*     int     server_fd;
 /*
+/*     void    PSC_DEL_SERVER_STATE(state)
+/*     PSC_STATE *state;
+/*
 /*     void    PSC_DEL_CLIENT_STATE(state)
 /*     PSC_STATE *state;
 /*
 /*     increments the global psc_post_queue_length file descriptor
 /*     counter.
 /*
+/*     PSC_DEL_SERVER_STATE() closes the specified session state
+/*     object's server file descriptor, and decrements the global
+/*     psc_post_queue_length file descriptor counter.
+/*
 /*     PSC_DEL_CLIENT_STATE() updates the specified session state
 /*     object, closes the client stream, and decrements the global
 /*     psc_check_queue_length file descriptor counter.
@@ -227,12 +234,10 @@ void    psc_free_session_state(PSC_STATE *state)
        htable_delete(psc_client_concurrency, state->smtp_client_addr, myfree);
 
     if (state->smtp_client_stream != 0) {
-       event_server_disconnect(state->smtp_client_stream);
-       psc_check_queue_length--;
+       PSC_DEL_CLIENT_STATE(state);
     }
     if (state->smtp_server_fd >= 0) {
-       close(state->smtp_server_fd);
-       psc_post_queue_length--;
+       PSC_DEL_SERVER_STATE(state);
     }
     if (state->send_buf != 0)
        state->send_buf = vstring_free(state->send_buf);
index b669308e77ce9227e9d4f3b51891c63263fe6c9f..92ad87f9a8ac7ddd0d0844c58bf732f95c115a59 100644 (file)
@@ -1536,7 +1536,7 @@ static int connect_dest(STATE *state)
      */
     if (state->smtp == 0) {
        if (strncmp(dest, "unix:", 5) == 0) {
-           connect_unix(state, dest + 5);
+           state->stream = connect_unix(state, dest + 5);
            if (!state->stream)
                msg_info("Failed to establish session to %s: %s",
                         dest, vstring_str(state->why->reason));
index 57a84dea351782e1d32fb1c3cad16682a3dc67ca..e59842a31a4ea771c85515d386c351fd5108ff33 100644 (file)
@@ -95,40 +95,40 @@ VSTRING *dict_file_to_buf(DICT *dict, const char *pathnames)
     if (dict->file_buf == 0)
        dict->file_buf = vstring_alloc(100);
 
-#define DICT_FILE_ERR_RETURN do { \
+#define DICT_FILE_RETURN(retval) do { \
        argv_free(argv); \
        if (fp) vstream_fclose(fp); \
-       return (0); \
+       return (retval); \
     } while (0);
 
     argv = argv_split(pathnames, CHARS_COMMA_SP);
     if (argv->argc == 0) {
        vstring_sprintf(dict->file_buf, "empty pathname list: >>%s<<'",
                        pathnames);
-       DICT_FILE_ERR_RETURN;
+       DICT_FILE_RETURN(0);
     }
     VSTRING_RESET(dict->file_buf);
     for (cpp = argv->argv; *cpp; cpp++) {
        if ((fp = vstream_fopen(*cpp, O_RDONLY, 0)) == 0
            || fstat(vstream_fileno(fp), &st) < 0) {
            vstring_sprintf(dict->file_buf, "open %s: %m", *cpp);
-           DICT_FILE_ERR_RETURN;
+           DICT_FILE_RETURN(0);
        }
        if (st.st_size > SSIZE_T_MAX - LEN(dict->file_buf)) {
            vstring_sprintf(dict->file_buf, "file too large: %s", pathnames);
-           DICT_FILE_ERR_RETURN;
+           DICT_FILE_RETURN(0);
        }
        if (vstream_fread_app(fp, dict->file_buf, st.st_size) != st.st_size) {
            vstring_sprintf(dict->file_buf, "read %s: %m", *cpp);
-           DICT_FILE_ERR_RETURN;
+           DICT_FILE_RETURN(0);
        }
        (void) vstream_fclose(fp);
+       fp = 0;
        if (cpp[1] != 0)
            VSTRING_ADDCH(dict->file_buf, '\n');
     }
-    argv_free(argv);
     VSTRING_TERMINATE(dict->file_buf);
-    return (dict->file_buf);
+    DICT_FILE_RETURN(dict->file_buf);
 }
 
 /* dict_file_to_b64 - read files into a base64-encoded buffer */