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.
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
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>
(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.
(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
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.
.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
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>
%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
%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.
* 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
(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; \
/* 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.
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);
*/
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));
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 */