From bf14a3670da7235806740aa55bd7a7248327abf7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 4 Nov 2020 10:44:48 +0000 Subject: nntp: attempt RFC 5536 3.1.5-conformant Path: headers Perhaps some NNTP clients would be unhappy with the old value "y". So use a bit more bandwidth+space to use the server-name and historical "!not-for-mail" tail-entry to better conform to a published RFC. Reported-by: Andrey Melnikov (cherry picked from commit 47559005ee678592808c351daa1c9f2682beb248) --- lib/PublicInbox/NNTP.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 783c0076..2f821fa6 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -415,10 +415,6 @@ sub set_nntp_headers ($$) { my ($hdr, $smsg) = @_; my ($mid) = $smsg->{mid}; - # why? leafnode requires a Path: header for some inexplicable - # reason. We'll fake the shortest one possible. - $hdr->header_set('Path', 'y'); - # leafnode (and maybe other NNTP clients) have trouble dealing # with v2 messages which have multiple Message-IDs (either due # to our own content-based dedupe or buggy git-send-email versions). @@ -438,11 +434,15 @@ sub set_nntp_headers ($$) { $hdr->header_set('Xref', $xref); # RFC 5536 3.1.4 - my $newsgroups = (split(/ /, $xref, 2))[1]; # drop server name + my ($server_name, $newsgroups) = split(/ /, $xref, 2); $newsgroups =~ s/:[0-9]+\b//g; # drop NNTP article numbers $newsgroups =~ tr/ /,/; $hdr->header_set('Newsgroups', $newsgroups); + # *something* here is required for leafnode, try to follow + # RFC 5536 3.1.5... + $hdr->header_set('Path', $server_name . '!not-for-mail'); + header_append($hdr, 'List-Post', "{-primary_address}>"); if (my $url = $ibx->base_url) { $mid = mid_escape($mid); -- cgit v1.2.3-24-ge0c7