Article View: news.software.nntp
Article #84386Re: INN's mailpost script - requested change.
From: D. Stussy
Date: Thu, 22 Sep 2011 07:32
Date: Thu, 22 Sep 2011 07:32
86 lines
5364 bytes
5364 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:87r539tgkk.fsf@windlord.stanford.edu...
> "D. Stussy" <spam+newsgroups@bde-arc.ampr.org> writes:
> > "Russ Allbery" <rra@stanford.edu> wrote:
>
> >> You should really fold them rather than truncating them if possible.
>
> > How would folding help? The limit is the unfolded maximum, isn't it?
>
> No, it's only the limit on the line length. RFC 5322:
>
> 2.1.1. Line Length Limits
>
> There are two limits that this specification places on the number of
> characters in a line. Each line of characters MUST be no more than
> 998 characters, and SHOULD be no more than 78 characters, excluding
> the CRLF.
>
> The 998 character limit is due to limitations in many implementations
> that send, receive, or store IMF messages which simply cannot handle
> more than 998 characters on a line. Receiving implementations would
> do well to handle an arbitrarily large number of characters in a line
> for robustness sake. However, there are so many implementations that
> (in compliance with the transport requirements of [RFC5321]) do not
> accept messages containing more than 1000 characters including the CR
> and LF per line, it is important for implementations not to create
> such messages.
>
> [...]
>
> 2.2.3. Long Header Fields
>
> Each header field is logically a single line of characters comprising
> the field name, the colon, and the field body. For convenience
> however, and to deal with the 998/78 character limitations per line,
> the field body portion of a header field can be split into a
> multiple-line representation; this is called "folding". The general
> rule is that wherever this specification allows for folding white
> space (not simply WSP characters), a CRLF may be inserted before any
> WSP.
>
> 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.
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. However, I'm not certain that a "note" in an RFC should be
controlling (as opposed to its normal text).
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.
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....
Technical Details
Message-ID:
<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.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news.glorb.com!news.snarked.org!pool-71-106-211-51.lsanca.dsl-w.verizon.net!not-for-mailReferences:
<j5e6c0$8ib$1@snarked.org> <87vcslti2y.fsf@windlord.stanford.edu><j5e89d$k6f$1@snarked.org> <87r539tgkk.fsf@windlord.stanford.edu>Show Full Headers
Complete Article Headers
Message-ID: <j5eo9u$mnd$1@snarked.org> Subject: Re: INN's mailpost script - requested change. Date: Thu, 22 Sep 2011 00:32:17 -0700 From: "D. Stussy" <spam+newsgroups@bde-arc.ampr.org> References: <j5e6c0$8ib$1@snarked.org> <87vcslti2y.fsf@windlord.stanford.edu><j5e89d$k6f$1@snarked.org> <87r539tgkk.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.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news.glorb.com!news.snarked.org!pool-71-106-211-51.lsanca.dsl-w.verizon.net!not-for-mail Newsgroups: news.software.nntp Lines: 86 Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org> Injection-Date: Thu, 22 Sep 2011 07:32:14 +0000 (UTC) Injection-Info: snarked.org; posting-host="pool-71-106-211-51.lsanca.dsl-w.verizon.net:71.106.211.51"; logging-data="23277"; mail-complaints-to="newsmaster+complaints@snarked.org" X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1478 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1478 X-Original-Bytes: 5114