🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
51 messages
51 total messages Started by Ned Latham Fri, 05 Jul 2002 06:49
News servers, nntpcache, slrn and the Usenet bug "From ".
#59453
Author: Ned Latham
Date: Fri, 05 Jul 2002 06:49
73 lines
3268 bytes
I hope you don't mind the crosspost, people, but I'n not sure which
group is best for this, and I want to get some solid info as quickly
as possible.

I read news with slrn from three different servers, with my
ISP transporting news to me from the first of them below via
nntpcache.

I read message <9617651d.0207032045.7d83644f@posting.google.com>
from all three servers, and they all presented it to me as follows
(relevant portion only):

----paste----
>> Stan Pierce.
>
>
>Well the answer to that is obvious  -  piss religion off.


>From the state? completely.

>From peoples freedom to believe? impossible
----end paste----

Those two lines beginning with ">From " are incorrect. If you retrieve
the message from google, it looks like this:

----paste----
>> Stan Pierce.
>
>
>Well the answer to that is obvious  -  piss religion off.


From the state? completely.

From peoples freedom to believe? impossible
----end paste----

I answered under the impression that the two incorrect lines were
correct, and have now been accused of forgery.

It's a false accusation. But I don't know the exact details of the truth.
I see three possibilities:

1. All three of the servers I use are subject to the ">From " bug;

2. My ISP's nntpcache has it, and the two servers I connect to directly
   are subject to it;

3. My slrn has it.

Can anyone help, please? Does anyone know for sure about that bug and
slrn? Or about that bug and nntpcache?

Here are the Xref: header lines, identfying the servers, and giving
the article numbers produced by those servers:

Xref: news.can.connect.com.au aus.culture.true-blue:27193
Xref: news.freenet.de aus.culture.true-blue:11783
Xref: fr.usenet-edu.net!usenet-edu.net aus.culture.true-blue:15490

I connect to the first with NNTPSERVER set to apex.net.au (my ISP),
the second with it set to newscache3.freenet.de, and the third with
it set to lord.usenet-edu.net.

TIA,

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59454
Author: Andrew Gierth
Date: Fri, 05 Jul 2002 09:51
31 lines
1985 bytes
>>>>> "Ned" == Ned Latham <nenosed@news.apex.met.au> writes:

 [adding of > to lines starting "From "]

 Ned> It's a false accusation. But I don't know the exact details of
 Ned> the truth.  I see three possibilities:

 Ned> 1. All three of the servers I use are subject to the ">From " bug;

no (easily checked by looking up the article on one of the servers)

 Ned> 2. My ISP's nntpcache has it, and the two servers I connect to
 Ned> directly are subject to it;

likewise

(just connect to one of the servers with telnet and issue the command
ARTICLE <message-id> to see the article as the server has it)

 Ned> 3. My slrn has it.

gotta be this one.

What version of slrn?

(Changing "From " to ">From " is not a news bug of any kind, it's
standard behaviour for anything that uses Unix mbox _mail_ format.)

-- 
Andrew.
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59458
Author: Ned Latham
Date: Fri, 05 Jul 2002 11:21
69 lines
3283 bytes
Andrew Gierth wrote in <87eleisdsw.fsf@erlenstar.demon.co.uk>:
> >>>>> "Ned" == Ned Latham <nenosed@news.apex.met.au> writes:
> 
>  [adding of > to lines starting "From "]
> 
>  Ned> It's a false accusation. But I don't know the exact details of
>  Ned> the truth.  I see three possibilities:
> 
>  Ned> 1. All three of the servers I use are subject to the ">From " bug;
> 
> no (easily checked by looking up the article on one of the servers)
> 
>  Ned> 2. My ISP's nntpcache has it, and the two servers I connect to
>  Ned> directly are subject to it;
> 
> likewise
> 
> (just connect to one of the servers with telnet and issue the command
> ARTICLE <message-id> to see the article as the server has it)

Tried it. Failed.

telnet lord.usenet-edu.net
Trying 213.56.195.71...
Connected to lord.usenet-edu.net.
Escape character is '^]'.
Connection closed by foreign host.

The disconnection was after four seconds.
After a couple of tries, I got
ARTICLE <9617651d.0207032045.7d83644f@posting.google.com>
out by using the mouse, but it ignored the command.

telnet newscache3.freenet.de
Trying 194.97.5.11...
telnet: Unable to connect to remote host: Connection refused

telnet news.can.connect.com.au
Trying 192.189.54.36...

but no connection.

I've never used telnet before, except at Uni to connect to another
machine on a different LAN. What did you do?

>  Ned> 3. My slrn has it.
> 
> gotta be this one.

Erk. I was afraid of that. Now I spose I hafta go trawling through
the code.
 
> What version of slrn?

0.9.6.3 at present.

> (Changing "From " to ">From " is not a news bug of any kind, it's
> standard behaviour for anything that uses Unix mbox _mail_ format.)

Ugh. Are you saying that the insertion of intrusive characters into
the body of a message isn't regarded as a bug?

Thanks for the response, Andrew.

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59459
Author: Conrad Sabatier
Date: Fri, 05 Jul 2002 11:50
25 lines
2116 bytes
In article <slrnaib0fg.3b6.nenosed@arthur.valhalla.net.oz>,
Ned Latham <nenosed@apex.met.au> wrote:
>Andrew Gierth wrote in <87eleisdsw.fsf@erlenstar.demon.co.uk>:
>> 
>> (just connect to one of the servers with telnet and issue the command
>> ARTICLE <message-id> to see the article as the server has it)
>
>Tried it. Failed.
>
>telnet lord.usenet-edu.net
>Trying 213.56.195.71...
>Connected to lord.usenet-edu.net.
>Escape character is '^]'.
>Connection closed by foreign host.

You have to specify the NNTP port:

telnet lord.usenet-edu.net 119

-- 
Conrad Sabatier <conrads@cox.net>
For free admission to the Clueless Usenet Posters Club (fastest growing
group on the Internet), simply quote this entire article (including this
sig) in a followup, making sure to post all of your remarks at the top.
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59460
Author: Ned Latham
Date: Fri, 05 Jul 2002 13:10
24 lines
1963 bytes
Conrad Sabatier wrote in <3d25881d$1@localhost>:
> Ned Latham wrote:
> > Andrew Gierth wrote:
> > > 
> > > (just connect to one of the servers with telnet and issue the command
> > > ARTICLE <message-id> to see the article as the server has it)
> >
> > Tried it. Failed.

----snip----

> You have to specify the NNTP port:
>
> telnet lord.usenet-edu.net 119

Arg! (slaps forehead) Thanks Conrad. That worked fine.

The article came through without the intrusive characters, too.

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59461
Author: Matthew Malthouse
Date: Fri, 05 Jul 2002 14:10
25 lines
2129 bytes
In article <slrnaib0fg.3b6.nenosed@arthur.valhalla.net.oz>, Ned Latham wrote:
> Andrew Gierth wrote in <87eleisdsw.fsf@erlenstar.demon.co.uk>:
>> 
>>  [adding of > to lines starting "From "]
>> 
>> (Changing "From " to ">From " is not a news bug of any kind, it's
>> standard behaviour for anything that uses Unix mbox _mail_ format.)
> 
> Ugh. Are you saying that the insertion of intrusive characters into
> the body of a message isn't regarded as a bug?

Not a bug but a feature.

It's inserted to avoid any possible confusion with the "From " (note, no
colon) in the mbox. I suspect that MTAs and MUAs are savvy enough to
cope and the precaution is redundant, a legacy; but I might be wrong on
that one.

Matthew
-- 
Truth is the most valuable thing we have -- so let us economize it.
                -- Mark Twain

    http://www.calmeilles.co.uk/
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59462
Author: Ned Latham
Date: Fri, 05 Jul 2002 14:41
40 lines
2747 bytes
Matthew Malthouse wrote in <DNhV8.6017$xf3.1063173@news11-gui.server.ntli.net>:
> Ned Latham wrote:
> > Andrew Gierth wrote in <87eleisdsw.fsf@erlenstar.demon.co.uk>:
> > > 
> > >  [adding of > to lines starting "From "]
> > > 
> > > (Changing "From " to ">From " is not a news bug of any kind, it's
> > > standard behaviour for anything that uses Unix mbox _mail_ format.)
> > 
> > Ugh. Are you saying that the insertion of intrusive characters into
> > the body of a message isn't regarded as a bug?
>
> Not a bug but a feature.

With hairy legs.

> It's inserted to avoid any possible confusion with the "From " (note, no
> colon) in the mbox.

That was what I thought. It's also why I think of it as a bug. Mail or
News, all messages carry Lines: headers, right? Confusion shouldn't be
possible.

>                     I suspect that MTAs and MUAs are savvy enough to
> cope and the precaution is redundant, a legacy; but I might be wrong on
> that one.

Er... legacy. There was a time when mail didn't have Lines: headers?

Anyway, I regard it as a bug, especially for my use of slrn, which
doesn't include email. I've found the offending code (in art.c),
and I'll recompile tomorrow.

Thanks for the info, guys.

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59463
Author: Kjetil Torgrim Homme
Date: Fri, 05 Jul 2002 15:10
14 lines
1825 bytes
[Ned Latham]:
>
>   That was what I thought. It's also why I think of it as a
>   bug. Mail or News, all messages carry Lines: headers, right?
>   Confusion shouldn't be possible.

you can't trust Lines: to be correct.

-- 
Kjetil T.      /XXX\   /XXX\   /XXX\   /XXX\ /XX\  /XX\  /XX\  /XX\  ///
              ///X\\\ ///X\\\ ///X\\\ ///X\\///\\\///\\\///\\\///\\\///
             //// \\\X/// \\\X/// \\\X/// \XX/  \XX/  \XX/  \XX/  \XX/
            ////   \XXX/   \XXX/   \XXX/     http://folding.stanford.edu
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59465
Author: Phil Boutros
Date: Fri, 05 Jul 2002 15:26
17 lines
1430 bytes
Ned Latham <nenosed@news.apex.met.au> wrote:
>  
>> What version of slrn?
> 
> 0.9.6.3 at present.

	This is a very old version.  When asking for help with a
software problem, it is usually wise to first upgrade to the latest
stable version of that particular software.


Phil
-- 
AH#61  Wolf#14  BS#89  bus#1  CCB#1    philb@total.net
http://www.total.net/~philb        http://eddiekieger.com 
In Memory of Buster the Dog.         EKIII rides with me.
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59468
Author: Russ Allbery
Date: Fri, 05 Jul 2002 15:38
25 lines
2233 bytes
Matthew Malthouse <usenet@calmeilles.demon.co.uk> writes:

> Not a bug but a feature.

> It's inserted to avoid any possible confusion with the "From " (note, no
> colon) in the mbox. I suspect that MTAs and MUAs are savvy enough to
> cope and the precaution is redundant, a legacy; but I might be wrong on
> that one.

Except that it has no business doing that while just displaying the
article.  Did the original poster save the article to a mailbox file
first?

(And no, MUAs aren't savvy enough to cope; they can't be.  "From " is a
terminator in mailbox format.  You can try to parse the stuff after it,
but it varies a lot; the only safe thing to do is to always escape any
"From " that occurs at the beginning of a paragraph, or use some better,
less broken format than mailbox.)

-- 
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.
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59473
Author: Matthew Malthouse
Date: Fri, 05 Jul 2002 17:26
43 lines
2924 bytes
In article <slrnaibc7b.3hu.nenosed@arthur.valhalla.net.oz>, Ned Latham wrote:
> Matthew Malthouse wrote in <DNhV8.6017$xf3.1063173@news11-gui.server.ntli.net>:
>> Ned Latham wrote:
>> > 
>> > Ugh. Are you saying that the insertion of intrusive characters into
>> > the body of a message isn't regarded as a bug?
>>
>> Not a bug but a feature.
> 
> With hairy legs.
> 
>> It's inserted to avoid any possible confusion with the "From " (note, no
>> colon) in the mbox.
> 
> That was what I thought. It's also why I think of it as a bug. Mail or
> News, all messages carry Lines: headers, right? Confusion shouldn't be
> possible.
> 
>>                     I suspect that MTAs and MUAs are savvy enough to
>> cope and the precaution is redundant, a legacy; but I might be wrong on
>> that one.
> 
> Er... legacy. There was a time when mail didn't have Lines: headers?
 
Software parsing the mbox looking for "^From " as first line of mail. 

> Anyway, I regard it as a bug, especially for my use of slrn, which
> doesn't include email. I've found the offending code (in art.c),
> and I'll recompile tomorrow.

It's just occured to me to wonder if it's not quite as redundant as I
thought.  You might regret that re-compile if you post to moderated
groups and thus your articles are sent by mail transport.

Does anyone know if I'm worrying too much here?

Matthew
-- 
Truth is the most valuable thing we have -- so let us economize it.
                -- Mark Twain

    http://www.calmeilles.co.uk/
slrn and "From "
#59474
Author: those who know me have no need o...
Date: Fri, 05 Jul 2002 19:34
16 lines
1703 bytes
[fu-t set]

in news.software.readers i read:

>It's just occured to me to wonder if it's not quite as redundant as I
>thought.  You might regret that re-compile if you post to moderated
>groups and thus your articles are sent by mail transport.
>
>Does anyone know if I'm worrying too much here?

the receiving mta should stuff if necessary, no need to do it before
sending, and certainly no reason to do it on display.

-- 
bringing you boring signatures for 17 years
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59475
Author: Thomas Schultz
Date: Fri, 05 Jul 2002 19:55
18 lines
1985 bytes
[Followup-To: news.software.readers set]

* Ned Latham [2002-07-05 14:41] :
[...]
> Anyway, I regard it as a bug, especially for my use of slrn, which
> doesn't include email. I've found the offending code (in art.c), and
> I'll recompile tomorrow.

If you look at that bit of code again, you'll notice that it is only
used when saving an article to an mbox file. In this case, you need to
escape lines that start with "From ", so you probably do not really
want to remove the code.
-- 
Thomas Schultz <tststs@gmx.de> * Recent news from http://slrn.sourceforge.net/
 -> [2002-03-13] slrn 0.9.7.4 is out
 -> [2002-02-03] Screenshot page online / "Port" to Mac OS X
 -> [2001-11-05] slrn 0.9.7.3 is out
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59476
Author: Curt Welch
Date: Fri, 05 Jul 2002 19:55
93 lines
5222 bytes
nenosed@apex.met.au wrote:
> That was what I thought. It's also why I think of it as a bug. Mail or
> News, all messages carry Lines: headers, right? Confusion shouldn't be
> possible.
>
> >                     I suspect that MTAs and MUAs are savvy enough to
> > cope and the precaution is redundant, a legacy; but I might be wrong on
> > that one.
>
> Er... legacy. There was a time when mail didn't have Lines: headers?

Just so history isn't forgotten...

The old orignal unix mail program didn't have ANY headers except the
single From line at the beginning of the e-mail.  Here's a few old
messages from an old mbox of mine (I've been saving e-mail from before it
was called e-mail).

--- begin old mail ---

From rupp Mon Jul 11 11:46:55 1977


  curt:
          Looks like somebody set the date wrong (you?).

                          ed

From curt Wed Jul 20 19:15:00 1977
  A new user called miniu has been created for
  backing up minunix.  The password is "backup".
  Try loging on miniu to get more information.

From carl Tue Feb 27 08:08:53 1979
  Curt -

          I have another tape I would like to mount on the system and
  transfer to rk05 when you get the chance today.  I think you might
  find this tape even more enjoyable than the last.

          In addition there was a lot of software they wouldn't let me have
  since it came from a tape of Bill Joy's (@ Berkeley) and was thus
  proprietary.  However, they said that the entire tape was available
  for something like a $50 copying charge.  I think much of this stuff
  would be worth the money, in particular a new version of 'ed' called
  'ex' which works to a 22 line screen (a la RAND) but retains much of
  the flavor of 'ed'.

          From:
                  William Joy
                  Computer Science Division
                  Department of Electrical Engineering and
                          Computer Science
                  UC Berkeley  94704

                  415-642-4948


  Let me know when you have time..
                                          Carl

--- end old mail ---

Programs that parsed these type of mbox files simply looked for lines
begining with "From " to find the beginning of each message.  This mail
program was from before Unix had any type of networking.  Most machines
didn't even have dial-up modems for remote access.  It was used only to
send messages between users on the same machine.  It even pre-dates UUCP.
If you wrote a message which had a "From " at the begining of a line, the
program would insert > at the beginning of the line.  This was a strange
side effect of the program because it was so common to find lines beginning
with "From", but it just wasn't seen as a problem big enough to care about.
If it was seen as a problem, then something only slightly more complex
could have been used instead (like dot stuffing for NNTP), where the user
would never see the side-effect.  But for a stupid little program to help
users send 5 lines messages back and forth between the 10 or so users
sharing a PDP 11 (all of who were located at the same place), it just
wasn't an issue.

But, for backward compatibilty reasons, mail programs (and many unix based
Usenet news readers) continued to save messages in this stupid old mbox
format.  Now, 25 years later, we have millions of people world-wide seeing
"From" changed to ">From" and having no clue why it happens.

Nothing in USENET has ever required this to be done and I've never heard of
a server that did it.  I've only seen it done when messages which are saved
in "mbox" format so Unix mail programs could read them or when they are
sent via e-mail systems that still have that old habit.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59478
Author: Andrew Gierth
Date: Sat, 06 Jul 2002 02:00
13 lines
1578 bytes
>>>>> "Ned" == Ned Latham <nenosed@news.apex.met.au> writes:

 >> (Changing "From " to ">From " is not a news bug of any kind, it's
 >> standard behaviour for anything that uses Unix mbox _mail_ format.)

 Ned> Ugh. Are you saying that the insertion of intrusive characters
 Ned> into the body of a message isn't regarded as a bug?

no, I'm saying that it's not a _news_ bug.

-- 
Andrew.
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59477
Author: Ned Latham
Date: Sat, 06 Jul 2002 04:49
16 lines
1942 bytes
Kjetil Torgrim Homme wrote in <1rlm8q2ots.fsf@vingodur.ifi.uio.no>:
> [Ned Latham]:
> >
> >   That was what I thought. It's also why I think of it as a
> >   bug. Mail or News, all messages carry Lines: headers, right?
> >   Confusion shouldn't be possible.
>
> you can't trust Lines: to be correct.

Ye gods! Do you know why?

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59479
Author: Ned Latham
Date: Sat, 06 Jul 2002 04:56
31 lines
2398 bytes
Russ Allbery wrote in <ylbs9mnq1p.fsf@windlord.stanford.edu>:
> Matthew Malthouse <usenet@calmeilles.demon.co.uk> writes:
> >
> > Not a bug but a feature.
> >
> > It's inserted to avoid any possible confusion with the "From " (note, no
> > colon) in the mbox. I suspect that MTAs and MUAs are savvy enough to
> > cope and the precaution is redundant, a legacy; but I might be wrong on
> > that one.
> 
> Except that it has no business doing that while just displaying the
> article.

It doesn't. But it does on file saves.

>           Did the original poster save the article to a mailbox file
> first?

Not intentionally. I'm archiving that newsgroup. What I do is tag the
messages, save them, them read them and compose replies in vi.

I've found the offending code. Articles saved that way are saved in
unix mail format.

----snip----

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59480
Author: Ned Latham
Date: Sat, 06 Jul 2002 05:06
39 lines
2908 bytes
Matthew Malthouse wrote in <cFkV8.798$7j.92614@news8-gui.server.ntli.net>:
> Ned Latham wrote:
> > Matthew Malthouse wrote:

----snip----

> > >                     I suspect that MTAs and MUAs are savvy enough to
> > > cope and the precaution is redundant, a legacy; but I might be wrong
> > > on that one.
> > 
> > Er... legacy. There was a time when mail didn't have Lines: headers?
> 
> Software parsing the mbox looking for "^From " as first line of mail. 

Er, yes. I wrote a news analysis program that does the same thing. But
it doesn't look for them within the body of a message (it reads Lines:
for the length of the body).

Sounds like I'm depending on something unreliable. Can someone tell me
what RFC's I need to read in order to understand mail and news as they
are nowadays?

> > Anyway, I regard it as a bug, especially for my use of slrn, which
> > doesn't include email. I've found the offending code (in art.c),
> > and I'll recompile tomorrow.
> 
> It's just occured to me to wonder if it's not quite as redundant as I
> thought.  You might regret that re-compile if you post to moderated
> groups and thus your articles are sent by mail transport.

I haven't done it yet. The intention is to change only the file save code.

----snip----

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59482
Author: Ned Latham
Date: Sat, 06 Jul 2002 05:18
18 lines
1968 bytes
Andrew Gierth wrote in <874rfdmx8a.fsf@erlenstar.demon.co.uk>:
> >>>>> "Ned" == Ned Latham <nenosed@news.apex.met.au> writes:
> 
>  >> (Changing "From " to ">From " is not a news bug of any kind, it's
>  >> standard behaviour for anything that uses Unix mbox _mail_ format.)
> 
>  Ned> Ugh. Are you saying that the insertion of intrusive characters
>  Ned> into the body of a message isn't regarded as a bug?
> 
> no, I'm saying that it's not a _news_ bug.

Gotcha. Thanks.

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59481
Author: Russ Allbery
Date: Sat, 06 Jul 2002 05:19
26 lines
2387 bytes
In news.software.nntp, Ned Latham <nenosed@news.apex.met.au> writes:
> Kjetil Torgrim Homme wrote in <1rlm8q2ots.fsf@vingodur.ifi.uio.no>:
>> [Ned Latham]:

>>>   That was what I thought. It's also why I think of it as a
>>>   bug. Mail or News, all messages carry Lines: headers, right?
>>>   Confusion shouldn't be possible.

>> you can't trust Lines: to be correct.

> Ye gods! Do you know why?

Well, because it's frequently wrong is the simple answer.  Why that is is
due to a lot of reasons, ranging from bad algorithms for generating it to
rampant bugs that no one notices because no one uses Lines.

<http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/content-length.html>
is worth reading, on this general topic, although it's specifically about
a different attempt at solving this same problem.

-- 
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.
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59483
Author: Ned Latham
Date: Sat, 06 Jul 2002 05:24
37 lines
2715 bytes
Curt Welch wrote in <20020705155555.430$aG@newsreader.com>:
> nenosed@apex.met.au wrote:
> >
> > That was what I thought. It's also why I think of it as a bug. Mail or
> > News, all messages carry Lines: headers, right? Confusion shouldn't be
> > possible.
> >
> > >                     I suspect that MTAs and MUAs are savvy enough to
> > > cope and the precaution is redundant, a legacy; but I might be wrong on
> > > that one.
> >
> > Er... legacy. There was a time when mail didn't have Lines: headers?
> 
> Just so history isn't forgotten...
> 
> The old orignal unix mail program didn't have ANY headers except the
> single From line at the beginning of the e-mail.  Here's a few old
> messages from an old mbox of mine (I've been saving e-mail from before
> it was called e-mail).
> 
> --- begin old mail ---

----snip----

So that's the legacy. Wow.

Well, as I see it, this whole problem could be made to go away if the
Lines: headers were always present and always accurate. Is there any
reason to doubt Lines: headers?

----snip----

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59484
Author: Ned Latham
Date: Sat, 06 Jul 2002 05:46
39 lines
2892 bytes
Russ Allbery wrote in <ylfzyxl9fx.fsf@windlord.stanford.edu>:
> Ned Latham wrote:
> > Kjetil Torgrim Homme wrote:
> >> [Ned Latham]:
> 
> >>>   That was what I thought. It's also why I think of it as a
> >>>   bug. Mail or News, all messages carry Lines: headers, right?
> >>>   Confusion shouldn't be possible.
> 
> >> you can't trust Lines: to be correct.
> 
> > Ye gods! Do you know why?
> 
> Well, because it's frequently wrong is the simple answer.  Why that is is
> due to a lot of reasons, ranging from bad algorithms for generating it to
> rampant bugs that no one notices because no one uses Lines.

But I do. *sob* (Doesn't seem to have caused any problem to date, though.)

> <http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/content-length.html>
> is worth reading, on this general topic, although it's specifically about
> a different attempt at solving this same problem.

Interesting (in the Chinese sense). Seems the more I learn, the worse things
look.

It seems that instead of parsing the saved files during input, I'm going
to have to read them into a filesized buffer so that I can parse them more
flexibly.

Oh well, the proggy *is* due for a rewrite.

----snip----

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59485
Author: M. Buchenrieder
Date: Sat, 06 Jul 2002 08:55
25 lines
1883 bytes
nenosed@news.apex.met.au (Ned Latham) writes:

[...]

>That was what I thought. It's also why I think of it as a bug. Mail or
>News, all messages carry Lines: headers, right? 

No.

>Confusion shouldn't be
>possible.

[...]

Wrong. The Lines: header is merely a matter of optics. You can't
trust it at all, since the definition of a "line" may widely vary
depending from the kind of machine the message has been created
or been inserted into the newsfeed at.

Michael
-- 
Michael Buchenrieder * mibu@scrum.greenie.muc.de * http://www.muc.de/~mibu
          Lumber Cartel Unit #456 (TINLC) & Official Netscum
    Note: If you want me to send you email, don't munge your address.
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59488
Author: Ned Latham
Date: Sat, 06 Jul 2002 12:57
32 lines
2296 bytes
M. Buchenrieder wrote in <GytKsw.GFI@scrum.muc.de>:
> Ned Latham writes:
>
> [...]
>
> > That was what I thought. It's also why I think of it as a bug. Mail or
> > News, all messages carry Lines: headers, right? 
>
> No.

*sigh* The news just gets worse and worse.

> > Confusion shouldn't be
> > possible.
>
> [...]
>
> Wrong. The Lines: header is merely a matter of optics. You can't
> trust it at all, since the definition of a "line" may widely vary
> depending from the kind of machine the message has been created
> or been inserted into the newsfeed at.

I thought it was defined by the newline character or sequence.

Damn. What do the RFC's say about this? (Which RFC's are relevant,
anyway?)

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59490
Author: Kjetil Torgrim Homme
Date: Sat, 06 Jul 2002 16:28
23 lines
2473 bytes
[Ned Latham]:
>
>   M. Buchenrieder wrote in <GytKsw.GFI@scrum.muc.de>:
>   > Wrong. The Lines: header is merely a matter of optics. You can't
>   > trust it at all, since the definition of a "line" may widely vary
>   > depending from the kind of machine the message has been created
>   > or been inserted into the newsfeed at.
>   
>   I thought it was defined by the newline character or sequence.

well, yes, but some news software is layered so that they emit a
message and leave it to a MIME component to convert it into
quoted-printable or base64.  such software often simply makes a best
guess for the number of lines, since Lines: is only a hint for the
human reader anyway.  another source of errors is news clients which
don't include the signature in the line count.

-- 
Kjetil T.      /XXX\   /XXX\   /XXX\   /XXX\ /XX\  /XX\  /XX\  /XX\  ///
              ///X\\\ ///X\\\ ///X\\\ ///X\\///\\\///\\\///\\\///\\\///
             //// \\\X/// \\\X/// \\\X/// \XX/  \XX/  \XX/  \XX/  \XX/
            ////   \XXX/   \XXX/   \XXX/     http://folding.stanford.edu
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59500
Author: J.B. Moreno
Date: Sat, 06 Jul 2002 20:02
28 lines
2601 bytes
Ned Latham <nenosed@news.apex.met.au> wrote:

> Russ Allbery wrote in <ylfzyxl9fx.fsf@windlord.stanford.edu>:
> > Ned Latham wrote:
> > > Kjetil Torgrim Homme wrote:
> > >> [Ned Latham]:
> > 
> > >>>   That was what I thought. It's also why I think of it as a
> > >>>   bug. Mail or News, all messages carry Lines: headers, right?
> > >>>   Confusion shouldn't be possible.
> > 
> > >> you can't trust Lines: to be correct.
> > 
> > > Ye gods! Do you know why?
> > 
> > Well, because it's frequently wrong is the simple answer.  Why that is is
> > due to a lot of reasons, ranging from bad algorithms for generating it to
> > rampant bugs that no one notices because no one uses Lines.
> 
> But I do. *sob* (Doesn't seem to have caused any problem to date, though.)

Really?  You're still using it after people have told you it's
frequently incorrect?  Why?

-- 
JBM
"Your depression will be added to my own" --  Marvin of Borg
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59501
Author: J.B. Moreno
Date: Sat, 06 Jul 2002 20:02
22 lines
2339 bytes
Ned Latham <nenosed@news.apex.met.au> wrote:

> Russ Allbery wrote in <ylbs9mnq1p.fsf@windlord.stanford.edu>:

> > Did the original poster save the article to a mailbox file first?
> 
> Not intentionally. I'm archiving that newsgroup. What I do is tag the
> messages, save them, them read them and compose replies in vi.
> 
> I've found the offending code. Articles saved that way are saved in
> unix mail format.

Can slrn (I assume that is the program you are using when you "tag" and
save the articles) save them in rnews format?  From the above and some
other comments, it sounds like it'd be a better fit for the way you are
doing things.  If it can't, then I'd suggest looking into seeing if you
couldn't patch it to do so.

-- 
JBM
"Your depression will be added to my own" --  Marvin of Borg
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59503
Author: Kjetil Torgrim Homme
Date: Sat, 06 Jul 2002 20:11
14 lines
1953 bytes
[J.B. Moreno]:
>
>   Can slrn (I assume that is the program you are using when you
>   "tag" and save the articles) save them in rnews format?

ah, I was wondering, is rnews format always CR LF, or does it use the
local newline convention?

-- 
Kjetil T.      /XXX\   /XXX\   /XXX\   /XXX\ /XX\  /XX\  /XX\  /XX\  ///
              ///X\\\ ///X\\\ ///X\\\ ///X\\///\\\///\\\///\\\///\\\///
             //// \\\X/// \\\X/// \\\X/// \XX/  \XX/  \XX/  \XX/  \XX/
            ////   \XXX/   \XXX/   \XXX/     http://folding.stanford.edu
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59504
Author: J.B. Moreno
Date: Sat, 06 Jul 2002 20:31
23 lines
2380 bytes
Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> wrote:

> [J.B. Moreno]:
> >
> >   Can slrn (I assume that is the program you are using when you
> >   "tag" and save the articles) save them in rnews format?
> 
> ah, I was wondering, is rnews format always CR LF, or does it use the
> local newline convention?

I don't know of anywhere where it is definitely stated one way or the
other, but do know that whatever the "definite" answer is a tool that
expects to "read" it should be prepared to encounter CR, LF or CRLF
(plus whatever the local convention is if you're running on some weird
OS that uses something else).

And IMO when writing it out, you should use the local newline
convention.

-- 
JBM
"Your depression will be added to my own" --  Marvin of Borg
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59505
Author: itsy bitsy meowbot
Date: Sat, 06 Jul 2002 21:51
15 lines
2120 bytes
Kjetil Torgrim Homme wrote:

> ah, I was wondering, is rnews format always CR LF, or does it use the
> local newline convention?

It's usually LF-only, given the Unix origins.  The always-CRLF business 
comes from NNTP.

The byte count in an rnews header should count a line ending as one 
character, regardless of how it is physically represented.

Yes, this does mean that there are two competing definitions of a news 
article's actual size, depending on the protocols used.  Such is life.

Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59506
Author: Curt Welch
Date: Sat, 06 Jul 2002 22:15
64 lines
4223 bytes
M. Buchenrieder <mibu@scrum.muc.de> wrote:
> nenosed@news.apex.met.au (Ned Latham) writes:
>
> [...]
>
> >That was what I thought. It's also why I think of it as a bug. Mail or
> >News, all messages carry Lines: headers, right?
>
> No.
>
> >Confusion shouldn't be
> >possible.
>
> [...]
>
> Wrong. The Lines: header is merely a matter of optics. You can't
> trust it at all, since the definition of a "line" may widely vary
> depending from the kind of machine the message has been created
> or been inserted into the newsfeed at.

No, that's not really it.  Lines are well defined on Usenet articles and
the "correct" value for the Lines: header is well defined as well.
Anyone who can't figure out how to convert a local text file into a Usenet
article and count the lines correctly shouldn't be writing software.  The
problem is that it's a redundant headers and _never_ used for anything
important such as finding the end of the article.  It's mostly a stupid
header that should have been removed long ago.  I believe some of the RFCs
even imply this as well.  Because no one really uses it and no one cares
about it, there have been many many clients and servers which allowed
articles to be posted with invalid Lines: headers.

Some software just can't count lines correctly.  They for example use an
interface like fgets() in C which will break long lines into multiple
buffers of data but the software counts buffers instead of lines and puts
that value into the Lines: header.  So it works correctly for normal sized
lines, but gets the value wrong if the article has any extra long lines in
it.

Mostly however the software that generates the Lines: header gets it right,
but then some other software changes the article and doesn't update the
header.  This happens when servers add crap to the bottom of every post, or
has sometimes happened when signatures get added later by the posting
software, or sometimes happens when articles are re-formated to fold long
lines, etc. etc.

These bugs were allowed to exist because the header was seem as
informational for the user only and scheduled for being removed from Usenet
at some point in the future anyway.  Then, because it was mostly just seen
as an approximation at best, people wrote other software that simply
guessed at values for the header making things even worse.

My servers keep some statistics on the accuracy of Lines: headers.

Currently, about 88% of the articles on Usenet have valid Lines: headers.
About 7% have no Lines: header at all, and the rest (about 5%) have Lines:
headers with a bogus value.

Of the articles with invalid values in the Lines: header, about 78% of
those have a value which is 1 less than it should be.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59507
Author: Kjetil Torgrim Homme
Date: Sat, 06 Jul 2002 23:30
30 lines
2761 bytes
[itsy bitsy meowbot]:
>
>   Kjetil Torgrim Homme wrote:
>   
>   > ah, I was wondering, is rnews format always CR LF, or does it use the
>   > local newline convention?
>   
>   It's usually LF-only, given the Unix origins.  The always-CRLF
>   business comes from NNTP.
>   
>   The byte count in an rnews header should count a line ending as
>   one character, regardless of how it is physically represented.

noooo!  that's really broken :-(

ugh.  so the algorithm is: read the N bytes specified, count the
number of CR LF's found (make sure you cover the case where the chunk
read ends with CR), then read that many extra bytes, and repeat.
ugly, ugly, ugly.

>   Yes, this does mean that there are two competing definitions of a
>   news article's actual size, depending on the protocols used.  Such
>   is life.

-- 
Kjetil T.      /XXX\   /XXX\   /XXX\   /XXX\ /XX\  /XX\  /XX\  /XX\  ///
              ///X\\\ ///X\\\ ///X\\\ ///X\\///\\\///\\\///\\\///\\\///
             //// \\\X/// \\\X/// \\\X/// \XX/  \XX/  \XX/  \XX/  \XX/
            ////   \XXX/   \XXX/   \XXX/     http://folding.stanford.edu
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59508
Author: itsy bitsy meowbot
Date: Sun, 07 Jul 2002 00:01
39 lines
3317 bytes
Kjetil Torgrim Homme wrote:


> [itsy bitsy meowbot]:

>>  It's usually LF-only, given the Unix origins.  The always-CRLF
>>  business comes from NNTP.

>>  The byte count in an rnews header should count a line ending as
>>  one character, regardless of how it is physically represented.


> noooo!  that's really broken :-(

In fairness, the UU in UUCP does imply a specific line ending convention 
where that assumption makes perfect sense.   The brokenness crept in 
with ports to other platforms that ignored this reality.  Too bad no one 
thought at the outset to put that detail in writing :/

> ugh.  so the algorithm is: read the N bytes specified, count the
> number of CR LF's found (make sure you cover the case where the chunk
> read ends with CR), then read that many extra bytes, and repeat.
> ugly, ugly, ugly.

In a way it's really no more ugly than what you end up having to do when 
deciphering NNTP/SMTP streams, looking for those silly dots and figuring 
out what they mean in context, and dealing with the occasional 
newsreader that uses the wrong flavor of line ending.

I do tend to read stuff like that in chunks, make all the line endings 
consistent, and then worry about counting.  Tossing in a bit of fudge 
and looking for an EOF or #! blah marker in the general vicinity of 
where you expect the end to be can help too.

There is also the dumb-as-rocks approach used for a long time by INN, 
that seemed to work well enough in practice.  It simply assumed that the 
whole world used Unix line endings, and too bad if you didn't.

Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59509
Author: M. Buchenrieder
Date: Sun, 07 Jul 2002 10:40
70 lines
4045 bytes
curt@kcwc.com (Curt Welch) writes:

>M. Buchenrieder <mibu@scrum.muc.de> wrote:
>> nenosed@news.apex.met.au (Ned Latham) writes:
>>
>> [...]
>>
>> >That was what I thought. It's also why I think of it as a bug. Mail or
>> >News, all messages carry Lines: headers, right?
>>
>> No.
>>
>> >Confusion shouldn't be
>> >possible.
>>
>> [...]
>>
>> Wrong. The Lines: header is merely a matter of optics. You can't
>> trust it at all, since the definition of a "line" may widely vary
>> depending from the kind of machine the message has been created
>> or been inserted into the newsfeed at.

>No, that's not really it.  Lines are well defined on Usenet articles and
>the "correct" value for the Lines: header is well defined as well.

Although in theory, this is correct, the different ways to generate
articles makes this a myth. You simply _can't_ assume the Lines:
header to be anything else than a mere guess of the article's length.
It was neither ever designed for to be used as a precise value,
nor has it ever been thoroughly implemented. For one, depending
from the news client and the news server software used locally,
the Lines: header may be created by the client, the local server
software or somewhere else upstream where they add server-generated
signatures without ever updating the Lines: header at all.

[...]

>Some software just can't count lines correctly.  

*sigh* 
Sadly true.

>They for example use an
>interface like fgets() in C which will break long lines into multiple
>buffers of data but the software counts buffers instead of lines and puts
>that value into the Lines: header.  So it works correctly for normal sized
>lines, but gets the value wrong if the article has any extra long lines in
>it.

>Mostly however the software that generates the Lines: header gets it right,
>but then some other software changes the article and doesn't update the
>header.  This happens when servers add crap to the bottom of every post, or
>has sometimes happened when signatures get added later by the posting
>software, or sometimes happens when articles are re-formated to fold long
>lines, etc. etc.

[...]

It is even worse. If you save the article to a file first, then later
use the saved article to create your response, then the LF or CR/LF
definition of the local system may prevent the newsserver software
that accepts the article for posting from ever seeing the correct
number of lines in the article's body. It's really a lost cause.

Michael
-- 
Michael Buchenrieder * mibu@scrum.greenie.muc.de * http://www.muc.de/~mibu
          Lumber Cartel Unit #456 (TINLC) & Official Netscum
    Note: If you want me to send you email, don't munge your address.
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59510
Author: M. Buchenrieder
Date: Sun, 07 Jul 2002 10:42
30 lines
2495 bytes
Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> writes:

>[itsy bitsy meowbot]:
>>
>>   Kjetil Torgrim Homme wrote:
>>   
>>   > ah, I was wondering, is rnews format always CR LF, or does it use the
>>   > local newline convention?
>>   
>>   It's usually LF-only, given the Unix origins.  The always-CRLF
>>   business comes from NNTP.
>>   
>>   The byte count in an rnews header should count a line ending as
>>   one character, regardless of how it is physically represented.

>noooo!  that's really broken :-(

[...]

If memory serves me right, this was a relict from the UUCP protocol,
but I may be wrong. Though I'm among the few people still using
UUCP locally to transfer news (albeit via TCP and a DSL connection),
I only have a vague rememberance of the original protocol definitions.

Michael
-- 
Michael Buchenrieder * mibu@scrum.greenie.muc.de * http://www.muc.de/~mibu
          Lumber Cartel Unit #456 (TINLC) & Official Netscum
    Note: If you want me to send you email, don't munge your address.
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59512
Author: Ned Latham
Date: Sun, 07 Jul 2002 14:12
43 lines
3371 bytes
J.B. Moreno wrote in <1fewjzr.f4w0w51pfr20yN%planB@newsreaders.com>:
> Ned Latham wrote:
> > Russ Allbery wrote in <ylfzyxl9fx.fsf@windlord.stanford.edu>:
> > > Ned Latham wrote:
> > > > Kjetil Torgrim Homme wrote:
> > > >> [Ned Latham]:
> > > 
> > > >>>   That was what I thought. It's also why I think of it as a
> > > >>>   bug. Mail or News, all messages carry Lines: headers, right?
> > > >>>   Confusion shouldn't be possible.
> > > 
> > > >> you can't trust Lines: to be correct.
> > > 
> > > > Ye gods! Do you know why?
> > > 
> > > Well, because it's frequently wrong is the simple answer.  Why that is is
> > > due to a lot of reasons, ranging from bad algorithms for generating it to
> > > rampant bugs that no one notices because no one uses Lines.
> > 
> > But I do. *sob* (Doesn't seem to have caused any problem to date, though.)
>
> Really?  You're still using it after people have told you it's
> frequently incorrect?

In the last two days. After nearly two years of use.

>                        Why?

Simple enough. It works. So far, it hasn't produced a single article count
that's different from slrn's. The only precaution I have to take is that
when I download an article from google, I have to insert a fake "From "
line (my algorithm relies on both headers).

I've twice asked which RFC's are relevant, and not seen an answer to that.
I *would* like to make article detection bullet-proof, or as near to that
as possible, but if I can't get better info than I've got so far, I'll
just continue with the algorithm I'm using at present. It works.

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59511
Author: Ned Latham
Date: Sun, 07 Jul 2002 14:20
20 lines
2154 bytes
Curt Welch wrote in <20020706181520.539$fK@newsreader.com>:

----snip----

> My servers keep some statistics on the accuracy of Lines: headers.
> 
> Currently, about 88% of the articles on Usenet have valid Lines: headers.
> About 7% have no Lines: header at all, and the rest (about 5%) have Lines:
> headers with a bogus value.
> 
> Of the articles with invalid values in the Lines: header, about 78% of
> those have a value which is 1 less than it should be.

Interesting, Curt. How does your S/W guarantee accurate line counts?

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59514
Author: J.B. Moreno
Date: Sun, 07 Jul 2002 16:35
33 lines
2994 bytes
In article <slrnaigj8g.600.nenosed@arthur.valhalla.net.oz>, 
 Ned Latham <nenosed@news.apex.met.au> wrote:

-snip Lines being unreliable, nobody uses-
-snip Ned saying he does-
-snip me asking why-

> Simple enough. It works. So far, it hasn't produced a single article count
> that's different from slrn's. The only precaution I have to take is that
> when I download an article from google, I have to insert a fake "From "
> line (my algorithm relies on both headers).

What that probably means is that you have lucked out and the servers
you are connecting to are correcting the problem for you -- incorrect
Lines headers are all over the place (anything from "1" being used
regardless, to being consistently off by one or two).

If you want to keep using it, then fine, but most likely it's going to
break one of these days.

> I've twice asked which RFC's are relevant, and not seen an answer to that.
> I *would* like to make article detection bullet-proof, or as near to that
> as possible, but if I can't get better info than I've got so far, I'll
> just continue with the algorithm I'm using at present. It works.

You'll have to say exactly what you are doing/want to do, before a
meaningful list of RFC's can be provided (and even then, there's a good
chance that the information isn't documented in any RFC -- in news the
RFC's lag after existing practice, not the other way around).

-- 
J.B. Moreno
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59515
Author: Curt Welch
Date: Sun, 07 Jul 2002 19:19
88 lines
5931 bytes
M. Buchenrieder <mibu@scrum.muc.de> wrote:
> curt@kcwc.com (Curt Welch) writes:

> >No, that's not really it.  Lines are well defined on Usenet articles and
> >the "correct" value for the Lines: header is well defined as well.
>
> Although in theory, this is correct, the different ways to generate
> articles makes this a myth.

When you send an article to a server over NNTP there is _no_ confusion
about how many lines the article has.  NONE.  Lines end with CR LF.  You
count the number of CR LF pairs in the data stream and you know EXACTLY how
many lines are in the article.  If the client that sends the article is too
stupid to know how to send a probably formated article and count the number
of lines, that's fine.  It happens.  But there is NO confusion about what
the value of the Lines: header SHOULD be.  It makes no difference what
character sets are being used or what type of encoding is used.  You count
the number of CR LF pairs to figure out the correct value for the Lines:
header.

If you send a MIME formated article of type text/plain and use a transfer
encoding of base64 the Lines header tells you how many lines of base64
encoding there are, not how many lines are in the text.  This is well
defined and simple.  There is no "myth" about being able to count lines
correctly.

> You simply _can't_ assume the Lines:
> header to be anything else than a mere guess of the article's length.

If you use my servers you can.  On the reader side of my servers every
article has a valid and correct Lines: header.  Other than on my server
however, your statement is accurate.  But it's not because it can't be done
as you would have us believe, it's simply because it isn't done for about
5% of the articles posted ot Usenet.

Because of the different types of encoding, the Lines: header however has
very limited use these days even when it is correctly calculated.

> It was neither ever designed for to be used as a precise value,

Yes, when first created, the only code calculating it was doing it
correctly. It was both a precise value and a useful value.  It was added
before we had XOVER as a way for clients to get an idea of how long the
article was just by doing a HEAD.  But once XOVER became the norm for
Usenet, the Lines: header was no longer needed and as such, tends to be
inaccurate.

Also, when it was created, everyone (99.9%) used 80 character wide
terminals to read usenet articles.  There was very little doubt how the
articles should be formatted and what a "line" was.  And at 9600 baud and
slower, it took 1 second to display each 12 lines.  In those days, it was
very useful to know if an article was 1000 lines vs 20 lines before you
tried to display the article.

Now, with everyone using GUI interfaces and proportional fonts the entire
concept of a "line" is not so well defined.  And even the modems today are
so fast that few really care how long the article is.  Mostly you just care
if it's a binary or text sized article.

> nor has it ever been thoroughly implemented.

It's thoroughly implemented on my servers.

> It is even worse. If you save the article to a file first, then later
> use the saved article to create your response, then the LF or CR/LF
> definition of the local system may prevent the newsserver software
> that accepts the article for posting from ever seeing the correct
> number of lines in the article's body. It's really a lost cause.

It's not lost at all.  If in the processes of saving and re-posting, the
software manges to change the number of lines in the article, that is not a
problem.  The posting software still should be smart enough to count the
number of lines which it is sending to the server and correctly generate a
valid Lines: header.  HOW hard is it to count CR LF pairs which are sent to
the server????

Sometimes, this means that the client posting the article may have to
make an extra pass to count lines before sending the article, and many
times,  software authors don't feel the Lines: header is important enough
to go to that much trouble.  So this is one reason we get articles with
bogus Lines: headers.  But there is never any confusion about what the
lines headers should be or how it should be calculated.  It's only an issue
of whether it's important enough to go to the trouble to get right.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59516
Author: Curt Welch
Date: Sun, 07 Jul 2002 19:39
51 lines
4099 bytes
nenosed@apex.met.au wrote:
> I've twice asked which RFC's are relevant, and not seen an answer to
> that.

Usenet is not like most of the Interenet.  It's not really defined in the
RFCs.  It's defined by common use.  The RFCs mostly are just attempts to
document common use - and sometimes an attempt to change common use.  Most
attempts to change Usenet by writting RFCs have failed however.

For a good collection of the all the RFCs related to Usenet and a
ton of disccussins about what people think it "should be", you should check
out the USEFOR page:

    http://www.landfield.com/usefor/

> I *would* like to make article detection bullet-proof, or as near
> to that as possible, but if I can't get better info than I've got so far,
> I'll just continue with the algorithm I'm using at present. It works.

I'm sorry, but I don't understand your problem.  If you are storing Usenet
articles to mbox format files, the algorithm is bullet-proof.  You read
lines from the file and any line begining with "From " is the beginning of
a new article.  It's bullet-proof and simple as hell.  But you do get the
unfortunate side effect that articles will be corrupted if you try to save
them that way (From chagned to >From and line termination issues etc).

If you want to save articles with no corruption, you need to use a better
storage format.

If you are reading your articles from an NNTP server, the article is
defined to be everything that comes back from the server after the CR LF on
the command status line, up to but not including the DOT CR LF which ends
the article.  And you have to reverse the dot stuffing of course as well by
removing the DOT from the beginning of all lines.

Understanding what those bytes mean is another matter, but reading the
bytes and saving it to a file without corruption is not hard.

One bullet-proff format I've used to save multiple articles to a single
file is to simply write them in NNTP wire format and include the trailing
DOT CR LF as well.  When you do this, you can read the articles byte for
byte as they were sent to you from the NNTP server and know for sure where
each article begins and ends without having any issues of corruption.

Dot stuffing and unstuffing opens the door for corruption between the save
and the re-transmit which can be avoided with the above technique.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59517
Author: Curt Welch
Date: Sun, 07 Jul 2002 20:13
59 lines
4201 bytes
nenosed@apex.met.au wrote:
> Curt Welch wrote in <20020706181520.539$fK@newsreader.com>:
>
> ----snip----
>
> > My servers keep some statistics on the accuracy of Lines: headers.
> >
> > Currently, about 88% of the articles on Usenet have valid Lines:
> > headers. About 7% have no Lines: header at all, and the rest (about 5%)
> > have Lines: headers with a bogus value.
> >
> > Of the articles with invalid values in the Lines: header, about 78% of
> > those have a value which is 1 less than it should be.

> Interesting, Curt. How does your S/W guarantee accurate line counts?

It's an NNTP server.  NNTP has no confusion about where articles begin and
end or about how many lines are in the article.  The article ends with the
first line which contains only a dot (i.e., DOT CR LF).  To prevent a valid
line with a lone dot from looking like the end-of-article marker, all lines
which begin with a DOT are dot-stuffed.  i.e., a dot is added to the
begining of the line.  So a line which begins ".testing", is sent to the
NNTP server as "..testing".  The reverse is done when clients read the
article from the NNTP server (by the client, not by the server).

Within the article, lines are well defined.  Each CR LF pair found in the
data stream ends a line.  Lone CRs or lone LFs, do not end lines.  They are
just data which is part of another line.

It is possible to send a zero length article with NNTP - though it will
always be rejected.  So the servers need to not only spot "CR LF DOT CR LF"
(which is the normal end of article marker), but also spot DOT CR LF as the
first characters (line) of the article.

The first lines in the article are header lines.  The header is followed by
a blank line, and then the body.  The blank line is not part of the header
or the body.  You do not need to parse header lines to figure out where the
header ends.  The blank line defines the end of the header, not the format
of the header lines.

The Lines: header tells you how many lines are in the body and it does not
include the blank line between the header and the body.

The body is optional and the blank line between the header and body is also
optional for articles with no body.  An article with no body has a Lines:
header with a value of 0.

It's technically possible to send an article with no header as well.  But
servers will reject it.

There is no confusion about how to parse articles or count lines on NNTP
servers.  On some servers, where articles get converted to local
end-of-line conventions, confusion happens - but those servers are broken
and are just well known for being broken.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59520
Author: M. Buchenrieder
Date: Mon, 08 Jul 2002 08:19
84 lines
4711 bytes
curt@kcwc.com (Curt Welch) writes:

>M. Buchenrieder <mibu@scrum.muc.de> wrote:

[...]

>When you send an article to a server over NNTP there is _no_ confusion
>about how many lines the article has.  NONE.  Lines end with CR LF.  You
>count the number of CR LF pairs in the data stream and you know EXACTLY how
>many lines are in the article.  

Ack.

[...]

>> You simply _can't_ assume the Lines:
>> header to be anything else than a mere guess of the article's length.

>If you use my servers you can.  On the reader side of my servers every
>article has a valid and correct Lines: header.  Other than on my server
>however, your statement is accurate.  But it's not because it can't be done
>as you would have us believe, it's simply because it isn't done for about
>5% of the articles posted ot Usenet.

Slight correction: I don't want you to believe it, it was my impression
as far as the accuracy (and the relative value) of the Lines: header
was concerned. :-)

>Because of the different types of encoding, the Lines: header however has
>very limited use these days even when it is correctly calculated.

>> It was neither ever designed for to be used as a precise value,

>Yes, when first created, the only code calculating it was doing it
>correctly. It was both a precise value and a useful value.  

It was a needed header entry, as it was the only way to tell
the receiving party what size the article in question had. I
can't make any statement on the accuracy of the Lines: header
back then, though. I never checked it (although I still remember
those days, yes).


>It was added
>before we had XOVER as a way for clients to get an idea of how long the
>article was just by doing a HEAD.  But once XOVER became the norm for
>Usenet, the Lines: header was no longer needed and as such, tends to be
>inaccurate.

Right.

>Also, when it was created, everyone (99.9%) used 80 character wide
>terminals to read usenet articles.  

I still do. It's much easier to read articles on a terminal (but
that's just my EUR 0.02).

[...]

>> It is even worse. If you save the article to a file first, then later
>> use the saved article to create your response, then the LF or CR/LF
>> definition of the local system may prevent the newsserver software
>> that accepts the article for posting from ever seeing the correct
>> number of lines in the article's body. It's really a lost cause.

>It's not lost at all.  If in the processes of saving and re-posting, the
>software manges to change the number of lines in the article, that is not a
>problem.  The posting software still should be smart enough to count the
>number of lines which it is sending to the server and correctly generate a
>valid Lines: header.  HOW hard is it to count CR LF pairs which are sent to
>the server????

Obviously, this simple procedure is still too complicated for a
sufficient number of software products. Otherwise, you wouldn't
see a roughly 5% of incorrectly labelled articles on your survey.
But I agree, it could be done, if people really cared about doing
it right - which seems at this moment in time not to be the case.

Michael
-- 
Michael Buchenrieder * mibu@scrum.greenie.muc.de * http://www.muc.de/~mibu
          Lumber Cartel Unit #456 (TINLC) & Official Netscum
    Note: If you want me to send you email, don't munge your address.
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59524
Author: Ned Latham
Date: Mon, 08 Jul 2002 15:15
46 lines
3404 bytes
Curt Welch wrote in <20020707153953.823$CD@newsreader.com>:

----snip----

> For a good collection of the all the RFCs related to Usenet and a
> ton of disccussins about what people think it "should be", you should
> check out the USEFOR page:
>
>     http://www.landfield.com/usefor/

Okay. Thanks for that.

----snip----

> If you want to save articles with no corruption, you need to use a better
> storage format.
> 
> If you are reading your articles from an NNTP server, the article is
> defined to be everything that comes back from the server after the CR LF on
> the command status line, up to but not including the DOT CR LF which ends
> the article.  And you have to reverse the dot stuffing of course as well by
> removing the DOT from the beginning of all lines.
> 
> Understanding what those bytes mean is another matter, but reading the
> bytes and saving it to a file without corruption is not hard.
> 
> One bullet-proof format I've used to save multiple articles to a single
> file is to simply write them in NNTP wire format and include the trailing
> DOT CR LF as well.

But reading them with what?

>                     When you do this, you can read the articles byte for
> byte as they were sent to you from the NNTP server and know for sure where
> each article begins and ends without having any issues of corruption.
> 
> Dot stuffing and unstuffing opens the door for corruption between the save
> and the re-transmit which can be avoided with the above technique.

Something to think about. Thanks again, Curt.

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59525
Author: Ned Latham
Date: Mon, 08 Jul 2002 15:33
29 lines
2682 bytes
Curt Welch wrote in <20020707161302.204$uL@newsreader.com>:
> Ned Latham wrote:

----snip----

> > Interesting, Curt. How does your S/W guarantee accurate line counts?
> 
> It's an NNTP server.  NNTP has no confusion about where articles begin and
> end or about how many lines are in the article.  The article ends with the
> first line which contains only a dot (i.e., DOT CR LF).  To prevent a valid
> line with a lone dot from looking like the end-of-article marker, all lines
> which begin with a DOT are dot-stuffed.  i.e., a dot is added to the
> begining of the line.  So a line which begins ".testing", is sent to the
> NNTP server as "..testing".  The reverse is done when clients read the
> article from the NNTP server (by the client, not by the server).

So really, the best thing for me to do is fetch article with inn and just
copy the files from the spool? (Erk. I haven't been able to get it working
yet.)

Or make slrn do a line count on articles it reads.

----snip----

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59531
Author: Curt Welch
Date: Tue, 09 Jul 2002 00:48
15 lines
2129 bytes
nenosed@apex.met.au wrote:
> Curt Welch wrote in <20020707153953.823$CD@newsreader.com>:

> > One bullet-proof format I've used to save multiple articles to a single
> > file is to simply write them in NNTP wire format and include the
> > trailing DOT CR LF as well.
>
> But reading them with what?

With my own code.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59532
Author: Curt Welch
Date: Tue, 09 Jul 2002 00:52
19 lines
2299 bytes
nenosed@apex.met.au wrote:
> Curt Welch wrote in <20020707161302.204$uL@newsreader.com>:

> So really, the best thing for me to do is fetch article with inn and just
> copy the files from the spool? (Erk. I haven't been able to get it
> working yet.)
>
> Or make slrn do a line count on articles it reads.

Maybe.  I don't really know what it is you are trying to do so trying to
guess what option might be best is a bit hard.  My suggestion just relates
to one approach to saving multiple articles to a single file and being able
to read them again later and know where each article begins and ends
without having to keep an external index of some type.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59533
Author: J.B. Moreno
Date: Tue, 09 Jul 2002 04:42
38 lines
3175 bytes
itsy bitsy meowbot <53ab2750@meowing.net> wrote:

> Kjetil Torgrim Homme wrote:
> 
> 
> > [itsy bitsy meowbot]:
-snip-
> >>  The byte count in an rnews header should count a line ending as
> >>  one character, regardless of how it is physically represented.
> >
> > noooo!  that's really broken :-(
> 
> In fairness, the UU in UUCP does imply a specific line ending convention
> where that assumption makes perfect sense.   The brokenness crept in 
> with ports to other platforms that ignored this reality.  Too bad no one
> thought at the outset to put that detail in writing :/
> 
> > ugh.  so the algorithm is: read the N bytes specified, count the
> > number of CR LF's found (make sure you cover the case where the chunk
> > read ends with CR), then read that many extra bytes, and repeat.
> > ugly, ugly, ugly.
-snip-
> There is also the dumb-as-rocks approach used for a long time by INN,
> that seemed to work well enough in practice.  It simply assumed that the
> whole world used Unix line endings, and too bad if you didn't.

If you wanted only a slightly smarter routine you could test and see
whether or not the newline character takes up more than one byte and
barf if it does.

Really, no matter how you go about it it'll probably work most of the
time and when it doesn't work, you can probably fix the problem simply
by transfering the file via a different method

-- 
JBM
"Your depression will be added to my own" --  Marvin of Borg
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59564
Author: Kai Henningsen
Date: Sun, 14 Jul 2002 16:18
21 lines
1972 bytes
nenosed@news.apex.met.au (Ned Latham)  wrote on 05.07.02 in <slrnaibc7b.3hu.nenosed@arthur.valhalla.net.oz>:

> That was what I thought. It's also why I think of it as a bug. Mail or
> News, all messages carry Lines: headers, right? Confusion shouldn't be
> possible.

Nope. No Lines: in mail, and not always in news either, nor oare those  
reliable.

Someone tried a mailbox format based on Content-Length:, but it turns out  
that breaks just as easily.

There's a reason all 822-format mail I am responsible for sits in Maildir  
format.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59567
Author: Ned Latham
Date: Mon, 15 Jul 2002 01:56
17 lines
1823 bytes
Kai Henningsen wrote in <8SrYgo01w-B@khms.westfalen.de>:
> Ned Latham wrote:

----snip----

> There's a reason all 822-format mail I am responsible for sits in
> Maildir format.

I know nothing of that format. Can you point me to some info, Kai?

----snip----

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59578
Author: Kai Henningsen
Date: Tue, 16 Jul 2002 07:00
26 lines
2221 bytes
nenosed@news.apex.met.au (Ned Latham)  wrote on 15.07.02 in <slrnaj4b37.18m.nenosed@arthur.valhalla.net.oz>:

> Kai Henningsen wrote in <8SrYgo01w-B@khms.westfalen.de>:
> > Ned Latham wrote:
>
> ----snip----
>
> > There's a reason all 822-format mail I am responsible for sits in
> > Maildir format.
>
> I know nothing of that format. Can you point me to some info, Kai?

It's essentially one-message-per-file, with a few more details to make  
concurrent access by several tools easier. Modern MTAs, for example,  
usually support it - Exim and Qmail certainly, and I'm reasonably certain  
most others do as well. And several mail clients.

Obviously, you don't need any form of escaping or length counting in that  
case. (And grep isolates a single message.)

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)
Re: News servers, nntpcache, slrn and the Usenet bug "From ".
#59590
Author: Ned Latham
Date: Wed, 17 Jul 2002 13:53
33 lines
2613 bytes
Kai Henningsen wrote in <8S-HvXaXw-B@khms.westfalen.de>:
> Ned Latham wrote:
> > Kai Henningsen wrote:
> > > Ned Latham wrote:
> >
> > ----snip----
> >
> > > There's a reason all 822-format mail I am responsible for sits in
> > > Maildir format.
> >
> > I know nothing of that format. Can you point me to some info, Kai?
>
> It's essentially one-message-per-file, with a few more details to make 
> concurrent access by several tools easier. Modern MTAs, for example, 
> usually support it - Exim and Qmail certainly, and I'm reasonably certain 
> most others do as well. And several mail clients.
>
> Obviously, you don't need any form of escaping or length counting in that
> case. (And grep isolates a single message.)

I'll have to think about this. I have the problem of dealing with mbox
files solved conceptually, but haven't coded it yet, and I'm in no
hurry, so I can take the time to examine and consider the ramifications
of dealing with an archive now at almost 30,000 messages and growing at
about 1900 per month.

Thanks, Kai.

Ned
-- 
To reply, cut out my nose        *   Democracy means "the people rule".  *
 and make the met a net.         *     Fight for the power of assent.    *
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