diff options
-rwxr-xr-x | Documentation/standards.perl | 3 | ||||
-rw-r--r-- | lib/PublicInbox/NNTP.pm | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/Documentation/standards.perl b/Documentation/standards.perl index 0ac6cc52..1c56830e 100755 --- a/Documentation/standards.perl +++ b/Documentation/standards.perl @@ -25,6 +25,9 @@ EOF my $rfcs = [ 3977 => 'NNTP', 977 => 'NNTP (old)', + 1036 => 'Standard for Interchange of USENET Messages', + 5536 => 'Netnews Article Format', + 5537 => 'Netnews Architecture and Protocols', 6048 => 'NNTP additions to LIST command (TODO)', 8054 => 'NNTP compression', 4642 => 'NNTP TLS', diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 102ef42c..783c0076 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -432,12 +432,17 @@ sub set_nntp_headers ($$) { $hdr->header_set('X-Alt-Message-ID', @alt); } - # clobber some + # clobber some existing headers my $ibx = $smsg->{-ibx}; my $xref = xref($smsg->{nntp}, $ibx, $smsg->{num}, $mid); $hdr->header_set('Xref', $xref); - $xref =~ s/:[0-9]+//g; - $hdr->header_set('Newsgroups', (split(/ /, $xref, 2))[1]); + + # RFC 5536 3.1.4 + my $newsgroups = (split(/ /, $xref, 2))[1]; # drop server name + $newsgroups =~ s/:[0-9]+\b//g; # drop NNTP article numbers + $newsgroups =~ tr/ /,/; + $hdr->header_set('Newsgroups', $newsgroups); + header_append($hdr, 'List-Post', "<mailto:$ibx->{-primary_address}>"); if (my $url = $ibx->base_url) { $mid = mid_escape($mid); |