🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
3 messages
3 total messages Started by Jonathan I. Kamens Mon, 01 Jun 1992 18:30
Re: Questions for writing newsreader
#1663
Author: Jonathan I. Kamens
Date: Mon, 01 Jun 1992 18:30
69 lines
4885 bytes
In article <lordbah.0zh3@amusing.Bah.Rochester.NY.US>, lordbah@amusing.Bah.Rochester.NY.US (Jeff Van Epps) writes:
|> Is there consensus on the best way to handle long header lines?  Just
|> fold at some random space character, or let the line grow as long as
|> it needs to, or try to preserve any pre-existing folding, or what?

Some headers fields, e.g. Path and Newsgroups, can't be folded.  Well,
actually, RFC 1036 implies that the Path field can be folded, since it says
that "Path: teklabs, zehntel, sri-unix@cca!decvax" is a valid path, and that's
equivalent to "Path: teklabs, zehntel,\n\tsri-unix@cca!decvax", but I don't
know of any software that actually allows Path lines like that :-).

Anyway, since there are some header fields that can't be folded and that can
therefore in essence be arbitrary long, you're software had better be prepared
to deal with arbitrarily long header lines.  The optimal behavior, of course,
is to allow lines as long as there are resources for the program, i.e., do not
impose any limits on line length that the system does not impose on you (in
the form of failed malloc()s, e.g.).  It *is* possible to do this.... look at
Perl or GNU grep, for example.

Among the header fields that *can* be folded, whether or not you choose to
fold them, and in what way, is pretty much up to you.  Whatever you think is
cosmetic.  Yes, folding them at the whitespace character closest to but less
than eighty characters past the beginning of the line is generally recognized
as a reasonable way to do the folding, but beware of problems like ^Hs for
underlining or discarding whitespace in the process of folding (e.g. if you
fold at the first space in a sequence of two spaces, you will only end up with
one space if there is software that unfolds the line later).

Beware, also, that unfortunately it is not unusual, even today, to find
software that chokes on multi-line header fields.  For example, some of the
FAQ postings in news.answers have multi-line Summary fields, and I
occasionally get approved postings mailed to me anyway because some site that
doesn't understand multi-line header fields (usually an ANU-NEWS site using
out-of-date software) chokes on the Summary field and assumes that the message
header ends in the middle of it, before the Approved field is noticed.

|> How long do you let the References: line get?  As long as it needs to?
|> Limit to one or two?

See above in re arbitrarily long header lines.  The References header for a
posting is generally constructed by concatenating the References header of the
message being followed up with some whitespace and the Message-ID header of
the message being followed up; there is generally no reason to prune the
References header.  They can get pretty long, but they don't usually get
*that* long.

|> For followups, I write a template to a file and bring up the editor
|> on that.  Is it best to put in all the normal headers (Keywords, Summary,
|> etc.) so the user can fill them in?  Should they be removed afterward
|> if they are still blank?  Should a user-specified template be added
|> instead of canned headers?

It is a good idea to insert at least some of the optional headers so that the
user knows what is required.  It is also a good idea to verify that the
headers that are not allowed to be non-blank are not blank; even though the
NNTP server is supposed to do this and return an error, that doesn't always
work.  For example, you should not try to feed a message with a blank or
nonexistent Subject header to the NNTP server.

You might as well delete blank header lines before sending the message to the
server, if only to reduce bandwidth.  If you don't delete them, then make sure
that all header lines, including the blank ones, have a space after the colon.

-- 
Jonathan Kamens						jik@MIT.Edu
MIT Information Systems/Athena		    Moderator, news.answers
    (Send correspondence related to the news.answers newsgroup
	{and ONLY correspondence related to the newsgroup}
		 to news-answers-request@MIT.Edu.)
Re: Questions for writing newsreader
#1669
Author: Alan Edmonds
Date: Tue, 02 Jun 1992 12:53
36 lines
3026 bytes
In article <1992Jun1.183026.23434@athena.mit.edu> jik@athena.mit.edu (Jonathan I. Kamens) writes:
>In article <lordbah.0zh3@amusing.Bah.Rochester.NY.US>, lordbah@amusing.Bah.Rochester.NY.US (Jeff Van Epps) writes:
>|> Is there consensus on the best way to handle long header lines?  Just
>|> fold at some random space character, or let the line grow as long as
>|> it needs to, or try to preserve any pre-existing folding, or what?
>
>Some headers fields, e.g. Path and Newsgroups, can't be folded.  Well,
>actually, RFC 1036 implies that the Path field can be folded, since it says
>that "Path: teklabs, zehntel, sri-unix@cca!decvax" is a valid path, and that's
>equivalent to "Path: teklabs, zehntel,\n\tsri-unix@cca!decvax", but I don't
>know of any software that actually allows Path lines like that :-).

I had a problem with news articles fed to me from an ANU-News system.
The ANU-News system folded the Path: header into the valid RFC 1036
construct (mach!mach!\n\tmach!user).  However, when I saved this
article in mailbox format using rn, the mbox.saver script could not
correctly generate a From: line.  The resulting from line looks like
From mach!mach! mach!user date etc.  Notice the space character after
the second mach.  This causes problems for Elm trying to read the 
mail folder later.

I prefer unfolded headers.  Most of the headers that do get folded are
ones you rarely look at on the tube.  References, Path, are mostly used by
news reader software, not usually news readers (humans).

Are you unfolding the headers and saving them that way to disk?  Are
the reformatted articles being transmitted to another system?

If you are not transmitting them, do whatever you want :-) If they are 
being reformatted for saving into folders or whatever, do what you want.
When you fold the headers, do you know how wide a display line is?
-- 
Alan Edmonds                                        Texas Instruments, Inc.
My opinions are only my own.                        M/S 8513
Work phone: (214)575-6427                           6620 Chase Oaks Blvd.
Email: alan@ernest.UUCP or alan@ernest.dseg.ti.com  Plano, Texas  75023
Re: Questions for writing newsreader
#1671
Author: Jonathan I. Kamens
Date: Tue, 02 Jun 1992 17:44
34 lines
2876 bytes
In article <1992Jun02.125334.25870@ernest.dseg.ti.com>, alan@ernest.dseg.ti.com (Alan Edmonds) writes:
|> I had a problem with news articles fed to me from an ANU-News system.
|> The ANU-News system folded the Path: header into the valid RFC 1036
|> construct (mach!mach!\n\tmach!user).

First of all, it is not clear from RFC 822 and RFC 1036 that software is
allowed to fold the Path field, since the Path field is a "structured field"
of some sort, and there are mumblings in RFC 822 about not mucking with the
format of structured fields.

Second, even if it IS legal to fold the Path field, it is NOT be legal to do
what you described above, because the specifications state quite clearly that
folding can take place only where there is whitespace in the original,
unfolded field value.

ANU-News appears to be assuming that software is actually prepared to handle
the Path header format documented in RFC 1036, even though there isn't really
any software out there that uses anything other than the foo!bar!baz format;
after making this assumption, it further assumes that if the RFC 1036 format
is followed, it won't matter if an extra space is inserted into the field,
despite the fact that other portions of the specifications say that this is
illegal.

In summary, I'd say that this is yet another instance of ANU-News doing
something it's not allowed to do.  Perhaps it was fixed in later versions of
ANU-News that some sites are running; I have, in the past, encountered other
ANU-News bugs that occurred only because admins had not updated their software.

-- 
Jonathan Kamens						jik@MIT.Edu
MIT Information Systems/Athena		    Moderator, news.answers
    (Send correspondence related to the news.answers newsgroup
	{and ONLY correspondence related to the newsgroup}
		 to news-answers-request@MIT.Edu.)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads