diff options
author | Eric Wong <e@80x24.org> | 2019-06-13 20:46:52 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-06-13 20:47:16 +0000 |
commit | 4b8b3036ba08515eb66fb014b6ded9dc57e079b2 (patch) | |
tree | 8b09dab24c8f2b496cbcbae9976280fa2b23631a /t | |
parent | afb62cec9097de884bee427093219d598561474d (diff) | |
download | public-inbox-4b8b3036ba08515eb66fb014b6ded9dc57e079b2.tar.gz |
Leafnode cannot handle Message-ID headers which are too long and require folding via Email::Simple::Header. Since there are already many of these messages in git with the header already folded, we need to handle the unfolding when emitting the message via NNTP. As far as we know, Leafnode is the only client software incapable of handling this case.
Diffstat (limited to 't')
-rw-r--r-- | t/nntpd.t | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -231,6 +231,26 @@ EOF ok($date >= $t0, 'valid date after start'); ok($date <= $t1, 'valid date before stop'); } + if ('leafnode interop') { + my $for_leafnode = PublicInbox::MIME->new(<<""); +From: longheader\@example.com +To: $addr +Subject: none +Date: Fri, 02 Oct 1993 00:00:00 +0000 + + my $long_hdr = 'for-leafnode-'.('y'x200).'@example.com'; + $for_leafnode->header_set('Message-ID', "<$long_hdr>"); + $im->add($for_leafnode); + $im->done; + if ($version == 1) { + my $s = PublicInbox::SearchIdx->new($mainrepo, 1); + $s->index_sync; + } + my $hdr = $n->head("<$long_hdr>"); + my $expect = qr/\AMessage-ID: /i . qr/\Q<$long_hdr>\E/; + ok(scalar(grep(/$expect/, @$hdr)), 'Message-ID not folded'); + ok(scalar(grep(/^Path:/, @$hdr)), 'Path: header found'); + } # pipelined requests: { |