unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@yhbt.net>
To: meta@public-inbox.org
Subject: [PATCH] mid: capitalize "ID" in "Message-ID"
Date: Wed, 29 Apr 2020 10:43:34 +0000	[thread overview]
Message-ID: <20200429104334.24562-1-e@yhbt.net> (raw)

Prefer the "ID" capitalization since it seems to to be the
preferred capitalization in RFC 5322.

In theory, this allows the interpreter to deduplicate the string
internally (I haven't checked if it does).

Unfortunately, there's too many instances of "Message-Id" in the
tests to be worth changing at this point.
---
 lib/PublicInbox/Import.pm | 2 +-
 lib/PublicInbox/MID.pm    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm
index 95d654f6..de8ff55f 100644
--- a/lib/PublicInbox/Import.pm
+++ b/lib/PublicInbox/Import.pm
@@ -354,7 +354,7 @@ sub v1_mid0 ($) {
 	my $hdr = $mime->header_obj;
 	my $mids = mids($hdr);
 
-	if (!scalar(@$mids)) { # spam often has no Message-Id
+	if (!scalar(@$mids)) { # spam often has no Message-ID
 		my $mid0 = digest2mid(content_digest($mime), $hdr);
 		append_mid($hdr, $mid0);
 		return $mid0;
diff --git a/lib/PublicInbox/MID.pm b/lib/PublicInbox/MID.pm
index dddde092..685306db 100644
--- a/lib/PublicInbox/MID.pm
+++ b/lib/PublicInbox/MID.pm
@@ -72,7 +72,7 @@ sub extract_mids {
 
 sub mids ($) {
 	my ($hdr) = @_;
-	my @mids = $hdr->header_raw('Message-Id');
+	my @mids = $hdr->header_raw('Message-ID');
 	uniq_mids(extract_mids(@mids));
 }
 
@@ -81,7 +81,7 @@ sub mids ($) {
 # import and index without relying on HTTP endpoints
 sub mids_for_index ($) {
 	my ($hdr) = @_;
-	my @mids = $hdr->header_raw('Message-Id');
+	my @mids = $hdr->header_raw('Message-ID');
 	my @alts = $hdr->header_raw('X-Alt-Message-ID');
 	uniq_mids(extract_mids(@mids, @alts));
 }

                 reply	other threads:[~2020-04-29 10:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200429104334.24562-1-e@yhbt.net \
    --to=e@yhbt.net \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).