🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #84388

Re: INN's mailpost script - requested change.

#84388
From: Russ Allbery
Date: Thu, 22 Sep 2011 20:35
68 lines
4223 bytes
"D. Stussy" <spam+newsgroups@bde-arc.ampr.org> writes:
> "Russ Allbery" <rra@stanford.edu> wrote:

>> and RFC 5536:

>>    o  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).
>>       [USEAGE] includes suggested limits for convenience of display by
>>       user agents.

>>          NOTE: As stated in [RFC5322], there is NO restriction on the
>>          number of lines into which a header field may be split, and
>>          hence there is NO restriction on the total length of a header
>>          field (in particular it may, by suitable folding, be made to
>>          exceed the 998-octet restriction pertaining to a single header
>>          field line).

> And I read this as indicating that header fields (including the header
> name) should not be longer than 998 bytes and should be folded into
> multiple lines of 78 bytes (or less), thus implying that 998 is the
> UNFOLDED maximum length.

The NOTE above says directly and explicitly not to read things that way to
be sure that people don't read the text in a way other than what was
intended.  We verified the intended meaning with the DRUMS working group
at the time.

> If what you are saying is that FOLDED lines may not be longer than 998
> bytes, then such implies that there is NO LIMIT on the length of
> unfolded header data.

Correct.

> However, I'm not certain that a "note" in an RFC should be controlling
> (as opposed to its normal text).

The NOTE is trying to explain the intent of the text.  The word "line" in
the text refers to a folded line, not the unfolded header value.

> Regardless, when perl is manipulating header lines in mailpost, isn't it
> dealing with unfolded lines?

> Cf. Line 192's comment:  # Gather up a single header with possible
> continuation lines into $line.

> Cf. Line 266's comment:  # 986 = 998 (maximum per RFC 5536) -
> length("References: ")
> - Here' we're manipulating an UNFOLDED header.  Whoever wrote that comment
> also believes that 998 bytes is the unfolded limit.

The comment seems to be buggy, indeed.

> Regardless, as we have unfolded all headers while reading them, there is
> NO CODE which re-folds them for submission to NNRPD (when written to
> TMPFILE at lines 360-366).  That's a problem when folding is necessary
> due to headers exceeding the limit....

Yes.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID: <87sjno8gdc.fsf@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.unit0.net!news.glorb.com!usenet.stanford.edu!usenet-its.stanford.edu!not-for-mail
References: <j5e6c0$8ib$1@snarked.org> <87vcslti2y.fsf@windlord.stanford.edu> <j5e89d$k6f$1@snarked.org> <87r539tgkk.fsf@windlord.stanford.edu> <j5eo9u$mnd$1@snarked.org>

Show Full Headers
Complete Article Headers
Message-ID: <87sjno8gdc.fsf@windlord.stanford.edu>
Subject: Re: INN's mailpost script - requested change.
Date: Thu, 22 Sep 2011 13:35:43 -0700
From: Russ Allbery <rra@stanford.edu>
References: <j5e6c0$8ib$1@snarked.org> <87vcslti2y.fsf@windlord.stanford.edu> <j5e89d$k6f$1@snarked.org> <87r539tgkk.fsf@windlord.stanford.edu> <j5eo9u$mnd$1@snarked.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.unit0.net!news.glorb.com!usenet.stanford.edu!usenet-its.stanford.edu!not-for-mail
Newsgroups: news.software.nntp
Organization: The Eyrie
Lines: 68
NNTP-Posting-Host: windlord.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: usenet-its.stanford.edu 1316723743 30806 171.67.225.134 (22 Sep 2011
X-Complaints-To: news@usenet-its.stanford.edu
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)
Cancel-Lock: sha1:JrW+3AKucVZfnsm0sY6lbFyKr2o=
X-Original-Bytes: 4024