diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-12-12 16:10:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-12-12 16:10:49 +0000 |
commit | 4bf2526f886d71a067a1004ee5be2b75d0f721f7 (patch) | |
tree | 6d07da5e11537220569c748c2af66ae9db991d15 /src | |
parent | Releasing progress-linux version 3.9.0-2~progress7.99u1. (diff) | |
download | postfix-4bf2526f886d71a067a1004ee5be2b75d0f721f7.tar.xz postfix-4bf2526f886d71a067a1004ee5be2b75d0f721f7.zip |
Merging upstream version 3.9.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/cleanup/cleanup_message.c | 10 | ||||
-rw-r--r-- | src/global/mail_version.h | 4 | ||||
-rw-r--r-- | src/global/maillog_client.c | 19 | ||||
-rw-r--r-- | src/smtpd/smtpd_check.c | 12 | ||||
-rw-r--r-- | src/util/msg_logger.c | 6 | ||||
-rw-r--r-- | src/xsasl/xsasl_dovecot_server.c | 1 |
6 files changed, 35 insertions, 17 deletions
diff --git a/src/cleanup/cleanup_message.c b/src/cleanup/cleanup_message.c index 0d31598..d5b1271 100644 --- a/src/cleanup/cleanup_message.c +++ b/src/cleanup/cleanup_message.c @@ -723,8 +723,9 @@ static void cleanup_header_done_callback(void *context) vstring_sprintf(state->temp1, "%s.%s@%s", time_stamp, state->queue_id, var_myhostname); } - cleanup_out_format(state, REC_TYPE_NORM, "%sMessage-Id: <%s>", - state->resent, vstring_str(state->temp1)); + vstring_sprintf(state->temp2, "%sMessage-Id: <%s>", + state->resent, vstring_str(state->temp1)); + cleanup_out_header(state, state->temp2); msg_info("%s: %smessage-id=<%s>", state->queue_id, *state->resent ? "resent-" : "", vstring_str(state->temp1)); @@ -741,8 +742,9 @@ static void cleanup_header_done_callback(void *context) if ((state->hdr_rewrite_context || var_always_add_hdrs) && (state->headers_seen & (1 << (state->resent[0] ? HDR_RESENT_DATE : HDR_DATE))) == 0) { - cleanup_out_format(state, REC_TYPE_NORM, "%sDate: %s", + vstring_sprintf(state->temp2, "%sDate: %s", state->resent, mail_date(state->arrival_time.tv_sec)); + cleanup_out_header(state, state->temp2); } /* @@ -805,7 +807,7 @@ static void cleanup_header_done_callback(void *context) vstring_sprintf(state->temp2, "%sFrom: %s", state->resent, vstring_str(state->temp1)); } - CLEANUP_OUT_BUF(state, REC_TYPE_NORM, state->temp2); + cleanup_out_header(state, state->temp2); } /* diff --git a/src/global/mail_version.h b/src/global/mail_version.h index 9e08896..bbd5d21 100644 --- a/src/global/mail_version.h +++ b/src/global/mail_version.h @@ -20,8 +20,8 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "20240306" -#define MAIL_VERSION_NUMBER "3.9" +#define MAIL_RELEASE_DATE "20241204" +#define MAIL_VERSION_NUMBER "3.9.1" #ifdef SNAPSHOT #define MAIL_VERSION_DATE "-" MAIL_RELEASE_DATE diff --git a/src/global/maillog_client.c b/src/global/maillog_client.c index 34952ef..a6e8436 100644 --- a/src/global/maillog_client.c +++ b/src/global/maillog_client.c @@ -120,6 +120,7 @@ static int maillog_client_flags; static void maillog_client_logwriter_fallback(const char *text) { static int fallback_guard = 0; + static VSTREAM *fp; /* * Guard against recursive calls. @@ -129,10 +130,20 @@ static void maillog_client_logwriter_fallback(const char *text) * logfile. All we can do is to hope that stderr logging will bring out * the bad news. */ - if (fallback_guard == 0 && var_maillog_file && *var_maillog_file - && logwriter_one_shot(var_maillog_file, text, strlen(text)) < 0) { - fallback_guard = 1; - msg_fatal("logfile '%s' write error: %m", var_maillog_file); + if (fallback_guard++ == 0 && var_maillog_file && *var_maillog_file) { + if (text == 0 && fp != 0) { + (void) vstream_fclose(fp); + fp = 0; + } + if (fp == 0) { + fp = logwriter_open_or_die(var_maillog_file); + close_on_exec(vstream_fileno(fp), CLOSE_ON_EXEC); + } + if (text && (logwriter_write(fp, text, strlen(text)) != 0 || + vstream_fflush(fp) != 0)) { + msg_fatal("logfile '%s' write error: %m", var_maillog_file); + } + fallback_guard = 0; } } diff --git a/src/smtpd/smtpd_check.c b/src/smtpd/smtpd_check.c index 6aeda74..b63b214 100644 --- a/src/smtpd/smtpd_check.c +++ b/src/smtpd/smtpd_check.c @@ -4674,13 +4674,11 @@ static int generic_checks(SMTPD_STATE *state, ARGV *restrictions, cpp[1], CHECK_RELAY_DOMAINS); } else if (strcasecmp(name, PERMIT_SASL_AUTH) == 0) { #ifdef USE_SASL_AUTH - if (smtpd_sasl_is_active(state)) { - status = permit_sasl_auth(state, - SMTPD_CHECK_OK, SMTPD_CHECK_DUNNO); - if (status == SMTPD_CHECK_OK) - status = smtpd_acl_permit(state, name, SMTPD_NAME_CLIENT, - state->namaddr, NO_PRINT_ARGS); - } + status = permit_sasl_auth(state, + SMTPD_CHECK_OK, SMTPD_CHECK_DUNNO); + if (status == SMTPD_CHECK_OK) + status = smtpd_acl_permit(state, name, SMTPD_NAME_CLIENT, + state->namaddr, NO_PRINT_ARGS); #endif } else if (strcasecmp(name, PERMIT_TLS_ALL_CLIENTCERTS) == 0) { status = permit_tls_clientcerts(state, 1); diff --git a/src/util/msg_logger.c b/src/util/msg_logger.c index 07c9e92..2d813d3 100644 --- a/src/util/msg_logger.c +++ b/src/util/msg_logger.c @@ -59,6 +59,9 @@ /* Override the fallback setting (see above) with the specified /* function pointer. This remains in effect until the next /* msg_logger_init() or msg_logger_control() call. +/* When the function is called with a null argument, it should +/* allocate resources immediately. This is needed in programs +/* that drop privileges after process initialization. /* .IP CA_MSG_LOGGER_CTL_DISABLE /* Disable the msg_logger. This remains in effect until the /* next msg_logger_init() call. @@ -320,6 +323,9 @@ void msg_logger_control(int name,...) msg_logger_disconnect(); if (MSG_LOGGER_NEED_SOCKET()) msg_logger_connect(); + if (msg_logger_sock == MSG_LOGGER_SOCK_NONE + && msg_logger_fallback_fn) + msg_logger_fallback_fn((char *) 0); break; default: msg_panic("%s: bad name %d", myname, name); diff --git a/src/xsasl/xsasl_dovecot_server.c b/src/xsasl/xsasl_dovecot_server.c index 4a0c085..ac93a2d 100644 --- a/src/xsasl/xsasl_dovecot_server.c +++ b/src/xsasl/xsasl_dovecot_server.c @@ -297,6 +297,7 @@ static int xsasl_dovecot_server_connect(XSASL_DOVECOT_SERVER_IMPL *xp) (unsigned int) getpid()); if (vstream_fflush(sasl_stream) == VSTREAM_EOF) { msg_warn("SASL: Couldn't send handshake: %m"); + (void) vstream_fclose(sasl_stream); return (-1); } success = 0; |