2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-08-22 09:57:34 +00:00

postfix-3.11-20250818

This commit is contained in:
Wietse Z Venema 2025-08-18 00:00:00 -05:00 committed by Viktor Dukhovni
parent 5c253cc5c9
commit 8d1e60ee70
3 changed files with 20 additions and 1 deletions

View File

@ -29568,3 +29568,10 @@ Apologies for any names omitted.
documentation. This will be back-ported to Postfix 3.10. documentation. This will be back-ported to Postfix 3.10.
Files: Makefile.in, smtp/smtp.h smtp/smtp_connect.c, Files: Makefile.in, smtp/smtp.h smtp/smtp_connect.c,
smtp/smtp_tls_policy.c, proto/postconf.proto. smtp/smtp_tls_policy.c, proto/postconf.proto.
20250816
Bugfix (defect introduced: Postfix 3.0, date 20140731): the
smtpd 'disconnect' command counts did not count malformed
commands with "bad syntax" and "bad UTF-8 syntax" errors.
File: smtpd/smtpd.c.

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 "20250808" #define MAIL_RELEASE_DATE "20250818"
#define MAIL_VERSION_NUMBER "3.11" #define MAIL_VERSION_NUMBER "3.11"
#ifdef SNAPSHOT #ifdef SNAPSHOT

View File

@ -5639,6 +5639,13 @@ static SMTPD_CMD smtpd_cmd_table[] = {
{0,}, {0,},
}; };
/*
* In addition to counting unknown commands, the last table element also
* counts malformed commands (which aren't looked up in the command table).
*/
#define LAST_TABLE_PTR(table) ((table) + sizeof(table)/sizeof(*(table)) - 1)
static SMTPD_CMD *smtpd_cmdp_unknown = LAST_TABLE_PTR(smtpd_cmd_table);
static STRING_LIST *smtpd_noop_cmds; static STRING_LIST *smtpd_noop_cmds;
static STRING_LIST *smtpd_forbid_cmds; static STRING_LIST *smtpd_forbid_cmds;
@ -6007,6 +6014,8 @@ static void smtpd_proto(SMTPD_STATE *state)
state->error_mask |= MAIL_ERROR_PROTOCOL; state->error_mask |= MAIL_ERROR_PROTOCOL;
smtpd_chat_reply(state, "500 5.5.2 Error: bad UTF-8 syntax"); smtpd_chat_reply(state, "500 5.5.2 Error: bad UTF-8 syntax");
state->error_count++; state->error_count++;
state->where = SMTPD_CMD_UNKNOWN;
smtpd_cmdp_unknown->total_count += 1;
continue; continue;
} }
/* Move into smtpd_chat_query() and update session transcript. */ /* Move into smtpd_chat_query() and update session transcript. */
@ -6028,6 +6037,8 @@ static void smtpd_proto(SMTPD_STATE *state)
state->error_mask |= MAIL_ERROR_PROTOCOL; state->error_mask |= MAIL_ERROR_PROTOCOL;
smtpd_chat_reply(state, "500 5.5.2 Error: bad syntax"); smtpd_chat_reply(state, "500 5.5.2 Error: bad syntax");
state->error_count++; state->error_count++;
state->where = SMTPD_CMD_UNKNOWN;
smtpd_cmdp_unknown->total_count += 1;
continue; continue;
} }
/* Ignore smtpd_noop_cmds lookup errors. Non-critical feature. */ /* Ignore smtpd_noop_cmds lookup errors. Non-critical feature. */
@ -6036,6 +6047,7 @@ static void smtpd_proto(SMTPD_STATE *state)
smtpd_chat_reply(state, "250 2.0.0 Ok"); smtpd_chat_reply(state, "250 2.0.0 Ok");
if (state->junk_cmds++ > var_smtpd_junk_cmd_limit) if (state->junk_cmds++ > var_smtpd_junk_cmd_limit)
state->error_count++; state->error_count++;
/* XXX We can't count these. */
continue; continue;
} }
for (cmdp = smtpd_cmd_table; cmdp->name != 0; cmdp++) for (cmdp = smtpd_cmd_table; cmdp->name != 0; cmdp++)