🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #87520

Re: Multiple occurences of header fields

#87520
From: Julien ÉLIE
Date: Sun, 04 Sep 2016 19:41
90 lines
5203 bytes
Hi Adam,

>>       Compliant software MUST NOT generate (but MAY accept) header field
>>       lines of more than 998 octets.  This is the only limit on the
>>       length of a header field line prescribed by this standard.
>>       However, specific rules to the contrary may apply in particular
>>       cases (for example, according to [RFC2047], lines of a header
>>       field containing encoded words are limited to 76 octets).
>
>> => The check for 998 octets is already done, but not the one for 76 octets!
>> As INN does not generate such headers, I believe it is OK not to check
>> the length of header fields containing encoded words (an injecting agent
>> MAY accept them).
>
> Once the encoding is added, you can end up displaying a rather short line.
> Is it 76 because a longer line is thought to interfere with decoding?

Section 2 of RFC 2047 gives the following rationale for this limitation:

    An 'encoded-word' may not be more than 75 characters long, including
    'charset', 'encoding', 'encoded-text', and delimiters.  If it is
    desirable to encode more text than will fit in an 'encoded-word' of
    75 characters, multiple 'encoded-word's (separated by CRLF SPACE) may
    be used.

    While there is no limit to the length of a multiple-line header
    field, each line of a header field that contains one or more
    'encoded-word's is limited to 76 characters.

    The length restrictions are included both to ease interoperability
    through internetwork mail gateways, and to impose a limit on the
    amount of lookahead a header parser must employ (while looking for a
    final ?= delimiter) before it can decide whether a token is an
    "encoded-word" or something else.



>>    o  The character set for header fields is US-ASCII.  Where the use of
>>       non-ASCII characters is required, they MUST be encoded using the
>>       MIME mechanisms defined in [RFC2047] and [RFC2231].
>
>> => This check is currently not done.  I suggest to do nothing about it
>> because it will otherwise probably do harm when receiving
>> "internationalized" header fields (for instance encoded in UTF-8).
>
> It sounds like a worthwhile sanity check to perform.

The problem with such a check is that INN would reject current valid 
articles.  We already have UTF-8 chars in wide in a few circumstances, 
especially for internationalized newsgroup names.
There's a sentence about that in RFC 5536, Section 4:  "Note that the 
generation of internationalized <newsgroup-name>s for use in header 
fields is not addressed in this document."



> Does References already get checked for a string of valid Message-IDs too,
> or just the Message-ID getting appended?

INN currently does not check anything about the References: header 
field.  I agree it should do something (list of valid Message-IDs).
However, a news server cannot check whether all Message-IDs corresponds 
to a/ existing articles and b/ articles in the same thread because it 
does not necessarily have the information (notably if an article did not 
reach the news server or if the news server just do not store 
information about articles it just re-feds).



> I have no idea how Distribution could possibly be checked beyond disallowed character

I suggest to just check that it conforms to the expected syntax:

dist-list       =  *WSP dist-name
                       *( [FWS] "," [FWS] dist-name ) *WSP

dist-name       =  ALPHA / DIGIT
                       *( ALPHA / DIGIT / "+" / "-" / "_" )

and that "all" is not present (it is a MUST NOT per RFC 5536, Section 
3.2.4).

-- 
Julien ÉLIE

« – Par Toutatis ! On tire encore sur nous !
   – Nous sommes au dessus de Tyr.
   – Alors tirons-nous vite ! » (Astérix)

Technical Details
Message-ID: <nqhtcb$8h7$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
References: <2116899503.484444288.248931.dunno-dunno.dunno@news.mixmin.net> <alpine.OSX.2.20.1605111043570.14592@mako.ath.cx> <nhsd2n$mdi$1@news.trigofacile.com> <ni2afm$96b$1@news.trigofacile.com> <nqhfo8$nvl$1@news.albasani.net>

Show Full Headers
Complete Article Headers
Message-ID: <nqhtcb$8h7$1@news.trigofacile.com>
Subject: Re: Multiple occurences of header fields
Date: Sun, 4 Sep 2016 21:41:23 +0200
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <2116899503.484444288.248931.dunno-dunno.dunno@news.mixmin.net> <alpine.OSX.2.20.1605111043570.14592@mako.ath.cx> <nhsd2n$mdi$1@news.trigofacile.com> <ni2afm$96b$1@news.trigofacile.com> <nqhfo8$nvl$1@news.albasani.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
Newsgroups: news.software.nntp
Organization: TrigoFACILE -- http://www.trigofacile.com/
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 4 Sep 2016 19:40:59 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="2a01cb080103c8003cc5e8088346b549.ipv6.abo.wanadoo.fr:2a01:cb08:103:c800:3cc5:e808:8346:b549";
 logging-data="8743"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0)
 Gecko/20100101 Thunderbird/45.2.0
In-Reply-To: <nqhfo8$nvl$1@news.albasani.net>
X-Received-Bytes: 5109
X-Received-Body-CRC: 2389531563