From 1d19531abc45f656eff8f3dd5ba6986d919fee11 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sun, 19 Nov 2023 11:31:45 +0000 Subject: [PATCH] Support old-format message_id spoolfiles for mailq / -bp. Bug 3050 Broken-by: 46a36afae41f --- doc/doc-txt/ChangeLog | 3 +++ src/src/queue.c | 8 ++++++-- test/runtest | 4 +++- test/scripts/0000-Basic/0611 | 2 +- test/scripts/0000-Basic/0699 | 5 ++++- test/stderr/0699 | 10 ---------- test/stdout/0699 | 3 +++ 7 files changed, 20 insertions(+), 15 deletions(-) delete mode 100644 test/stderr/0699 diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 8722e109f..9ab50f08d 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -36,6 +36,9 @@ JH/06 Bug 3054: Fix dnsdb lookup for a TXT record with multiple chunks, with a chunk-separator specification. This was broken by hardening introduced for Bug 3031. +JH/07 Bug 3050: Fix -bp for old message_id format spoolfiles. Previously it + included the -H with the id; this also messed up exiqgrep. + Exim version 4.97 diff --git a/src/src/queue.c b/src/src/queue.c index deedcde6f..2c3d014f5 100644 --- a/src/src/queue.c +++ b/src/src/queue.c @@ -961,7 +961,9 @@ each time. */ if (option == QL_MSGID_ONLY) /* Print only the message IDs from the chain */ for (; qf; qf = qf->next) - fprintf(stdout, "%.*s\n", MESSAGE_ID_LENGTH, qf->text); + fprintf(stdout, "%.*s\n", + is_old_message_id(qf->text) ? MESSAGE_ID_LENGTH_OLD : MESSAGE_ID_LENGTH, + qf->text); else for (; qf && (reset_point = store_mark()); @@ -1021,7 +1023,9 @@ else for (; } fprintf(stdout, "%s %.*s", - string_format_size(size, big_buffer), MESSAGE_ID_LENGTH, qf->text); + string_format_size(size, big_buffer), + is_old_message_id(qf->text) ? MESSAGE_ID_LENGTH_OLD : MESSAGE_ID_LENGTH, + qf->text); if (env_read && sender_address) { diff --git a/test/runtest b/test/runtest index 24f80d3a4..8628ff299 100755 --- a/test/runtest +++ b/test/runtest @@ -1073,7 +1073,9 @@ RESET_AFTER_EXTRA_LINE_READ: s/250-AUTH ANONYMOUS PLAIN SCRAM-SHA-1\K SCRAM-SHA-256//; # mailq times change with when the run is done, vs. static-source spoolfiles - s/\s*\d*[hd](?= 317 [0-9A-Za-z\-]{23} )/DDd/; + s/\s*\d*[hd](?= 317 (?:[-0-9A-Za-z]{23}|[-0-9A-Za-z]{16}) )/DDd/; + # mailq sizes change with caller running the test + s/\s[01]m [34]\d\d(?= (?:[-0-9A-Za-z]{23}|[-0-9A-Za-z]{16}) )/ 1m 396/; # Not all builds include EXPERIMENTAL_DSN_INFO (1 of 2) if (/^X-Exim-Diagnostic:/) diff --git a/test/scripts/0000-Basic/0611 b/test/scripts/0000-Basic/0611 index 40d08fcf1..d032d6616 100644 --- a/test/scripts/0000-Basic/0611 +++ b/test/scripts/0000-Basic/0611 @@ -1,4 +1,4 @@ -# max_parallel on transport +# max_parallel on transport; exiqgrep need_ipv4 # # Remote transport: diff --git a/test/scripts/0000-Basic/0699 b/test/scripts/0000-Basic/0699 index 5dbcd38b8..7bc0ecbe2 100644 --- a/test/scripts/0000-Basic/0699 +++ b/test/scripts/0000-Basic/0699 @@ -1,6 +1,6 @@ # message ID format manipulation # This testcase is for the 4.97 message-id format changeover -# should can be dropped after a few further releases. +# should be dropped after a few further releases. # # Ensure spooldir exists sudo mkdir -p DIR/spool/input @@ -9,6 +9,8 @@ sudo mkdir -p DIR/spool/input sudo cp DIR/aux-fixed/TESTNUM/* DIR/spool/input/ sudo chown -R EXIMUSER:EXIMGROUP DIR/spool/input/ sudo chmod -R 640 DIR/spool/input/* +exim -bp +**** exim -q **** # @@ -39,3 +41,4 @@ exim -q # ### done no_msglog_check +no_stderr_check diff --git a/test/stderr/0699 b/test/stderr/0699 deleted file mode 100644 index f61a861c9..000000000 --- a/test/stderr/0699 +++ /dev/null @@ -1,10 +0,0 @@ -### Check that delivery of old-format spoolfiles works -### Check that the format-mangler utility can downgrade spoolfiles -### Check that the format-mangler utility can upgrade spoolfiles -### done - -******** SERVER ******** -### Check that delivery of old-format spoolfiles works -### Check that the format-mangler utility can downgrade spoolfiles -### Check that the format-mangler utility can upgrade spoolfiles -### done diff --git a/test/stdout/0699 b/test/stdout/0699 index 025f2996b..885d57928 100644 --- a/test/stdout/0699 +++ b/test/stdout/0699 @@ -1,4 +1,7 @@ ### Check that delivery of old-format spoolfiles works +TTT sss 10HmaX-0005vi-00-H + nulldeliver@test.ex + ### Check that the format-mangler utility can downgrade spoolfiles TTT sss 10HmaX-000000005vi-0000 nulldeliver@test.ex -- 2.30.2