Article View: news.software.nntp
Article #59962Re: Tech Question: How to programmatically determine attachment encoding method (base64, MIME, UUEncode, Yenc)?
From: Juergen Helbing
Date: Tue, 20 Aug 2002 21:17
Date: Tue, 20 Aug 2002 21:17
98 lines
4121 bytes
4121 bytes
"Andy H" <andyh@nospam.com> wrote: >I am in the process of writing an NNTP search tool (much like the now >defunct NewsFerret) which will allow one to search through headers by >subject on the NNTP server (rather than having to download hundreds of megs >of headers and search on the client). Good luck. >Obviously I want to add attachment >processing to this tool to allow binary attachment downloading. Google for Binaries ? <giggle> >Being new >to this, I am wondering if there is a primer or any sort of documentation >for the various possible encoding schemes as well as a way I can determine >which one is being used. Actually these encodings are used for binaries (sorted by relevance): UUencode (see UUdeview library) yEncode (see www.yenc.org) MIME+Base64 (see RFCs .... ). BinHex (Mac Specific ?) >Browsing some msgs, I do not see any specific >header fields which say anything about the encoding, so I am assuming >everything is in the body. Some very basic compositions of MIME contain the Content-Transfer-Encoding in the message headers. Complex MIME compositions and all other encodings can be found in the body. UUenc is usually detected with a line as: begin ### filename (where ### is 644 of 664 or and digits). yEnc is pretty good detected with a line as: =ybegin <space> MIME/base64 is detected by 'Content-Transfer-Encoding' within the MIME structure. BinHex is (sometimes) detected by the text: "This .... must be decoded with BinHex 4.0" (or so..... I never found a reliable way to detect it properly). There are some people who want to make Binary Detection easier by adding MIME headers to the OVERVIEW data of news-servers. But this would help only if the entire Binary Usenet posting structure would be changed - and then it would be necessary to convince people that they want such a feature (see also below: 'Second'). >Any help or direction would be greatly >appreciated. Thanks in advance! There are two reasons why your work is difficult: First you really need to download the FULL message stream. You cant even 'stop' fetching a message after finding a filename and/or encoding - because NNTP delivers always complete bodies or articles. So you need a _lot_ of computing power for 300 Gigs/day. Or you 'break' the connection all the time - and need lots of time for reconnect (or a bunch of parallel tasks). Second nobody really wants to know which binaries are really posted all the time to Usenet. The few poor attempts from 'authorities' to do it resulted already in filenames as: "Am I The Only One Who Is Working Here.mpg" for a well known movie. And this would not help you any further than today.... :-)) As a "Binary Usenet Developer" I am running the tool you want - for a few test groups. But this is my very personal pleasure... There is a bunch of "Web-Usenet-Servers" out there. This are NNTP-Servers with an HTTP FrontEnd for user's convenience. They are doing a similar job and I can imagine that their programmers worked hard on them - and are in constant process of development. If you dont want to create your own commercial News-Service then it might be better to use their functionality as a user. HTH -- Juergen
Technical Details
Message-ID:
<5717n.k82200@archiver.winews.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.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.alt.net!usenetReferences:
<um4up98ldl41dd@news.supernews.com>Show Full Headers
Complete Article Headers
Message-ID: <5717n.k82200@archiver.winews.net> Subject: Re: Tech Question: How to programmatically determine attachment encoding method (base64, MIME, UUEncode, Yenc)? Date: Tue, 20 Aug 2002 21:17:57 +0000 From: archiver@i3w.com (Juergen Helbing) References: <um4up98ldl41dd@news.supernews.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!news.alt.net!usenet Newsgroups: news.software.nntp Organization: Altopia Corp. - Usenet Access - http://www.altopia.com Lines: 97 X-Newsreader: MyNews