🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
6 messages
6 total messages Started by Princess Morgiah Tue, 28 Dec 2004 20:09
Decoding messages with attachments
#70504
Author: Princess Morgiah
Date: Tue, 28 Dec 2004 20:09
25 lines
1852 bytes
Hi everyone,

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?
- whether or not those messages are mime attachments?
- whether or not those messages are yenc attachments?

After looking at the messages, I can figure out the type of encoding from
the first part of the message (default yenc/mime headers), but I'm not sure
if that is the way to go.

For example: I can see some headers on both type of messages, but I also see
a lot of mime messages starting with just "begin 644 ". What if I start a
simple email message with this header?

Any kind of information is welcome!

Thanks in advance,

Princess Morgiah

Re: Decoding messages with attachments
#70505
Author: johnny bravo
Date: Tue, 28 Dec 2004 23:43
36 lines
2174 bytes
On Tue, 28 Dec 2004 20:09:37 GMT, "Princess Morgiah"
<princess_morgiah_nospamplease@yahoo.com> wrote:

>Hi everyone,
>
>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?
>- whether or not those messages are mime attachments?
>- whether or not those messages are yenc attachments?
>
>After looking at the messages, I can figure out the type of encoding from
>the first part of the message (default yenc/mime headers), but I'm not sure
>if that is the way to go.
>
>For example: I can see some headers on both type of messages, but I also see
>a lot of mime messages starting with just "begin 644 ". What if I start a
>simple email message with this header?
>
>Any kind of information is welcome!
>
>Thanks in advance,
>
>Princess Morgiah
>
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300

Use a real newsreader.

-- 

Websites:
http://www.kools-online.com
http://news.kools-online.com
Re: Decoding messages with attachments
#70513
Author: Colin Wilson
Date: Wed, 29 Dec 2004 04:14
43 lines
2629 bytes
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.

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'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!

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.

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.

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.


-- 
Colin - Author of XanaNews
Re: Decoding messages with attachments
#70520
Author: 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

Re: Decoding messages with attachments
#70521
Author: Princess Morgiah
Date: Wed, 29 Dec 2004 13:39
18 lines
1722 bytes
"johnny bravo" <johnny_bravo@kools-online.com.invalid> wrote in message
news:41d1eef4$0$6203$e4fe514c@news.xs4all.nl...
> On Tue, 28 Dec 2004 20:09:37 GMT, "Princess Morgiah"
> <princess_morgiah_nospamplease@yahoo.com> wrote:
<snip>
> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>
> Use a real newsreader.

Hi Johnny,

At the moment I'm using Outlook Express as well as XNews. But I'll make you
a once-in-a-lifetime deal: you answer my question, and I'll switch to
whatever newsreader you prefer. Deal?

Princess Morgiah

Re: Decoding messages with attachments
#70543
Author: Colin Wilson
Date: Thu, 30 Dec 2004 22:26
9 lines
1412 bytes
Princess Morgiah wrote:

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

Go for it!  It's at http://www.wilsonc.demon.co.uk/d9xananews.htm !

-- 
Colin - Author of XanaNews
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