11 January 2007

 

Copying Stubborn Embedded Files from Emails

Have you ever received the email with an embedded file that you wanted to save but just couldn't with a right click?
Evolution users have an option to do so quite easily. When the email is selected a ctrl + u will bring up a window showing the encoding of the email. In this window will be a Base64 form of all embedded files and attachments within the email. Any other email client that allows users to view base64 encoding of the files will work for this too. If you copy that code into a file, you can then use perl to decode it into the binary original again. I would recommend using vi - you need the text with no additional characters (i.e. carriage returns).
From a Linux command line you can then type:
perl -MMIME::Base64 -ne 'print decode_base64($_)' < inputfile > outputfile
You've now got the original image or other file.

Labels: , , ,


Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?