]> Sergey Matveev's repositories - public-inbox.git/commitdiff
mid: capitalize "ID" in "Message-ID"
authorEric Wong <e@yhbt.net>
Wed, 29 Apr 2020 10:43:34 +0000 (10:43 +0000)
committerEric Wong <e@yhbt.net>
Thu, 30 Apr 2020 07:33:52 +0000 (07:33 +0000)
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
lib/PublicInbox/MID.pm

index 95d654f667221711de6897ffd632b197bd6d10cf..de8ff55f4abd9c23c7b0be5bfe888a15f348fd40 100644 (file)
@@ -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;
index dddde092f2581ea1d54b1749804642dbccf89a48..685306dbf37658356b9cb7572c1ab04bbba46d50 100644 (file)
@@ -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));
 }