2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-08-29 13:18:12 +00:00

postfix-3.7-20211023

This commit is contained in:
Wietse Venema 2021-10-23 00:00:00 -05:00 committed by Viktor Dukhovni
parent 6b8941f03e
commit a677a91e79
6 changed files with 209 additions and 176 deletions

View File

@ -25815,3 +25815,14 @@ Apologies for any names omitted.
config_known_tcp_ports.c, mail_params.c, config_known_tcp_ports.c, mail_params.c,
posttls-finger/posttls-finger.c, smtp/smtp_connect.c, posttls-finger/posttls-finger.c, smtp/smtp_connect.c,
util/find_inet.c, util/myaddrinfo.c. util/find_inet.c, util/myaddrinfo.c.
20211023
Documentation: fixed a jq example in the postsuper manpage, to
delete the quotes around a queue ID. File: postsuper/postsuper.c.
Cleanup: with "smtputf8_nable = yes" (the default), the
postscreen(8) dummy SMTP engine will no longer log a "non-UTF-8
key" warning when a remote SMTP client sends garbage. Instead,
postscreen(8) will reject the command with the same server
repsonse as smtpd(8). File: postscreen/p[ostscreen_smtpd.c.

View File

@ -49,7 +49,7 @@ POSTSUPER(1) POSTSUPER(1)
select(.recipients[0].address == "user@example.com") select(.recipients[0].address == "user@example.com")
| select(.recipients[1].address == null) | select(.recipients[1].address == null)
| .queue_id | .queue_id
' | postsuper -d - ' | tr -d '"' | postsuper -d -
Or the historical form: Or the historical form:

View File

@ -51,7 +51,7 @@ postqueue \-j | jq '
select(.recipients[0].address == "user@example.com") select(.recipients[0].address == "user@example.com")
| select(.recipients[1].address == null) | select(.recipients[1].address == null)
| .queue_id | .queue_id
' | postsuper \-d \- ' | tr \-d '"' | postsuper \-d \-
.fi .fi
.sp .sp
Or the historical form: Or the historical form:

View File

@ -20,7 +20,7 @@
* Patches change both the patchlevel and the release date. Snapshots have no * Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only. * patchlevel; they change the release date only.
*/ */
#define MAIL_RELEASE_DATE "20211022" #define MAIL_RELEASE_DATE "20211023"
#define MAIL_VERSION_NUMBER "3.7" #define MAIL_VERSION_NUMBER "3.7"
#ifdef SNAPSHOT #ifdef SNAPSHOT

View File

@ -794,6 +794,7 @@ static void psc_smtpd_read_event(int event, void *context)
char *command; char *command;
const PSC_SMTPD_COMMAND *cmdp; const PSC_SMTPD_COMMAND *cmdp;
int write_stat; int write_stat;
int skip_command_processing;
if (msg_verbose > 1) if (msg_verbose > 1)
msg_info("%s: sq=%d cq=%d event %d on smtp socket %d from [%s]:%s flags=%s", msg_info("%s: sq=%d cq=%d event %d on smtp socket %d from [%s]:%s flags=%s",
@ -929,8 +930,22 @@ static void psc_smtpd_read_event(int event, void *context)
} }
/* /*
* Terminate the command buffer, and apply the last-resort command * As in smtpd(8), reject malformed UTF-8 when "smtputf8_enable =
* editing workaround. * yes". This also avoids noisy "non-UTF-8 key" warnings from
* dict_utf8 infrastructure.
*
* Caution: do not skip all code in the remainder of this loop.
*/
if ((skip_command_processing = (var_smtputf8_enable
&& !valid_utf8_string(STR(state->cmd_buffer),
LEN(state->cmd_buffer))))) {
write_stat = PSC_SEND_REPLY(state,
"500 5.5.2 Error: bad UTF-8 syntax");
} else {
/*
* Terminate the command buffer, and apply the last-resort
* command editing workaround.
*/ */
VSTRING_TERMINATE(state->cmd_buffer); VSTRING_TERMINATE(state->cmd_buffer);
if (psc_cmd_filter != 0) { if (psc_cmd_filter != 0) {
@ -949,6 +964,7 @@ static void psc_smtpd_read_event(int event, void *context)
STR(state->cmd_buffer)); STR(state->cmd_buffer));
} }
} }
}
/* /*
* Reset the command buffer write pointer and state machine in * Reset the command buffer write pointer and state machine in
@ -959,12 +975,14 @@ static void psc_smtpd_read_event(int event, void *context)
state->read_state = PSC_SMTPD_CMD_ST_ANY; state->read_state = PSC_SMTPD_CMD_ST_ANY;
VSTRING_RESET(state->cmd_buffer); VSTRING_RESET(state->cmd_buffer);
if (skip_command_processing == 0) {
/* /*
* Process the command line. * Process the command line.
* *
* Caution: some command handlers terminate the session and destroy the * Caution: some command handlers terminate the session and destroy
* session state structure. When this happens we must leave the SMTP * the session state structure. When this happens we must leave
* engine to avoid a dangling pointer problem. * the SMTP engine to avoid a dangling pointer problem.
*/ */
cmd_buffer_ptr = STR(state->cmd_buffer); cmd_buffer_ptr = STR(state->cmd_buffer);
if (msg_verbose) if (msg_verbose)
@ -1078,9 +1096,9 @@ static void psc_smtpd_read_event(int event, void *context)
} }
/* /*
* The following tests don't pass until the client gets all the way * The following tests don't pass until the client gets all the
* to the RCPT TO command. However, the client can still fail these * way to the RCPT TO command. However, the client can still fail
* tests with some later command. * these tests with some later command.
*/ */
if (cmdp->action == psc_rcpt_cmd) { if (cmdp->action == psc_rcpt_cmd) {
if ((state->flags & PSC_STATE_MASK_BARLF_TODO_PASS_FAIL) if ((state->flags & PSC_STATE_MASK_BARLF_TODO_PASS_FAIL)
@ -1088,21 +1106,24 @@ static void psc_smtpd_read_event(int event, void *context)
PSC_PASS_SESSION_STATE(state, "bare newline test", PSC_PASS_SESSION_STATE(state, "bare newline test",
PSC_STATE_FLAG_BARLF_PASS); PSC_STATE_FLAG_BARLF_PASS);
/* XXX Reset to PSC_TIME_STAMP_DISABLED on failure. */ /* XXX Reset to PSC_TIME_STAMP_DISABLED on failure. */
expire_time[PSC_TINDX_BARLF] = event_time() + var_psc_barlf_ttl; expire_time[PSC_TINDX_BARLF] = event_time()
+ var_psc_barlf_ttl;
} }
if ((state->flags & PSC_STATE_MASK_NSMTP_TODO_PASS_FAIL) if ((state->flags & PSC_STATE_MASK_NSMTP_TODO_PASS_FAIL)
== PSC_STATE_FLAG_NSMTP_TODO) { == PSC_STATE_FLAG_NSMTP_TODO) {
PSC_PASS_SESSION_STATE(state, "non-smtp test", PSC_PASS_SESSION_STATE(state, "non-smtp test",
PSC_STATE_FLAG_NSMTP_PASS); PSC_STATE_FLAG_NSMTP_PASS);
/* XXX Reset to PSC_TIME_STAMP_DISABLED on failure. */ /* XXX Reset to PSC_TIME_STAMP_DISABLED on failure. */
expire_time[PSC_TINDX_NSMTP] = event_time() + var_psc_nsmtp_ttl; expire_time[PSC_TINDX_NSMTP] = event_time()
+ var_psc_nsmtp_ttl;
} }
if ((state->flags & PSC_STATE_MASK_PIPEL_TODO_PASS_FAIL) if ((state->flags & PSC_STATE_MASK_PIPEL_TODO_PASS_FAIL)
== PSC_STATE_FLAG_PIPEL_TODO) { == PSC_STATE_FLAG_PIPEL_TODO) {
PSC_PASS_SESSION_STATE(state, "pipelining test", PSC_PASS_SESSION_STATE(state, "pipelining test",
PSC_STATE_FLAG_PIPEL_PASS); PSC_STATE_FLAG_PIPEL_PASS);
/* XXX Reset to PSC_TIME_STAMP_DISABLED on failure. */ /* XXX Reset to PSC_TIME_STAMP_DISABLED on failure. */
expire_time[PSC_TINDX_PIPEL] = event_time() + var_psc_pipel_ttl; expire_time[PSC_TINDX_PIPEL] = event_time()
+ var_psc_pipel_ttl;
} }
} }
/* Command COUNT limit test. */ /* Command COUNT limit test. */
@ -1128,6 +1149,7 @@ static void psc_smtpd_read_event(int event, void *context)
if (cmdp->flags & PSC_SMTPD_CMD_FLAG_DESTROY) if (cmdp->flags & PSC_SMTPD_CMD_FLAG_DESTROY)
return; return;
} }
}
/* /*
* Terminate the session after a write error. * Terminate the session after a write error.

View File

@ -45,7 +45,7 @@
/* select(.recipients[0].address == "user@example.com") /* select(.recipients[0].address == "user@example.com")
/* | select(.recipients[1].address == null) /* | select(.recipients[1].address == null)
/* | .queue_id /* | .queue_id
/* ' | postsuper -d - /* ' | tr -d '"' | postsuper -d -
/* .fi /* .fi
/* .sp /* .sp
/* Or the historical form: /* Or the historical form: