It looks like mpack is not shipped with RHEL. Is there a command line MIME extractor (i.e. something that can be used from a shell script) shipped with RHEL 5 that does not require installing a third party package or building from source?
The powers that beTM won't be keen on using anything that's not packaged by the vendor, so I'd prefer to use something that comes with RHEL 5 if possible.
The
perl-MIME-tools
package includes a variety of command-line tools for processing MIME-encoded messages, includingmimeexplode
:The
ripmime
command is packaged in EPEL, if that meets your "packaged by the vendor" requirements.By MIME do you mean Base64? OpenSSL can be used to decode Base64,
openssl enc -d -base64 -in file.in -out file.out
Edit:
Since that is not the case, Python (which is part of the default RHEL install) includes the
email
module which can be used to consume and interpret emails, including dealing with attachments. The documentation is located here: http://docs.python.org/library/email.parser.htmlObviously there is some programming required, there is a SO question covering it: https://stackoverflow.com/questions/8307809/save-email-attachment-python3-pop3-ssl-gmail