Is there a .eml email file viewer that can also save attachments?

To extract attachments from the Terminal, you can use a couple of different methods. Probably the easiest is

perl -MMIME::Base64 -ne 'print decode_base64($_)' < file.eml > out

where file.eml is the email file in question and out is the name of the attachment.

The same thing can be accomplished by using the base64 command, but you have to do some cleanup work on the original email file first -- namely strip everything out of the eml file before the base64 encoded attachment. The command would be something along these lines

base64 -D -i file.eml -o out

If you take the 2nd approach, recommend that you operate on a copy of the original file.

Of course for reading the eml files, you can probably use cat or your favorite editor. Works in a pinch, but certainly not the easiest way to deal with email.


There's a free online .eml viewer you can use to extract messages and attachments from .eml, .msg and winmail.dat files: http://www.encryptomatic.com/viewer