Extracting Binaries from MIME-Encoded messages

Henry Yen blinux-mail at AegisInfoSys.com
Fri Jun 18 19:46:01 UTC 2004


It sounds to me that your issue is more of how to extract the attachments
and less of what to do with them once extracted.  As mentioned in other
threads, munpack, uudecode, etc., are various base64 decoders.

For automatic processing of attachments, I've used the "mhn" utility
with success in scripts, although it seems to be split into multiple
commands in recent releases.  It's a little more complicated than your
usual unix/linux utility, but once you've got it set up, it works fine.

Also, you might want to consider the "mutt" mail client, which
is a full-screen (not graphical) program that handles attachments
as well.  It operates similar to elm and pine.

On Fri, Jun 18, 2004 at 10:28:39AM -0500, Martin McCormick wrote:
> 	I use nmh for reading Email.  This user agent places each
> incoming message in to a directory with the name of a given folder
> such as inbox for all messages that don't belong in other folders.  Is
> there a good utility for stripping attachments out of a message when
> it may contain one or more?
> 
> 	The manual process is to copy the message to some scratch
> file, run vi on the scratch file and look for base64 which is one type
> of encoding, and then strip away all but the garbage of the 7-bit data
> which is the base64 representation of the binary.  Then, I run a perl
> script that has been out on the Internet for years which is called
> base64decode.  It's standard output is the decoded data stream.
> 
> 	I know that base64 decoding is part of many applications so I
> want simply to be able to extract attachments that aren't understood
> or can't be displayed such as sound files, etc.

-- 
Henry Yen                                       Aegis Information Systems, Inc.
Senior Systems Programmer                       Hicksville, New York





More information about the Blinux-list mailing list