🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #65813

Re: Question about rfc997, 2.4.1 (double periods)

#65813
From: Curt Welch
Date: Sun, 22 Jun 2003 03:58
68 lines
3811 bytes
zirggc@endless-nameless.net (Zir) wrote:
> The spec clearly states that a
> .CRLF means end of message. That's easy.

Of course DOT CR LF only ends the message when it appears at the begining
of the line.  That is actually what the spec says.

>  However I am not quite so sure about the rest of the
> section. It says that when a line, begins with a '.', the period
> is to be doubled on posting and un-doubled on reading.
>
>  My question is how would it apply in these cases:
>  A) The line is:
>      .
>      ( in other words, the user wants to post a message that
>        contains a single line, starting with a period, followed
>        by a CRLF )
>
>  B) The line is:
>       . Hello Mom!
>
>      ( In other words, a user wants to post a message that begins with
>         a period, followed by an NON CRLF string of characters,
>         terminated by a CRLF )
>
> (A) seems quite clear; double it or it will  be taken as 'End of Message'
>
> (B) is more interesting, because the period is NOT followed by a CRLF,
> meaning it MUST not be considered as 'End of Message'. In this case,
> should the leading period be double, and if so _WHY_.

Yes it should be doubled and the _WHY_ is mostly because the spec says so
and all the other news servers and newsreaders in the world do it that so
if you don't your article will be corrupted.

But the reason it says so is because it gets more complex if you don't so
they picked the algortim that was the simplest to implement.

Think of the case where someone wants to post an article with a line
containing only DOT DOT.  You have to add a dot there as well or else it
will be turned back to a line with a single dot when read.  SO you need to
escape a line with a single dot, and a line with two dots.

But what if you want to post an article with a line that has three dots?
You have to add a dot there as well so it's not confused with the two dot
line.

But if it's a line with 3 dots followed by " hello", you don't have to add
the dot because there's no chance of confusion.

So, now the algortihm looks like this:

   If the line you are trying to post has one or more dots on the line and
   nothing else, then add an extra dot.

When reading lines, if the line has nothing but dots on the line, then take
the first dot off.  If it's got somethihg else at the end of the line other
than a DOTs, then don't take the leading dot off.

See how messy it gets?

So they picked the easy algortihm - dot stuff _every_ line which begins
with a dot and on reception, remove leading dots for all lines.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20030621235852.309$av@newsreader.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <650c1a4c.0306211939.5683608e@posting.google.com>

Show Full Headers
Complete Article Headers
Message-ID: <20030621235852.309$av@newsreader.com>
Subject: Re: Question about rfc997, 2.4.1 (double periods)
Date: Sun, 22 Jun 2003 03:58:52 +0000
From: curt@kcwc.com (Curt Welch)
References: <650c1a4c.0306211939.5683608e@posting.google.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com LtvXbYbEPxv7Ry1S9G5n3Xl@2HklOSa_w_XO5DCFTYATV2/A
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
  %IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 67