26 May 2022

MPack will extract eml container file into txt and attachments separately. MPack is a C implementation of an encoder and decoder for the MessagePack serialization format.

  • -f Force overwriting of existing files. If a message suggests a file name of an existing file, the file will be overwritten. Without this flag, munpack appends ".1", ".2", etc to find a nonexistent file.
  • -q Suppresses messages about saving partial messages and about messages with no interesting information.
  • -t Also write the text MIME parts of multipart messages as files. By default, text parts that do not have a filename parameter do not get unpacked. This option effectively disables the ".desc" file feature for MIME messages.
  • -C Change the current directory to directory before reading any files. This is useful when invoking munpack from a mail or news reader.
Source code viewer
  1. # Single file extraction
  2. munpack email.eml
  3.  
  4. # Multiple files using find
  5. find -name *.eml | xargs -I {} munpack {}
Programming Language: Bash