🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #46510

Re: Encoding binary data

#46510
From: Russ Allbery
Date: Fri, 19 May 2000 00:00
48 lines
2931 bytes
Curt Welch <curt@kcwc.com> writes:

> Newer news servers avoid all this by not converting the articles when
> they are saved.  They save them in raw NNTP format (wire format as it's
> commonly called), so when it's read back by a newsreader, the LFs, and
> CRs, and CR LFs, are all preserved correctly, and for those, you can
> actually get away with using raw binary formats in articles.

Not necessarily.  It depends on what else the server does with the
article.  INN will reject articles with bare CRs for a variety of reasons;
there were a number of different problems we were running into with
corrupted messages, corrupted line counts for the overview, and similar
sorts of things.

It's certainly *possible* to handle raw binary, but it's overly optimistic
to say that existing newer news servers that use wireformat storage all do
so.

>> Yes.  You're going to need to do some sort of encoding at least to
>> avoid the sequence CRLF.CRLF in the body of the message (normally
>> dot-stuffing is used),

> dot-stuffing is _required_, not just _normally used_.

Not quite true.

What is *required* is that one not send "CR LF . CR LF" except at the end
of the article.  Dot-stuffing is the method a program speaking NNTP should
use to deal with a line beginning with . to avoid causing the above
problem, but an equally valid way of handling the problem, when you
control the article encoding, is to just avoid ever generating a period at
the beginning of a line.  This too will work fine and doesn't require dot
stuffing.

Remember the context of the discussion.  The person asking these questions
is considering a customized encoding format.

> On Usenet, you will always have to assume that some servers out there
> won't deal with NULLs, or lone CR, or lone LFs, in the articles.  And
> you should also assume that some servers will have problems with "long
> lines" -- i.e. many thousands of bytes between pairs of CR LFs.

I've yet to encounter one, apart from news to mail gateways.

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

Technical Details
Message-ID: <ylln160vy8.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.mbox.zip!not-for-mail
References: <3921BBF8.F251A540@unidata.ucar.edu> <87bt2511sn.fsf@erlenstar.demon.co.uk> <3924568F.463ADE1@unidata.ucar.edu> <yl8zx7m4tm.fsf@windlord.stanford.edu> <20000519124008.263$A6@newsreader.com>

Show Full Headers
Complete Article Headers
Message-ID: <ylln160vy8.fsf@windlord.stanford.edu>
Subject: Re: Encoding binary data
Date: Fri, 19 May 2000 00:00:00 +0000
From: Russ Allbery <rra@stanford.edu>
References: <3921BBF8.F251A540@unidata.ucar.edu> <87bt2511sn.fsf@erlenstar.demon.co.uk> <3924568F.463ADE1@unidata.ucar.edu> <yl8zx7m4tm.fsf@windlord.stanford.edu> <20000519124008.263$A6@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!not-for-mail
X-Deja-AN: 625617018
Content-Type: text/plain; charset=us-ascii
Organization: The Eyrie
Mime-Version: 1.0
User-Agent: Gnus/5.0802 (Gnus v5.8.2) XEmacs/21.1 (Biscayne)
Newsgroups: news.software.nntp