From 1bf653ad139bf7bb3d853ab0b5eae3eaa1b13a95 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 10 Dec 2020 22:38:47 +0000 Subject: nntp+www: drop List-* and Archived-At headers These headers can conflict with headers in the DKIM signature; and parsing the DKIM-Signature header to determine whether or not we can safely add a header would be more code and CPU cycles. Since IMAP seems fine without these headers (and JMAP will likely be, too), there's likely no need to continue appending these to every message. Nowadays, developers seem sufficiently trained to use URLs with Message-IDs in them. So drop the headers and save some cycles and bandwidth all around. --- t/nntp.t | 9 --------- t/psgi_mount.t | 14 ++++---------- 2 files changed, 4 insertions(+), 19 deletions(-) (limited to 't') diff --git a/t/nntp.t b/t/nntp.t index b745886d..36eb6945 100644 --- a/t/nntp.t +++ b/t/nntp.t @@ -121,12 +121,6 @@ use PublicInbox::Config; PublicInbox::NNTP::set_nntp_headers($hdr, $smsg); is_deeply([ $mime->header('Message-ID') ], [ "<$mid>" ], 'Message-ID unchanged'); - is_deeply([ $mime->header('Archived-At') ], [ "<${u}a\@b/>" ], - 'Archived-At: set'); - is_deeply([ $mime->header('List-Archive') ], [ "<$u>" ], - 'List-Archive: set'); - is_deeply([ $mime->header('List-Post') ], [ '' ], - 'List-Post: set'); is_deeply([ $mime->header('Newsgroups') ], [ 'test' ], 'Newsgroups: set'); is_deeply([ $mime->header('Xref') ], [ 'example.com test:1' ], @@ -137,9 +131,6 @@ use PublicInbox::Config; PublicInbox::NNTP::set_nntp_headers($hdr, $smsg); is_deeply([ $mime->header('Message-ID') ], [ "<$mid>" ], 'Message-ID unchanged'); - is_deeply([ $mime->header('Archived-At') ], - [ "<${u}a\@b/>", '' ], - 'Archived-At: appended'); is_deeply([ $mime->header('Xref') ], [ 'example.com test:2' ], 'Old Xref: clobbered'); } diff --git a/t/psgi_mount.t b/t/psgi_mount.t index dac62c1a..48d8e5c0 100644 --- a/t/psgi_mount.t +++ b/t/psgi_mount.t @@ -67,11 +67,9 @@ test_psgi($app, sub { $res = $cb->(GET('/a/test/blah%40example.com/raw')); is($res->code, 200, 'OK with URLMap mount'); - like($res->content, qr!^List-Archive: !m, - 'List-Archive set in /raw mboxrd'); like($res->content, - qr!^Archived-At: !m, - 'Archived-At set in /raw mboxrd'); + qr/^Message-Id: \n/sm, + 'headers appear in /raw'); # redirects $res = $cb->(GET('/a/test/m/blah%40example.com.html')); @@ -94,12 +92,8 @@ SKIP: { my $gz = $res->content; my $raw; IO::Uncompress::Gunzip::gunzip(\$gz => \$raw); - like($raw, qr!^List-Archive: !m, - 'List-Archive set in /t.mbox.gz mboxrd'); - like($raw, - qr!^Archived-At:\x20 - !mx, - 'Archived-At set in /t.mbox.gz mboxrd'); + like($raw, qr!^Message-Id:\x20\n!sm, + 'headers appear in /t.mbox.gz mboxrd'); }); } -- cgit v1.2.3-24-ge0c7