
Made this little script for parsing .MSG files (the half-binary mail files you get when dragging e-mails out of MS Outlook) in order to parse about 25000 “undeliverable” e-mails. Should work on all systems containing bash, grep and awk.
It’s extremely simple and just loops through all files grepping out all lines starting with “To:” and then uses awk to clean the strings. Posting it as I couldn’t find anything similar through Google and someone else might get some use out of it. Easy to modify as well.
And again, only tested against “Undeliverable” mails turned into .MSG-files, but I’m guessing they look the same as normal mails. If it doesn’t work, please comment and I’ll fix it up.








