Reading Apple Mail Attachments
Okay, so Jess is finishing up her Masters of Project Management with many of the assignments having gone to and from people for review via email.
One problem however: Enter Apple Mail, exit attachments.
Instead of the nicely revised document, you get a nice, anonymous, useless attachment. It’s frustrating to know that this “noname” attachment contains all of the precious work, just out of reach.
So, on opening this attachment (in vim, of course) I found that it was basically a base-64 encoded version of the document and some other stuff, with normalish MIME headers. Sort of like an attachment in an attachment. So by grabbing the most important (biggest) bit of encoded text, stripping out the new lines and un-encoding it, I could successfully get the document back and everyone was happy.
Having needed to use this script on a few occasions, I decided that it might be useful for some others, so here you go:
Of course I can’t be held responsible for the script not working, destroying priceless documents, killing your cat or anything else.
I have also put the script up on the server for quick reference: http://www.rjohnson.id.au/attachment_decoder/
Hope this is useful to someone out there…

