[PATCH v3 4/4] imap-send: match header names case insensitively
- From
Harald Nordgren via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Oct 22, 2026, 06:56 UTC
- Message-ID
- <01add80af28d6a23e44a1d3149e2c2a875c00c84.1792652185.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.2456.v3.git.git.1792652185.gitgitgadget@gmail.com>
From: Harald Nordgren <haraldnordgren@gmail.com>
imap-send says "no messages found to send" for a message whose headers are spelled "from:", "date:" or "subject:", although RFC 5322 treats header field names as case insensitive. Match the three names in any case.
Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com> --- imap-send.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/imap-send.c b/imap-send.c index 1091825dfb..21e20d7720 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1461,11 +1461,11 @@ static bool has_required_headers(const char *line) bool from = false, date = false, subject = false; while ((line = strchr(line, '\n')) && *++line != '\n') { - if (starts_with(line, "From: ")) + if (istarts_with(line, "From: ")) from = true; - else if (starts_with(line, "Date: ")) + else if (istarts_with(line, "Date: ")) date = true; - else if (starts_with(line, "Subject: ")) + else if (istarts_with(line, "Subject: ")) subject = true; } return from && date && subject;
-- gitgitgadget