Email

Extract Attachments

Saves the attachments and attached emails of .msg and .eml files into a new folder, with family IDs that tie each attachment to its parent email and verified hashes for every file.

Free Command line: extract-attachments Version 1.1

Extract Attachments opens each email, writes out every attachment, and records it in a report with a family ID. The emails themselves are read only and never changed.

Each email gets a family number in folder order (F000001, F000002 …). Its attachments are numbered under it (F000001.0001, F000001.0002), and the attachments of an attached email go one level deeper (F000001.0002.0001). Because numbers and folders are fixed in folder order, running the tool again on the same emails gives the same IDs and names.

Attached emails are always saved as .msg or .eml files, named after their subject. Unsafe or over-long file names are made safe before saving. Every file is hashed and re-read after writing to confirm the copy. As with the other email tools, emails saved with no extension (Unix mail stores such as the Enron corpus) are also read when Extensions is left empty.

Use it when

How to run it

  1. Choose the folder of emails as Input and an Output folder outside it.
  2. Choose the Layout: PerEmailFolder (one folder per email) or Flat (everything in one folder).
  3. Decide whether to tick Include inline for signature logos and embedded images.
  4. Set Minimum size (KB) if you want to skip small files, and leave Attachments of attached emails on to go into attached emails.
  5. Choose the Hashes to record.
  6. Click Run, then Open report and read the notes in the result panel.

Settings

Every setting has the same help beside it in the app. On the command line, pass each as --name value; ltk help extract-attachments lists them.

Settings

SettingWhat it doesType and default
Layout
--layout
PerEmailFolder: one folder per email (named after the email file), mirroring the source structure. Flat: all attachments in one folder, named <email>_<attachment>.
PerEmailFolder mirrors the source folders and creates a folder per email, named after the email file including its extension (so x.msg and x.eml never share a folder). Attachments of an attached email go in a sub-folder named after that attached email. Flat puts everything in one folder named <email>_<attachment>; clashing names are numbered, never overwritten. Flat runs one email at a time so the numbering stays the same between runs.
choice: PerEmailFolder, Flat
PerEmailFolder
Include inline
--include-inline
Also extract inline items (signature logos, embedded images in the message body).
Off by default, so signature logos and images embedded in the message body are skipped and counted in a note. Turn it on when the embedded images matter, for example screenshots pasted into the body. Inline items are marked Inline in the Kind column.
yes/no
false
Minimum size (KB)
--min-size-kb
Skip attachments smaller than this many KB (e.g. 10 to skip tiny images). 0 extracts everything.
A quick way to drop tiny images. It applies to file attachments only: attached emails are always saved, and the filter also applies to files inside them. Skipped files are counted in a note but get no row.
number
0
Attachments of attached emails
--nested
Also extract the attachments of attached emails (up to 10 levels deep). Attached emails themselves are always saved as .msg/.eml files.
On: the tool also opens attached emails and extracts their attachments, up to 10 levels deep. Off: attached emails are still saved as files, but their contents are not extracted separately.
yes/no
true
Hashes
--hashes
Hashes to record for each extracted file. Every file is verified after writing.
Choose the hashes your matter uses. Whatever you pick, every file is verified after it is written; the Verification column says which hashes were checked.
choices: MD5, SHA1, SHA256
MD5,SHA1

Common settings

SettingWhat it doesType and default
Input required
--input
Folder (or single file) to read. It is opened read-only and never modified. folder
empty
Output required
--output
Folder for reports. Must not be inside the input folder. Each run gets its own sub-folder. folder
empty
Recurse
--recurse
Include sub-folders. yes/no
true
Extensions
--extensions
Only process these extensions (e.g. .pdf, .docx). Empty means the tool's default set. list
empty
Parallelism
--parallelism
Files processed at once. Use 1-2 for spinning disks or network shares. number
4

What you get

Each run creates its own folder inside the output folder, with the report extract-attachments.csv, errors.csv and manifest.json (see Run folders and manifests).

Report columns

Check the result

Tips
  • An email with no attachments still takes a family number, so FamilyId values in the report can skip numbers. This keeps IDs stable between runs.
  • Outlook contact photos are not extracted.
  • The original attachment name is kept in AttachmentName even when the saved file name had to be made safe.
Watch out for
  • Family IDs are this tool's own numbering, based on folder order. If you need production numbers, apply them later with Assign Document IDs or Bates Stamp.
  • If you change the input folder (add, remove or rename emails) and run again, family numbers after the change will shift.

From the command line

The command line is part of LitTechKit Pro. See Command line.

ltk run extract-attachments --input "D:\Matter\Emails" --output "D:\Matter\Attachments" --layout PerEmailFolder --min-size-kb 10 --hashes MD5,SHA1

Related tools