Skip to content

Instantly share code, notes, and snippets.

@jessepeterson
Last active December 15, 2015 01:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jessepeterson/5180781 to your computer and use it in GitHub Desktop.
Save jessepeterson/5180781 to your computer and use it in GitHub Desktop.
Convert an Apple emlx file to a .eml file (removing the Apple-proprietary parts; leaving a raw message file)
import sys
for i in sys.argv[1:]:
if i.lower().endswith('emlx'):
print 'Processing:', i
else:
print 'Unknown file:', i
sys.exit(1)
emlx = open(i, 'r')
elen = int(emlx.readline().rstrip())
email = emlx.read(elen)
emlx.close()
neweml = open(i + '.eml', 'w')
neweml.write(email)
neweml.close()
@foxx
Copy link

foxx commented Sep 3, 2015

Nice, ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment