How to extract multiple MIME/base64 inline parts from a *.txt file ?

T

Tobias Merler

I have got a *.txt file with lots of (independent) MIME (I think) chunks inside.
They are separated by delimiters like (see bottom of this message).
Originally this file is derived from an unsuccessful delivered/modified eMail.

Is there a tool which helps me to extract the hex encoded pictures (and possible
other attachments e.g. *.pdfs) from this file?

I would appreciate a fault tolerant (if the text file is not complete)
utility onto which I can drag the *.txt file and which automatically recognizes
all MIME chunks inside.

Tobias


Sample.txt:


......

--part1_237.e64e06c.322ecc0f_rel_boundary
Content-ID: <X.MA1.3246326326@yahoo@com>
Content-Type: image/jpeg; name="ÈçîáðàdDGFDD53.jpg"
Content-Disposition: inline
Content-Transfer-Encoding: base64

/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUKFGGH7648BwwIBwcHBw8LCwkMEQ8S
EhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEU
Hh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAAR
....

--part1_237.e64e06c.322ecc0f_rel_boundary
Content-ID: <X.MA2.3246326326@yahoo@com>
Content-Type: image/jpeg; name="ZZZ.jpg"
Content-Disposition: inline
Content-Transfer-Encoding: base64

/9j/4AAQ3247652GHJFGHFABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8S
EhEPERETFhwXExQaFRERGC324632628fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEU
Hh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAAR
CAFoAeADASIAAhEBAxEB/8QAHwAAAQ253754274284842AAAAAECAwQFBgcICQoL/8QAtRAA
AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2J
......

--part1_237.e64e06c.322ecc0f_rel_boundary--
 
B

Brian Tillman

Tobias Merler said:
I have got a *.txt file with lots of (independent) MIME (I think)
chunks inside. They are separated by delimiters like (see bottom of
this message).
Originally this file is derived from an unsuccessful
delivered/modified eMail.

Is there a tool which helps me to extract the hex encoded pictures
(and possible other attachments e.g. *.pdfs) from this file?

One good one is UUDWin found at http://www.marks-lab.com/
 
T

Taylor, Grant

I have got a *.txt file with lots of (independent) MIME (I think) chunks inside.
They are separated by delimiters like (see bottom of this message).
Originally this file is derived from an unsuccessful delivered/modified eMail.

Is there a tool which helps me to extract the hex encoded pictures (and possible
other attachments e.g. *.pdfs) from this file?

Yes and no.
I would appreciate a fault tolerant (if the text file is not complete)
utility onto which I can drag the *.txt file and which automatically recognizes
all MIME chunks inside.

It sounds like you need a ""utility (I use the term loosely) to extract your MIME attached files, or parts there of. If the file is indeed an RFC 822 mail message, you can pass the message through something like Perl or Python's RFC (2)822 / MIME email support routines to extract what you are wanting. If you do not have complete valid messages your best bet is to extract just the raw Base 64 data and convert just that individually. Again, this could be done with Perl or Python, or any other language for that matter.



Grant. . . .
 
J

Jon Kennedy

This tool may help: http://www.miken.com/uud/

If no joy....copy all the garbled text into a single, plain text file (use
NotePad or WordPad). If the attachment is split up into several messages,
select all the messages and choose Save As from the File menu to save all
the text into one text file. Open the file in the text editor and edit so
that it has no headers. Then save it, being sure you save it as a plain text
(ASCII or .TXT) file. Now run a decoding utility on the text file. Google
for the kind of decoding you need (Base64 for MIME attachments; Uuencode; or
BinHex).

For example, here's an online Base64 decoder:
http://www.opinionatedgeek.com/dotnet/tools/Base64Decode/

WinZip may also be able to help - after you change the extension of the file
to .uue
http://www.winzip.com/uuencode.htm
 
R

Robert Aldwinckle

(posting from ie6.browser)
Tobias Merler said:
I have got a *.txt file with lots of (independent) MIME (I think) chunks inside.
They are separated by delimiters like (see bottom of this message).
Originally this file is derived from an unsuccessful delivered/modified eMail.

Is there a tool which helps me to extract the hex encoded pictures (and possible
other attachments e.g. *.pdfs) from this file?


Have you tried using IE6?

Rename the file to have an extension of .mht
If IE6 opens it you should be able to right-click, Save Picture As...


Good luck

Robert Aldwinckle
---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top