🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #70520

Re: Decoding messages with attachments

#70520
From: Princess Morgiah
Date: Wed, 29 Dec 2004 13:39
69 lines
4017 bytes
"Colin Wilson" <colin@wilsonc.demon.co.uk> wrote in message
news:1104293695.18972.0@spandrell.news.uk.clara.net...
> Princess Morgiah wrote:
>
> > I'm trying to write my own newsreader/downloader and have stumbled
> > upon a slight problem.
> >
> > When I download a message from usenet, how do I find out:
> > - whether or not the message has attachments?
>
> 3 ways:
>
> 1.  If it's a MIME message, it may have an attachment.  Binary
> attachments are usually base64 encoded, though I've seen uuencoded
> attachments with MIME ContentTransferEncoding set to UUENCODE or
> x-uuencode.  I've never seen a MIME message containing a yEnc
> attachment yet.

So it's either MIME or yEnc - nice. Guess I'll be able to figure it out from
the headers.

> 2.  Messages that contain a line starting with (eg.) 'begin 644' may
> contain a uuencoded binary attachment, which terminates with a line
> containing just 'end'.  The line that contains 'begin 644' usually
> contains the filename too.  There may be plain text before the
> attachment.  There may be some plain text after the attachment.
> Sometimes that's followed by another 'begin 644', and another binary
> attachment.

I've noticed this myself after testing for a while, but I thought that these
messages were MIME as well.

> I'm not sure if the 644 is significant.  I've seen many other 3 digit
> combinations.  XanaNews always treats them the same and it hasn't
> failed yet!

Apparently, the 644 comes from a Unix background - it represents the user
rights to the file or something like that. A few hours after posting my
question, I found the following document on the net:
http://pages.prodigy.net/michael_santovec/decode.htm - decoding internet
attachments. Since you're working on a newsreader yourself, this may be of
interest to you as well.

> Some bozos like to post messages with lines starting with 'begin 644' -
> even though there's no attachment, for a laugh to crash badly written
> newsreaders.  Ho ho ho.

I expected as much. Oh well, just another thing to be prepared for.

> 3.  Messages that contain lines starting with =yBegin.  They end with
> lines starting with =yEnd.  See the yEnc spec for the rest of the
> details.  They're quite easy to decode.

Quite right - I already knew how to decode them (from the specs and various
libraries), but I did not know if it was possible to recognize them by only
looking at the message header.

> I think that the only 'approved' way of adding an attachment to a news
> message is with MIME.  Nevertheless, the most common thing is probably
> still non-MIME messages containing uuencoded attachments.

Thank you for your time and trouble, Colin, and good luck with XanaNews.
I'll give it a try myself, I'm curious now!

Regards,

Princess Morgiah

Technical Details
Message-ID: <IsyAd.13398$pO7.988294@phobos.telenet-ops.be>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!number1.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder1.cambrium.nl!feed.tweaknews.nl!skynet.be!skynet.be!ossa.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mail
References: <54jAd.12755$op.747589@phobos.telenet-ops.be> <1104293695.18972.0@spandrell.news.uk.clara.net>

Show Full Headers
Complete Article Headers
Message-ID: <IsyAd.13398$pO7.988294@phobos.telenet-ops.be>
Subject: Re: Decoding messages with attachments
Date: Wed, 29 Dec 2004 13:39:52 GMT
From: "Princess Morgiah" <princess_morgiah_nospamplease@yahoo.com>
References: <54jAd.12755$op.747589@phobos.telenet-ops.be> <1104293695.18972.0@spandrell.news.uk.clara.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!number1.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder1.cambrium.nl!feed.tweaknews.nl!skynet.be!skynet.be!ossa.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mail
Newsgroups: news.software.nntp
Lines: 69
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
NNTP-Posting-Host: 213.119.58.240
X-Complaints-To: abuse@telenet.be
X-Trace: phobos.telenet-ops.be 1104327592 213.119.58.240 (Wed,
NNTP-Posting-Date: Wed, 29 Dec 2004 14:39:52 MET
Organization: Telenet Internet