Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Heisenberg might have been here.


computers / news.software.nntp / [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error

SubjectAuthor
* [inn] Header folded immediately after header name results in "invalid syntax encAdam W.
+- Re: [inn] Header folded immediately after header name results in "invalid syntaxUrs Janßen
`* Re: [inn] Header folded immediately after header name results in "invalid syntaxRuss Allbery
 +* Re: [inn] Header folded immediately after header name results in "invalid syntaxUrs Janßen
 |`* Re: [inn] Header folded immediately after header name results in "invalid syntaxRuss Allbery
 | `* Re: [inn] Header folded immediately after header name results inJulien ÉLIE
 |  `* Re: [inn] Header folded immediately after header name results in "invalid syntaxUrs Janßen
 |   `* Re: [inn] Header folded immediately after header name results inJulien ÉLIE
 |    `- Re: [inn] Header folded immediately after header name results in "invalid syntaxUrs Janßen
 `* Re: [inn] Header folded immediately after header name results in "invalid syntaxAdam W.
  `- Re: [inn] Header folded immediately after header name results in "invalid syntaxRuss Allbery

1
[inn] Header folded immediately after header name results in "invalid syntax encountered" posting error

<u5o2l1$lml$1$arnold@news.chmurka.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1771&group=news.software.nntp#1771

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!news.chmurka.net!.POSTED.s.v.chmurka.net!not-for-mail
From: gof-cut-this-news@cut-this-chmurka.net.invalid (Adam W.)
Newsgroups: news.software.nntp
Subject: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error
Date: Tue, 6 Jun 2023 19:49:53 -0000 (UTC)
Organization: news.chmurka.net
Message-ID: <u5o2l1$lml$1$arnold@news.chmurka.net>
NNTP-Posting-Host: s.v.chmurka.net
Injection-Date: Tue, 6 Jun 2023 19:49:53 -0000 (UTC)
Injection-Info: news.chmurka.net; posting-account="arnold"; posting-host="s.v.chmurka.net:172.24.44.20";
logging-data="22229"; mail-complaints-to="abuse-news.(at).chmurka.net"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.32-v7+ (armv7l))
Cancel-Lock: sha1:M1a+hbwDHEtjSNQsSRDGnB8ziuA=
sha1:fmAWdWa7FiKwNqaUbCaN4z5HOQg= sha256:U0EFPoFoLVCJx6gjd4EoT5A5nD9oXylyEshiCAYnL8w=
sha1:y+DJICUIpJzjKw5OV0aIhZqx+iY= sha256:WAtjMvFrUp3uC7CqQkMVxBz+nKNjBkaVBZcVdiouv0g=
 by: Adam W. - Tue, 6 Jun 2023 19:49 UTC

Hi,

inn version 2.7.0.

Let's try to post this message (minimal example):

#v+
From: test@test.test
Newsgroups: alt.test
Subject:
test

test
#v-

The Subject header body is folded here, but immediately after the header
name. The real life example is when Message-ID body is too long to fit in
the same line with the header name (and that's why I detected it and
started digging).

When trying to post it, I'm getting message:

441 Invalid syntax encountered in Subject header field body (unexpected byte or empty content line)

The check is done in nnrpd/post.c. Function IsValidHeaderBody is called
(from libinn, headers.c), which does some checks on the header to check
if it's sane.

When calling this function with an argument "\n test", this check is
triggered:

/* Folding detected. We expect CRLF or lone LF as some parts
* of INN code internally remove CR.
* Check that the line that has just been processed is not
* "empty" and that the following character marks the beginning
* of a continuation line. */
if (emptycontentline || !ISWHITE(p[1])) {
printf("false1 p[1]=%d\n", p[1]);
return false;
}

I believe this test is wrong, as emptycontentline will always be false if
the header body (value) is folded just after the header name. It's been
there since 2016, so I doubt I'm the only one who encountered this
error... or maybe that's not an error and this header is in fact wrong
and should not be folded (and it's a bug in formail then)?

Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error

<u5oafj$i2l$1@nntp.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1772&group=news.software.nntp#1772

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!2.eu.feeder.erje.net!feeder.erje.net!nntp.de!.POSTED.akk21-int.akk.kit.edu!not-for-mail
From: urs@buil.tin.org (Urs Janßen)
Newsgroups: news.software.nntp
Subject: Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error
Date: Tue, 6 Jun 2023 22:04:01 -0000 (UTC)
Organization: tin.org
Archive: no
Message-ID: <u5oafj$i2l$1@nntp.de>
References: <u5o2l1$lml$1$arnold@news.chmurka.net>
Injection-Date: Tue, 6 Jun 2023 22:04:01 -0000 (UTC)
Injection-Info: nntp.de; posting-host="akk21-int.akk.kit.edu:2a00:1398:5:f602:cafe:cafe:cafe:21";
logging-data="18517"; mail-complaints-to="abuse@nntp.de"
User-Agent: tin/2.6.3-20230505 ("Pittyvaich") (Linux/4.19.0-23-amd64 (x86_64))
Cancel-Lock: sha1:JUW1/2BfGajNdQo3k05hh2e3sk0=
X-No-Archive: yes
X-No-HTML: yes
 by: Urs Janßen - Tue, 6 Jun 2023 22:04 UTC

Adam W. wrote:
> The Subject header body is folded here, but immediately after the header
> name. The real life example is when Message-ID body is too long to fit in

[RFC 5536 2.2]
| o Every line of a header field body (including the first and any
| that are subsequently folded) MUST contain at least one non-
| whitespace character.
| | NOTE: This means that no header field body defined by or
| referenced by this document can be empty. As a result, rather
| than using the <unstructured> syntax from Section 3.2.5 of
| [RFC5322], this document uses a stricter definition:
| | unstructured = *WSP VCHAR *( [FWS] VCHAR ) *WSP
| | NOTE: The [RFC5322] specification sometimes uses [FWS] at the
| beginning or end of ABNF describing header field content. This
| specification uses *WSP in such cases, also in cases where this
| specification redefines constructs from [RFC5322]. This is
| done for consistency with the restriction described here, but
| the restriction applies to all header fields, not just those
| where ABNF is defined in this document.

Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error

<87zg5ci1f8.fsf@hope.eyrie.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1773&group=news.software.nntp#1773

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.killfile.org!news.eyrie.org!.POSTED!not-for-mail
From: eagle@eyrie.org (Russ Allbery)
Newsgroups: news.software.nntp
Subject: Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error
Date: Tue, 06 Jun 2023 17:03:23 -0700
Organization: The Eyrie
Message-ID: <87zg5ci1f8.fsf@hope.eyrie.org>
References: <u5o2l1$lml$1$arnold@news.chmurka.net>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: hope.eyrie.org;
logging-data="17849"; mail-complaints-to="news@eyrie.org"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:BQzetnTpz3wYkM4Y6JJNf9cqTO8=
 by: Russ Allbery - Wed, 7 Jun 2023 00:03 UTC

gof-cut-this-news@cut-this-chmurka.net.invalid (Adam W.) writes:

> The real life example is when Message-ID body is too long to fit in the
> same line with the header name (and that's why I detected it and started
> digging).

Urs posted the correct standards reference. I just wanted to add that you
should never fold the Message-ID for Netnews articles. (Which is a
somewhat obvious consequence of the standards rule about having some
non-whitespace characters on the header field line, but is worth
reiterating separately.)

Header field lines do not have to be folded unless they contain RFC 2047
encoding (which the Message-ID header field may not), and may be as long
as 998 octets, and the maximum length of an FQDN is 254 octets if I
remember correctly. That leaves plenty of space. News software does not
expect a folded Message-ID and I suspect INN is far from the only piece of
software that would break. It may not look aesthetically pleasing to have
a long line, but the standard effectively requires it.

I would, in general, never fold Path, Message-ID, or Date, since these are
critical fields for the Netnews protocol and a lot of existing software
isn't going to handle it correctly. I think there are provisions in the
standard for folding Path (I don't recall whether we restricted the Date
syntax to disallow folding), but if you want to maximize how interoperable
the articles are, it's best to avoid those provisions.

--
Russ Allbery (eagle@eyrie.org) <https://www.eyrie.org/~eagle/>

Please post questions rather than mailing me directly.
<https://www.eyrie.org/~eagle/faqs/questions.html> explains why.

Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error

<u5p4ue$stl$1@nntp.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1774&group=news.software.nntp#1774

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.cgarbs.de!nntp.de!.POSTED.akk21-int.akk.kit.edu!not-for-mail
From: urs@buil.tin.org (Urs Janßen)
Newsgroups: news.software.nntp
Subject: Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error
Date: Wed, 7 Jun 2023 05:35:40 -0000 (UTC)
Organization: tin.org
Archive: no
Message-ID: <u5p4ue$stl$1@nntp.de>
References: <u5o2l1$lml$1$arnold@news.chmurka.net> <87zg5ci1f8.fsf@hope.eyrie.org>
Injection-Date: Wed, 7 Jun 2023 05:35:40 -0000 (UTC)
Injection-Info: nntp.de; posting-host="akk21-int.akk.kit.edu:2a00:1398:5:f602:cafe:cafe:cafe:21";
logging-data="29621"; mail-complaints-to="abuse@nntp.de"
User-Agent: tin/2.6.3-20230505 ("Pittyvaich") (Linux/4.19.0-23-amd64 (x86_64))
Cancel-Lock: sha1:rN/V9VzbLEyVHHwSbaWKYwxOF9U=
X-No-Archive: yes
X-No-HTML: yes
 by: Urs Janßen - Wed, 7 Jun 2023 05:35 UTC

Russ Allbery wrote:
> Header field lines do not have to be folded unless they contain RFC 2047
> encoding (which the Message-ID header field may not), and may be as long
> as 998 octets, and the maximum length of an FQDN is 254 octets if I
> remember correctly. That leaves plenty of space. News software does not
> expect a folded Message-ID and I suspect INN is far from the only piece of

It's even more restrictive (RFC 5536 3.1.3)

| msg-id = "<" msg-id-core ">"
| ; maximum length is 250 octets
| msg-id-core = id-left "@" id-right
[...]
| The <msg-id> MUST NOT be more than 250 octets in length.
| | NOTE: The length restriction ensures that systems that accept
| message identifiers as a parameter when referencing an article
| (e.g., [RFC3977]) can rely on a bounded length.
| | Observe that <msg-id> includes the < and >.

> software that would break. It may not look aesthetically pleasing to have
> a long line, but the standard effectively requires it.
>
> I would, in general, never fold Path, Message-ID, or Date, since these are
> critical fields for the Netnews protocol and a lot of existing software
> isn't going to handle it correctly. I think there are provisions in the
> standard for folding Path (I don't recall whether we restricted the Date
> syntax to disallow folding), but if you want to maximize how interoperable
> the articles are, it's best to avoid those provisions.

Unfortunately (one of the changes from RFC 1036 which I did not like as
some programs may be not aware of this) Path can "now" be folded (RFC 5536
3.1.5):

| path = "Path:" SP *WSP path-list tail-entry *WSP CRLF
| path-list = *( path-identity [FWS] [path-diagnostic] "!" )

Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error

<87ilbzn84g.fsf@hope.eyrie.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1775&group=news.software.nntp#1775

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!news.nntp4.net!nntp.terraraq.uk!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.eyrie.org!.POSTED!not-for-mail
From: eagle@eyrie.org (Russ Allbery)
Newsgroups: news.software.nntp
Subject: Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error
Date: Tue, 06 Jun 2023 22:39:43 -0700
Organization: The Eyrie
Message-ID: <87ilbzn84g.fsf@hope.eyrie.org>
References: <u5o2l1$lml$1$arnold@news.chmurka.net>
<87zg5ci1f8.fsf@hope.eyrie.org> <u5p4ue$stl$1@nntp.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: hope.eyrie.org;
logging-data="2248"; mail-complaints-to="news@eyrie.org"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:vvMRJNs+QUe+lQRY8XwMMWlzeu8=
 by: Russ Allbery - Wed, 7 Jun 2023 05:39 UTC

Urs Janßen <urs@buil.tin.org> writes:
> Russ Allbery wrote:

>> Header field lines do not have to be folded unless they contain RFC 2047
>> encoding (which the Message-ID header field may not), and may be as long
>> as 998 octets, and the maximum length of an FQDN is 254 octets if I
>> remember correctly. That leaves plenty of space. News software does not
>> expect a folded Message-ID and I suspect INN is far from the only piece of

> It's even more restrictive (RFC 5536 3.1.3)

> | msg-id = "<" msg-id-core ">"
> | ; maximum length is 250 octets
> | msg-id-core = id-left "@" id-right
> [...]
> | The <msg-id> MUST NOT be more than 250 octets in length.

Oh, right! I had completely forgotten that we limited the length of the
message ID.

> Unfortunately (one of the changes from RFC 1036 which I did not like as
> some programs may be not aware of this) Path can "now" be folded (RFC
> 5536 3.1.5):

> | path = "Path:" SP *WSP path-list tail-entry *WSP CRLF
> | path-list = *( path-identity [FWS] [path-diagnostic] "!" )

Yeah, in retrospect that was probably a mistake.

--
Russ Allbery (eagle@eyrie.org) <https://www.eyrie.org/~eagle/>

Please post questions rather than mailing me directly.
<https://www.eyrie.org/~eagle/faqs/questions.html> explains why.

Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error

<u5p8p9$14ac4$1@news.trigofacile.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1776&group=news.software.nntp#1776

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.san13-h02-176-143-2-105.dsl.sta.abo.bbox.fr!not-for-mail
From: iulius@nom-de-mon-site.com.invalid (Julien ÉLIE)
Newsgroups: news.software.nntp
Subject: Re: [inn] Header folded immediately after header name results in
"invalid syntax encountered" posting error
Date: Wed, 7 Jun 2023 08:40:41 +0200
Organization: Groupes francophones par TrigoFACILE
Message-ID: <u5p8p9$14ac4$1@news.trigofacile.com>
References: <u5o2l1$lml$1$arnold@news.chmurka.net>
<87zg5ci1f8.fsf@hope.eyrie.org> <u5p4ue$stl$1@nntp.de>
<87ilbzn84g.fsf@hope.eyrie.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 7 Jun 2023 06:40:41 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="san13-h02-176-143-2-105.dsl.sta.abo.bbox.fr:176.143.2.105";
logging-data="1190276"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.11.2
Cancel-Lock: sha1:Plxtm+mU0ezEvbXalpAGhRx9hDQ= sha256:w3zuIgXQIVWnfj+5mMDKBuET/ALO/QKvIWxwIEfJN/E=
sha1:WKtd8S1ZuNTKPDTmEAqaq8NXUeE= sha256:eVvW3Ba06+AC35EKlZWxGy6/0IYUze8k6U0g2BECdGI=
In-Reply-To: <87ilbzn84g.fsf@hope.eyrie.org>
 by: Julien ÉLIE - Wed, 7 Jun 2023 06:40 UTC

Hi Urs and Russ,

>> Unfortunately (one of the changes from RFC 1036 which I did not like as
>> some programs may be not aware of this) Path can "now" be folded (RFC
>> 5536 3.1.5):

Does RFC 1036 really say that Path cannot be folded?
I do not manage to find the reference.

2. Message Format
The Internet convention of continuation header lines (beginning with
a blank or tab) is allowed.

2.1.6. Path

The names may be
separated by any punctuation character or characters (except "."
which is considered part of the hostname). Thus, the following are
valid entries:

cbosgd!mhuxj!mhuxt
cbosgd, mhuxj, mhuxt
@cbosgd.ATT.COM,@mhuxj.ATT.COM,@mhuxt.ATT.COM
teklabs, zehntel, sri-unix@cca!decvax

However, the existing convention of placing the
host name and an "!" at the front of the path, and of starting the
path with the host name, an "!", and the user name, should be
maintained when possible.

>> | path = "Path:" SP *WSP path-list tail-entry *WSP CRLF
>> | path-list = *( path-identity [FWS] [path-diagnostic] "!" )
>
> Yeah, in retrospect that was probably a mistake.

FWIW, "Son of 1036" (RFC 1849) was already saying in 1994:

5.6. Path

NOTE: This syntax has the disadvantage of containing no white
space, making it impossible to continue a Path header across
several lines. Implementors of relayers and reading agents are
warned that it is intended that the successor to this Draft will
change the definition of path delimiter to:

path-delimiter = "!" [ space ]

and are urged to fix their software to handle (i.e., ignore) white
space following the exclamation points. They are urged to hurry;
some ill-behaved systems reportedly already feel free to add such
white space.

NOTE: [RFC1036] allows considerably more flexibility in choice of
delimiter, in theory, but this flexibility has never been used,
and most news software does not implement it properly. The
grammar reflects the current reality. Note, in particular, that
[RFC1036] treats "_" as a delimiter, but in fact it is known to
appear in relayer names occasionally.

So I believe RFC 5536 was just documenting what was going on with "!"
and spaces, and naturally folding on whitespace.

--
Julien ÉLIE

« Ça n'a été qu'un coup de glaive dans l'eau. » (Astérix)

Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error

<u5pbme$us2$1@nntp.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1777&group=news.software.nntp#1777

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.cgarbs.de!nntp.de!.POSTED.akk21-int.akk.kit.edu!not-for-mail
From: urs@buil.tin.org (Urs Janßen)
Newsgroups: news.software.nntp
Subject: Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error
Supersedes: <u5pagm$uc7$1@nntp.de>
Date: Wed, 7 Jun 2023 07:30:22 -0000 (UTC)
Organization: tin.org
Archive: no
Message-ID: <u5pbme$us2$1@nntp.de>
References: <u5o2l1$lml$1$arnold@news.chmurka.net> <87zg5ci1f8.fsf@hope.eyrie.org> <u5p4ue$stl$1@nntp.de> <87ilbzn84g.fsf@hope.eyrie.org> <u5p8p9$14ac4$1@news.trigofacile.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 7 Jun 2023 07:30:22 -0000 (UTC)
Injection-Info: nntp.de; posting-host="akk21-int.akk.kit.edu:2a00:1398:5:f602:cafe:cafe:cafe:21";
logging-data="31618"; mail-complaints-to="abuse@nntp.de"
User-Agent: tin/2.6.3-20230505 ("Pittyvaich") (Linux/4.19.0-23-amd64 (x86_64))
Cancel-Lock: sha1:Rim9ZPAT77epcgc1WdzOxjrtvjk=
Cancel-Key: sha1:VI5/wdy2pIL1Mj+PXs06U8oW55w=
X-No-Archive: yes
X-No-HTML: yes
 by: Urs Janßen - Wed, 7 Jun 2023 07:30 UTC

Julien ÉLIE wrote:
> Hi Urs and Russ,
> Does RFC 1036 really say that Path cannot be folded?

Sorry, in fact it was RFC 1849 (5.6.) not RFC 1036 as you already found
out.

In fact I had son of RFC 1036 in mind, de facto standard between around
1992 and 2010 wgen it became RFC 1849 (just to document the current state).

> So I believe RFC 5536 was just documenting what was going on with "!"
> and spaces, and naturally folding on whitespace.

I still think allowing FWS in Path is/was more asking for trouble than
needed.
I know that a lot of older software had/has issues with FWS in
general and 992 bytes is plenty of space for Path, esp. if you avoid the
often quite useless verification info.
The same goes for at least Date, Newsgroups and Followup-To.

Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error

<u5pem4$14cr0$1@news.trigofacile.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1778&group=news.software.nntp#1778

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.176-143-2-105.abo.bbox.fr!not-for-mail
From: iulius@nom-de-mon-site.com.invalid (Julien ÉLIE)
Newsgroups: news.software.nntp
Subject: Re: [inn] Header folded immediately after header name results in
"invalid syntax encountered" posting error
Date: Wed, 7 Jun 2023 10:21:24 +0200
Organization: Groupes francophones par TrigoFACILE
Message-ID: <u5pem4$14cr0$1@news.trigofacile.com>
References: <u5o2l1$lml$1$arnold@news.chmurka.net>
<87zg5ci1f8.fsf@hope.eyrie.org> <u5p4ue$stl$1@nntp.de>
<87ilbzn84g.fsf@hope.eyrie.org> <u5p8p9$14ac4$1@news.trigofacile.com>
<u5pbme$us2$1@nntp.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 7 Jun 2023 08:21:24 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="176-143-2-105.abo.bbox.fr:176.143.2.105";
logging-data="1192800"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.11.2
Cancel-Lock: sha1:ldx7pv1GB9Km9k6U5UjjIvnciHw= sha256:HgK7i/AA3csrYK0IZOyEj2Xv7HdcybZtPj5OJEGRZTo=
sha1:6I6c8SmXobrOqnW1OC2K5C9MAo8= sha256:wzALtDfh7/BGneAqqqtIw6Pm8U0/MZHumKA9wVuRA7A=
In-Reply-To: <u5pbme$us2$1@nntp.de>
 by: Julien ÉLIE - Wed, 7 Jun 2023 08:21 UTC

Hi Urs,

> I still think allowing FWS in Path is/was more asking for trouble than
> needed.
> I know that a lot of older software had/has issues with FWS in
> general and 992 bytes is plenty of space for Path, esp. if you avoid the
> often quite useless verification info.

Yes I understand the point and the change from Son of 1036.

If the Path header field does not allow FWS, the problem that would have
been to delt with in RFC 5536/5537 is Path trimming. As an FQDN can
have about 254 characters, and path diagnostics can also add a MISMATCH
with an additional FQDN, and a server can add several path identities...
in theory we could reach the maximum allowed length in only 1 hop!
Or 3 hops if not taking into account path diagnostics and several path
identities.

It would have been something to explain, limit and standardize.
Instead of using the already existing FWS mechanism specifically
designed to treat such folding in large header fields.

Well, we cannot do much about that now.
Maybe to add more interoperability coverage, adding an RFC erratum to
say that Path folding SHOULD be avoided when possible, and SHOULD occur
only when the addition of a path identity or diagnostic would make the
header field larger than 998 bytes?

> The same goes for at least Date, Newsgroups and Followup-To.

As for Date, the CFWS is only at the end of the field, so normally the
parsing should be fine in only the first line:

date-time = [ day-of-week "," ] date time [CFWS]
day-of-week = ([FWS] day-name) / obs-day-of-week

NOTE: The [RFC5322] specification sometimes uses [FWS] at the
beginning or end of ABNF describing header field content. This
specification uses *WSP in such cases, also in cases where this
specification redefines constructs from [RFC5322].

Maybe the suggested RFC erratum about Path folding could include these 3
additional fields.

--
Julien ÉLIE

« Le tennis c'est comme le ping-pong, sauf qu'au tennis, les joueurs
sont debout sur la table. »

Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error

<u5pk1i$2sg$1@nntp.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1779&group=news.software.nntp#1779

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news.szaf.org!news.cgarbs.de!nntp.de!.POSTED.akk21-int.akk.kit.edu!not-for-mail
From: urs@buil.tin.org (Urs Janßen)
Newsgroups: news.software.nntp
Subject: Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error
Date: Wed, 7 Jun 2023 09:53:20 -0000 (UTC)
Organization: tin.org
Archive: no
Message-ID: <u5pk1i$2sg$1@nntp.de>
References: <u5o2l1$lml$1$arnold@news.chmurka.net> <87zg5ci1f8.fsf@hope.eyrie.org> <u5p4ue$stl$1@nntp.de> <87ilbzn84g.fsf@hope.eyrie.org> <u5p8p9$14ac4$1@news.trigofacile.com> <u5pbme$us2$1@nntp.de> <u5pem4$14cr0$1@news.trigofacile.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 7 Jun 2023 09:53:20 -0000 (UTC)
Injection-Info: nntp.de; posting-host="akk21-int.akk.kit.edu:2a00:1398:5:f602:cafe:cafe:cafe:21";
logging-data="2960"; mail-complaints-to="abuse@nntp.de"
User-Agent: tin/2.6.3-20230505 ("Pittyvaich") (Linux/4.19.0-23-amd64 (x86_64))
Cancel-Lock: sha1:UNLVu9ySKt7GrBrK/WlbDaXUFY0=
X-No-Archive: yes
X-No-HTML: yes
 by: Urs Janßen - Wed, 7 Jun 2023 09:53 UTC

Julien ÉLIE wrote:
> If the Path header field does not allow FWS, the problem that would have
> been to delt with in RFC 5536/5537 is Path trimming. As an FQDN can
> have about 254 characters, and path diagnostics can also add a MISMATCH
> with an additional FQDN, and a server can add several path identities...

I am not a fan of adding such diagnoses to the Path as they cannot be
trusted anywhere except on the hop that adds them.

Several path identities might be useful in large scale setups but that
could/should be limited to 2-3.
> Well, we cannot do much about that now.

Fortunately, FWS in Path does not really appear (at least in non binarie
usenet).

Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error

<u5pkjp$mes$1$arnold@news.chmurka.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1780&group=news.software.nntp#1780

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!news.chmurka.net!.POSTED.s.v.chmurka.net!not-for-mail
From: gof-cut-this-news@cut-this-chmurka.net.invalid (Adam W.)
Newsgroups: news.software.nntp
Subject: Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error
Date: Wed, 7 Jun 2023 10:02:33 -0000 (UTC)
Organization: news.chmurka.net
Message-ID: <u5pkjp$mes$1$arnold@news.chmurka.net>
References: <u5o2l1$lml$1$arnold@news.chmurka.net> <87zg5ci1f8.fsf@hope.eyrie.org>
NNTP-Posting-Host: s.v.chmurka.net
Injection-Date: Wed, 7 Jun 2023 10:02:33 -0000 (UTC)
Injection-Info: news.chmurka.net; posting-account="arnold"; posting-host="s.v.chmurka.net:172.24.44.20";
logging-data="23004"; mail-complaints-to="abuse-news.(at).chmurka.net"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.32-v7+ (armv7l))
Cancel-Lock: sha1:VBfbO/Ekt4tWqr3SK0o+p5dNnkA=
sha1:OhtAbq51dEsDmP5cERIYFHGZ2AY= sha256:c8qKQODTJ9BPLF7WRUkFteqhhtCBr4BWXgHmmtOWDao=
sha1:mIfRHqsYOKVGXj5Psq7wzWt7mbw= sha256:T/JbIZLZ80gOWYPqzeO0w6ju0lru86KRRuJItEZnC2k=
 by: Adam W. - Wed, 7 Jun 2023 10:02 UTC

Russ Allbery <eagle@eyrie.org> wrote:

> but if you want to maximize how interoperable the articles are,

Actually, in this specific case, I don't :)

I'm feeding some mailing lists into my own inn to read with my own tin (I
don't like mailing lists, I think newsgroups are much more suited for this
purpose). As long as both inn and tin accept it, I'm fine with that.

Back to the Message-ID. It seems that it's folded by some Microsoft tools
(what a surprise) -- some kind of online Outlook or something. Here's the
sample Message-ID:

Message-ID:
<YT3PR01MB6374D9DE3A7128AF7DE72EC1A253A@YT3PR01MB6374.CANPRD01.PROD.OUTLOOK.COM>

It came in this format from a group on groups.io (a mailing groups
server), formail didn't unfold it (I'm using formail to add and remove
some headers before feeding article to rpost) and it was rejected by my
inn.

Actually, there are more headers formatted this way, but they're not
needed (for example x-ms-exchange-antispam-messagedata-0).

I'm wondering if there are some tools to unfold it (to reformat headers,
because sometimes they should be folded), or should I reinvent the wheel
and write something to do it... are (any of) you aware of such tools?

Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error

<87ttvjz46t.fsf@hope.eyrie.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1781&group=news.software.nntp#1781

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.killfile.org!news.eyrie.org!.POSTED!not-for-mail
From: eagle@eyrie.org (Russ Allbery)
Newsgroups: news.software.nntp
Subject: Re: [inn] Header folded immediately after header name results in "invalid syntax encountered" posting error
Date: Wed, 07 Jun 2023 08:23:54 -0700
Organization: The Eyrie
Message-ID: <87ttvjz46t.fsf@hope.eyrie.org>
References: <u5o2l1$lml$1$arnold@news.chmurka.net>
<87zg5ci1f8.fsf@hope.eyrie.org> <u5pkjp$mes$1$arnold@news.chmurka.net>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: hope.eyrie.org;
logging-data="28937"; mail-complaints-to="news@eyrie.org"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:cBMhEIb07mVczK9V5Bi5CnDVzBQ=
 by: Russ Allbery - Wed, 7 Jun 2023 15:23 UTC

gof-cut-this-news@cut-this-chmurka.net.invalid (Adam W.) writes:

> Back to the Message-ID. It seems that it's folded by some Microsoft
> tools (what a surprise) -- some kind of online Outlook or
> something. Here's the sample Message-ID:

> Message-ID:
> <YT3PR01MB6374D9DE3A7128AF7DE72EC1A253A@YT3PR01MB6374.CANPRD01.PROD.OUTLOOK.COM>

Oh, sigh, now I understand your problem.

Yeah, alas, you're going to have to add custom processing to unfold those
for INN, which is really annoying. Email messages often play fast and
loose with message IDs and do all sorts of weird things with them (I saw
one mail server that reused the same message ID for every message it sent
out) because they're much less important in email than in Usenet.

> I'm wondering if there are some tools to unfold it (to reformat headers,
> because sometimes they should be folded), or should I reinvent the wheel
> and write something to do it... are (any of) you aware of such tools?

I don't know of any. When I was doing this sort of thing, I wrote my own
mail to news gatewaying in Perl. (News::Gateway is still on CPAN, but I'm
waiting for it to be 30 years old before I try to update it, apparently.)

--
Russ Allbery (eagle@eyrie.org) <https://www.eyrie.org/~eagle/>

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor