Skip to main content

Extract Attachments

Extracts attachments from EML files and saves them to a specified directory.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • EML File Path - The path to the EML file from which to extract attachments.
  • Extract Path - The directory path where attachments will be saved. If not provided, uses the system's temporary directory.

Output

  • Attachments - An array of filenames of the extracted attachments.

How It Works

The Extract Attachments node parses EML files (email message files) and extracts any attachments they contain. When executed, the node:

  1. Validates the provided EML file path input
  2. Uses the enmime library to parse the EML file
  3. Extracts all attachments from the email
  4. Saves each attachment to the specified directory
  5. Returns a list of the extracted attachment filenames

Requirements

  • A valid EML file path
  • The EML file must be accessible by the application
  • Write permissions to the extract directory (or temporary directory if not specified)

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid EML file path
  • EML file not found or inaccessible
  • Error reading the EML file envelope
  • Error writing attachments to disk

Usage Notes

  • The node supports various email attachment types including documents, images, and other files
  • If no extract path is provided, attachments are saved to the system's temporary directory
  • The output provides only the filenames of extracted attachments, not their full paths
  • Existing files with the same name in the extract directory will be overwritten