A command-line tool to extract attachments from an email message.
npm install -g extract_attachments
If you get permission denied errors, try again with sudo:
sudo npm install -g extract_attachments
If email.msg is the file you want to extract attachments from, do:
The attachments will be written to your current directory with their original names in the email.