From 426ff88c97805d5359804bcfd7186dcd2c9fbf47 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 10:42:06 +0200 Subject: Merging upstream version 3.9.0. Signed-off-by: Daniel Baumann --- src/bounce/bounce_notify_util.c | 13 +++++-------- src/bounce/with-msgid-with-filter-no-thread.ref | 2 +- src/bounce/with-msgid-with-filter-with-thread.ref | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) (limited to 'src/bounce') diff --git a/src/bounce/bounce_notify_util.c b/src/bounce/bounce_notify_util.c index 781a525..2482359 100644 --- a/src/bounce/bounce_notify_util.c +++ b/src/bounce/bounce_notify_util.c @@ -773,15 +773,14 @@ int bounce_header_dsn(VSTREAM *bounce, BOUNCE_INFO *bounce_info) post_mail_fprintf(bounce, "X-%s-Queue-ID: %s", bounce_info->mail_name, bounce_info->queue_id); -#define IS_UTF8_ADDRESS(str, len) \ - ((str)[0] != 0 && !allascii(str) && valid_utf8_string((str), (len))) +#define IS_UTF8_ADDRESS(str) \ + ((str)[0] != 0 && !allascii(str) && valid_utf8_stringz(str)) /* Fix 20140708: use "utf-8" or "rfc822" as appropriate. */ if (VSTRING_LEN(bounce_info->sender) > 0) post_mail_fprintf(bounce, "X-%s-Sender: %s; %s", bounce_info->mail_name, bounce_info->smtputf8 - && IS_UTF8_ADDRESS(STR(bounce_info->sender), - VSTRING_LEN(bounce_info->sender)) ? + && IS_UTF8_ADDRESS(STR(bounce_info->sender)) ? "utf-8" : "rfc822", STR(bounce_info->sender)); if (bounce_info->arrival_time > 0) post_mail_fprintf(bounce, "Arrival-Date: %s", @@ -800,8 +799,7 @@ int bounce_recipient_dsn(VSTREAM *bounce, BOUNCE_INFO *bounce_info) /* Fix 20140708: Don't send "utf-8" type with non-UTF8 address. */ post_mail_fprintf(bounce, "Final-Recipient: %s; %s", bounce_info->smtputf8 - && IS_UTF8_ADDRESS(rcpt->address, - strlen(rcpt->address)) ? + && IS_UTF8_ADDRESS(rcpt->address) ? "utf-8" : "rfc822", rcpt->address); /* @@ -829,8 +827,7 @@ int bounce_recipient_dsn(VSTREAM *bounce, BOUNCE_INFO *bounce_info) /* Fix 20140708: Don't send "utf-8" type with non-UTF8 address. */ post_mail_fprintf(bounce, "Original-Recipient: %s; %s", bounce_info->smtputf8 - && IS_UTF8_ADDRESS(rcpt->orig_addr, - strlen(rcpt->orig_addr)) ? + && IS_UTF8_ADDRESS(rcpt->orig_addr) ? "utf-8" : "rfc822", rcpt->orig_addr); } post_mail_fprintf(bounce, "Action: %s", diff --git a/src/bounce/with-msgid-with-filter-no-thread.ref b/src/bounce/with-msgid-with-filter-no-thread.ref index fa30ddf..adcd507 100644 --- a/src/bounce/with-msgid-with-filter-no-thread.ref +++ b/src/bounce/with-msgid-with-filter-no-thread.ref @@ -24,7 +24,7 @@ Reporting-MTA: dns; mail.example Original-Envelope-Id: TEST-ENVID X-Postfix-Queue-ID: msgid X-Postfix-Sender: rfc822; sender@sender.example -Arrival-Date: Sat, 5 Dec 2020 13:31:48 -0500 (EST) +Arrival-Date: Sat, 05 Dec 2020 13:31:48 -0500 (EST) Final-Recipient: rfc822; rcpt-address Original-Recipient: rfc822; rcpt-orig_addr diff --git a/src/bounce/with-msgid-with-filter-with-thread.ref b/src/bounce/with-msgid-with-filter-with-thread.ref index 14d3373..ec3de87 100644 --- a/src/bounce/with-msgid-with-filter-with-thread.ref +++ b/src/bounce/with-msgid-with-filter-with-thread.ref @@ -26,7 +26,7 @@ Reporting-MTA: dns; mail.example Original-Envelope-Id: TEST-ENVID X-Postfix-Queue-ID: msgid X-Postfix-Sender: rfc822; sender@sender.example -Arrival-Date: Sat, 5 Dec 2020 13:31:48 -0500 (EST) +Arrival-Date: Sat, 05 Dec 2020 13:31:48 -0500 (EST) Final-Recipient: rfc822; rcpt-address Original-Recipient: rfc822; rcpt-orig_addr -- cgit v1.2.3