From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=AWL,BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id D08FB1F66F for ; Tue, 3 Nov 2020 23:11:16 +0000 (UTC) Received: by mail-il1-x141.google.com with SMTP id x7so17718588ili.5 for ; Tue, 03 Nov 2020 15:11:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=0TBf5ug+PIy3pGnzzdgdb9XV/Jmn3ctlZ4vwMCcqE24=; b=arxC2ZToicLlEb7UltbWH/uUmv/bmzSmK12KDFVwNEIaXa8lewwgRocMwKRxl4fwUy f8X3j7F+BL3vjYekRxt/UfZQSgdF6hZT8OQNXeO2cWqW3EieYU/kGBmIYaTg14NVR+iy pqdMYVRdjEpus/gtoOBZ2kJBY22OQK0P2+x3/09y6YPXb1G+t9nYyjL+b7kmXe+jIZb9 NmU7oZsbI7BK3PFwf2f0Tf9mxjGGwoRRQtzpxXnefIhTLX6SKHOQM/TvIrOqSnakpucD YcukFaTh7tO4AJPjSCbeD5A56pTizTrO8KkaT9EOuyrasdCKSKXNTKaGWXLz/rUQf2An 74UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=0TBf5ug+PIy3pGnzzdgdb9XV/Jmn3ctlZ4vwMCcqE24=; b=UAwvjRzoHMwN3ZBIJ0kt5S3l54z+FxJfGSvLsLpK5BYwmw/n4JgmX0Ae2jVCTlh8ig /wqd0tWTKRaoJ7t3ZtruucsQ9zEMY0fapBGSY3qDjoRECihyj5uJmclggjk5jPQKdJiP X2suV1nqnD3i0cLzBfyTFFO/0gpcam2Qh9fFZ2qqevXxACkIvNHdgRXz68IXXvKnYZK1 owKeU98xv2XWSKHoHMVCPYRY0HtAOhtU/pafqz+TFpGiSeK1rc3zSrV4xrCi3K7oeAvM vGEQBmer3DUQFESOUyg6AZndOalA7YJBiGFNSTlkNZbEaWoFgP4b6EboJvXz9Df5DP7v pHWw== X-Gm-Message-State: AOAM5324YXFbu6UqXA9A/K20KqgCpJGgRjdxvEI1J29UD4zYI8Y8PkW+ GWhr9rcyy4SO5ya6TcxjIdwq9fvVgGhBNxPXrnY= X-Google-Smtp-Source: ABdhPJyPPK1E/PRmNhZbK5a92oFRi95chgLf4j0omiUMenBZXeemobqeFbF0+4Ifimhq/s0FmB1xvUJUoDuQuSBK9No= X-Received: by 2002:a05:6e02:1145:: with SMTP id o5mr17353200ill.168.1604445075180; Tue, 03 Nov 2020 15:11:15 -0800 (PST) MIME-Version: 1.0 References: <20201103225559.GA5247@dcvr> In-Reply-To: <20201103225559.GA5247@dcvr> From: Andrey Melnikov Date: Wed, 4 Nov 2020 02:11:03 +0300 Message-ID: Subject: Re: [PATCH] nntp: delimit Newsgroup: header with commas To: Eric Wong Cc: meta@public-inbox.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: =D1=81=D1=80, 4 =D0=BD=D0=BE=D1=8F=D0=B1. 2020 =D0=B3. =D0=B2 01:56, Eric W= ong : > > Andrey Melnikov wrote: > > Hi. > > > > nntpd generate wrong "Newsgoups:" header when message cross-posted to > > multiple groups. Currently, it write multiple groups separated with > > space, but rfc1036 chapter 2.1.3 says "... Multiple newsgroups may be > > specified, separated by a comma. ...". > > and Path: header too - rfc1036 chapter 2.1.6 says " ... The names may > > be separated by any punctuation character or characters (except "." > > which is considered part of the hostname). ..." > > Currently both headers separated as email-style with spaces, > > Thanks for the bug report. Does this break known clients or > is it just something you happened to notice? This break filtering on my leafnode. > I'm using RFC 5536 since it obsoletes 1036. > Testing the following on news.public-inbox.org: > > ----------8<------- > Subject: [PATCH] nntp: delimit Newsgroup: header with commas > > ...instead of spaces. This is specified in RFC 5536 3.1.4. > > Include references to RFC 1036, 5536 and 5537 in our docs while > we're at it. > > Reported-by: Andrey Melnikov > Link: https://public-inbox.org/meta/CA+PODjpUN5Q4gBFQhAzUNuMasVEdmp9f=3D8= Uo0Ej0mFumdSwi4w@mail.gmail.com/ > --- > Documentation/standards.perl | 3 +++ > 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 =3D [ > 3977 =3D> 'NNTP', > 977 =3D> 'NNTP (old)', > + 1036 =3D> 'Standard for Interchange of USENET Messages', > + 5536 =3D> 'Netnews Article Format', > + 5537 =3D> 'Netnews Architecture and Protocols', > 6048 =3D> 'NNTP additions to LIST command (TODO)', > 8054 =3D> 'NNTP compression', > 4642 =3D> '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 =3D $smsg->{-ibx}; > my $xref =3D xref($smsg->{nntp}, $ibx, $smsg->{num}, $mid); > $hdr->header_set('Xref', $xref); > - $xref =3D~ s/:[0-9]+//g; > - $hdr->header_set('Newsgroups', (split(/ /, $xref, 2))[1]); > + > + # RFC 5536 3.1.4 > + my $newsgroups =3D (split(/ /, $xref, 2))[1]; # drop server name > + $newsgroups =3D~ s/:[0-9]+\b//g; # drop NNTP article numbers > + $newsgroups =3D~ tr/ /,/; > + $hdr->header_set('Newsgroups', $newsgroups); > + > header_append($hdr, 'List-Post', "{-primary_address= }>"); > if (my $url =3D $ibx->base_url) { > $mid =3D mid_escape($mid); What about "Path:" header?