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.1 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-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (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 263A81F66F for ; Wed, 4 Nov 2020 11:47:00 +0000 (UTC) Received: by mail-io1-xd44.google.com with SMTP id m9so8222923iox.10 for ; Wed, 04 Nov 2020 03:47:00 -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=8/B7rdaBRn2xfc+YP8zNZtwsmqBJJQdHj1w7R2UKgCA=; b=Sz2jhj/AMhSv5YA8RnNbLZ6DHaPOpP7iAW6ylQAnhn9OfuYGKP4Yvn9ROUOICblYOG PU2NFLR3Pou4ka+TKS3p2w5I6UemkwyswrzA5PitynnbDAORME+blIvQEidT99p0Yuww cdCpa7M7hLTK22zBK2sGNj25NBWCFRfI2S2hePA4Fx8ta6tk9oroLYKVvlBLY0Kogaac +FMxdHWReLzfW+zYOUXt806sBkZFNBPelRzqCrWLJokmEFgPQVcf/P6C82mmmOYM3sA3 BBMn7ig9X3y5yBFENYF2Jesa3xA+ds4eSCO5HlPoun4sT04Kk1Ozjh8Ejvbm+bOGWXR/ f3Kw== 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=8/B7rdaBRn2xfc+YP8zNZtwsmqBJJQdHj1w7R2UKgCA=; b=S6r9Gg5JksGrIpYr2TQiEdaIM1AeQZWNPKRLTTBCPmq95Wxuy13WmDa1f2gn8VPAaJ ju3MzbYeF2pg+8jgDOAV8eBl0SiVYRFQ0KFpQ897QZL2yWV8adla5hEgxAYS/wDZGQ1G 1jwlqomUwCRsTdbBRMBAloXlyW9sfC+6PWhIsVyHKlwt/KqQfQXmaeBKSX2hib7ZVl4X HnW8meUegLECu1CvmWrwhjczBWlkoQIRGnZAevAMTBjJPGKKLG9aKKrc/LRnhhMAg9NZ MAT1NShc5N/Xn3ecsXE8BAeKjhmyML021hf18aRWSuFqpzA4GRRiSWwK5EaZsM+/pVhR hFKQ== X-Gm-Message-State: AOAM530WHY/f9ZVvlwx1amOIlemLie6FaA0VH0aSa52XbHtdX2D/F+G1 uaQ002Zwey0/R3YqU5RycdY0OUByUvyDaJlEJK4= X-Google-Smtp-Source: ABdhPJx4RjFJxUnocSy0IMrcL+QX3yTAuKM6VYvWRlWdrNsW2nDU9qrz1TDa8+eAW/OujeXO5aUBmySotVuoe3nedzg= X-Received: by 2002:a02:c817:: with SMTP id p23mr19617475jao.138.1604490418425; Wed, 04 Nov 2020 03:46:58 -0800 (PST) MIME-Version: 1.0 References: <20201103225559.GA5247@dcvr> <20201103235942.GA6163@dcvr> <20201104104448.GA6053@dcvr> In-Reply-To: <20201104104448.GA6053@dcvr> From: Andrey Melnikov Date: Wed, 4 Nov 2020 14:46:47 +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 13:44, Eric W= ong : > > Andrey Melnikov wrote: > > (re-adding meta@public-inbox.org to Cc) > > > =D1=81=D1=80, 4 =D0=BD=D0=BE=D1=8F=D0=B1. 2020 =D0=B3. =D0=B2 02:59, Er= ic Wong : > > > > > > Andrey Melnikov wrote: > > > > This break filtering on my leafnode. > > > > > > OK, thanks for that info. > > > > > > > What about "Path:" header? > > > > > > Ah, oops; missed that. I put "y" there since I figured it > > > wouldn't matter for leafnode (but only lightly tested it). > > > > > > Since we don't have any NNTP propagation path, I guess putting > > > just server-name there is appropriate? (not yet deployed) > > Yes. Leafnode only checks presence on Path: header. > > OK, that matches my limited, one-off experience with it. > > > > + # required for leafnode (RFC 5536 3.1.5) > > > + $hdr->header_set('Path', $server_name); > > I think > > $hdr->header_set('Path', $server_name . '!not-for-mail'); > > more RFC conform. > > I guess... Though it seems like blindly following stuff for > historical reasons, since I'm not seeing a great explanation of > "not-for-mail", other than it's "common" in RFC 5536/5537... > "not-for-mail" could be a valid hostname, after all. > > I suppose a few extra bytes won't hurt, too much :x Current: Path: y org.linuxdriverproject.driverdev-devel:35214 org.kernel.vger.linux-devicetree:433117 org.kernel.vger.linux-kernel:3765410 org.kernel.vger.linux-media:192196 and new: Path: nntp.lore.kernel.org!not.for.mail save more extra bytes... Hehe... yet another cosmetic thing: $ telnet nntp.lore.kernel.org 119 Trying 54.189.247.149... Connected to korg-lkml-1-news-lb-839eef9f3a4cef4e.elb.us-west-2.amazonaws.c= om. Escape character is '^]'. 201 nntp://nntp.lore.kernel.org ready - post via email quit Connection closed by foreign host. 'nntp://nntp.lore.kernel.org' is not a node name per RFC... But this is a configuration problem on nntp.lore.kernel.org side. > ----------8<-------- > Subject: [PATCH] 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 > --- > 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) =3D @_; > my ($mid) =3D $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 version= s). > @@ -438,11 +434,15 @@ sub set_nntp_headers ($$) { > $hdr->header_set('Xref', $xref); > > # RFC 5536 3.1.4 > - my $newsgroups =3D (split(/ /, $xref, 2))[1]; # drop server name > + my ($server_name, $newsgroups) =3D split(/ /, $xref, 2); > $newsgroups =3D~ s/:[0-9]+\b//g; # drop NNTP article numbers > $newsgroups =3D~ 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 =3D $ibx->base_url) { > $mid =3D mid_escape($mid);