eml-file

Parse an RFC 822 compliant EML file to extract email information such as headers, subject, and content.

Syntax

eml-file [zipcharset=CHARSET] [zippath=ZIPFILE_PATH] [raw=BOOL] FILE_PATH
Required Parameter
FILE_PATH
Path to the EML file. Using a wildcard (*) in the file name, you can retrieve all files containing a specific string pattern in the file name (e.g. D:\data\eml\*.eml). If you provided the zippath option, input the EML file path in the zip file.
Optional Parameters
zipcharset=CHARSET
Character set to be used to decode the ZIP entry name and comment that are not encoded by UTF-8 encoding. Use the preferred MIME name or aliases registered in the following document: http://www.iana.org/assignments/character-sets/character-sets.xhtml
zippath=ZIPFILE_PATH
Path to the ZIP file.
raw=t
HTML format to be applied to mail_content (default: f).
  • t: HTML
  • f: plain text

Description

The output fields are as follows:

FieldTypeDescription
_fileStringEML file name
_timeDateSent date from "Date" header
mail_fromStringAddress from "From" header
mail_from_nameStringDisplay name from "From" header
mail_toStringAddresses from "To" header, delimited by a new line.
mail_to_nameStringDisplay names from "To" header, delimited by a new line.
mail_ccStringAddresses from "Cc" header, delimited by a new line.
mail_cc_nameStringDisplay names from "Cc" header, delimited by a new line.
mail_bccStringAddress from "Bcc" header, delimited by a new line.
mail_bcc_nameStringDisplay names from "Bcc" header, delimited by a new line.
mail_subjectStringSubject
mail_contentStringText or HTML content.
mail_attachmentsStringAttachment file names, delimited by a new line.
mail_headersStringHeader name-value pairs, delimited by a new line.
attachmentsArrayElements with file_name and file_size properties.

Usage

  1. Retrieve information by providing the EML file path.

    eml-file sample.eml
    
  2. Retrive information when the zippath option is provided.

    eml-file zippath=image.zip sample.eml