Skip to main content

Email Message Input

Description

Email Messages Input retrieves email messages and their attachments from a mail server using POP3, IMAP, or MBOX protocols. Use this step when your workflow needs to process incoming emails — for example, extracting invoice data from attachments, monitoring a support mailbox, or archiving messages. It supports filtering by sender, subject, and received date, along with SSL and proxy connections for secure environments. The step outputs message metadata and content as rows that downstream steps can transform or route.

The step also allows you to automatically extract attachments from email files (.eml) that are received as attachments within emails. This makes it easy to access files even when they are embedded inside multiple layers of emails.

Limitation

For Zoho email IMAP server configuration: Search queries on the Subject field are subject to server-side indexing rules. Queries with less than three characters (for example, ID, HR, or P0) may return no results even if matching emails exist. This behavior is due to IMAP server limitations, which typically require a minimum of three characters for search terms.

Configurations

Field NameDescription
General Tab:General mail server connection settings.
Step NameSpecify the name of the step. This name has to be unique in a single workflow.
Server Settings:
Source hostProvide the mail server host.
Use SSL?Enable this checkbox if your server needs an SSL connection.
UsernameSpecify the username of the mailbox to connect to.
PasswordSpecify the password for the username.
Use proxy?Select the checkbox if you want to connect through a proxy.
Proxy HostSpecify the Server Name or IP of the proxy.
Proxy PortSpecify the port number of the proxy.
Proxy UsernameSpecify the username to connect to the proxy server.
Proxy PasswordSpecify the password of the proxy server to connect.
Retrieve emails in reverse orderEnable this checkbox to retrieve email in reverse order i.e latest to oldest.
Fetch in batches?Enable this checkbox if you want to retrieve larger volumes of mails in batches.
Save AttachmentsEnable this checkbox to save attachments.
Attachment FolderClick Select folder to specify the folder name to save the attachments.
Sanitize attachment filenames?Select the checkbox to replace the illegal special characters in the filename with an underscore ().

By default, the checkbox is clear.

Note:
Underscore (
) will replace the following illegal special characters in the filename, [ \ / : * ? " < > | ].
Ignore errors reading fieldsSometimes a server doesn't support the retrieval of a particular piece of information. Enable this option to ignore these errors.
ProtocolSelect a standard protocol POP3, IMAP or MBOX to retrieve mails.

Note: To use a pop protocol, you need to configure your application for pop protocol, or for a web application you need to enable pop protocol which can differ for different service providers.

For example:

For web-based Gmail, you need to set the following, 1. Go to settings. 2. Go to Forwarding and POP/IMAP. 3. Enable POP for mail that arrives from now on.

Timeout and Protocols:
Connection timeout (in milliseconds)Specify the socket connection timeout value in milliseconds.

Default value: Infinite

Timeout (in milliseconds)Specify the socket read timeout in milliseconds.

Default value: Infinite

ProtocolsSelect the checkbox of the TLS version for sending the email message. The available versions are: TLSv1, TLSv1.1, TLSv1.2, or TLSv1.3. You can select one or all versions.
Test Connection buttonClick this button to connect to the mail server with the connection details specified. This button does not retrieve mails.
POP3 Settings:POP3 Settings are enabled if you chose POP3 as the protocol.
RetrieveSpecify either "All emails" or "Retrieve first... emails"
Retrieve the ... first emailsIf you chose "Retrieve first... emails", in the field above this field is enabled. Specify the number of mails you want to retrieve.

Note: The value should be less than or equal to number of email present in INBOX.

Delete emails afterEnable checkbox to Delete emails after retrieval.
IMAP Settings:IMAP Settings are enabled if you select IMAP as the protocol in General tab.

Note:
The javax.mail.FolderClosedException occurs when the mailbox connection is unexpectedly closed (due to timeout or network issues) while processing emails, especially during move operations. It typically indicates that the IMAP session was terminated before completing the folder actions.

Get folder from fieldEnable this option if you wish to retrieve the IMAP folder name from an input field.
Folder fieldSelect a field containing the folder name.
IMAP folderSpecify the name for the IMAP folder to retrieve mails from

Or

Click IMAP folder icon to select the IMAP folder from the Available folder pop-up window.

Click Test folder... to verify the folder is available and valid.

Test folder... buttonClick Test folder button to test if the folder is valid.
Open buttonClick Open button to select the IMAP folder.
Include subfoldersCheck this option to retrieve mails from sub-folders as well.
RetrieveSpecify which mails to retrieve: Get all, new, old, read, unread, flagged, not flagged, draft, not draft, answered or not answered messages.
Retrieve the first ... emailsSpecify the number emails to retrieve at most.

Note: This field is enabled Protocol chosen is IMAP in the General settings tab.

Move Email to FolderSpecify the IMAP folder where emails should be moved after they are processed. This feature works only with IMAP (not supported for POP3).

The field supports both static and environment variable values, for example, ${ARCHIVE_FOLDER}

Click Test folder to verify whether the specified destination folder exists on the mail server. This helps validate the folder path before running the workflow.

To move the email to the folder:

Enter the folder name or full path where emails should be moved.

For example,
- INBOX/Processed
- Archive/2024
- Completed

Important:

- Use the forward slash (/) to define folder hierarchy. For example, INBOX/Processed.
- Leave the field empty to disable email movement.
- Use variables to define IMAP folder, such as ${myVariable} or %%myVariable%%

Examples:

- INBOX/Archive - Moves emails to Archive inside Inbox
- Processed - Moves emails to Processed folder
- ${MOVE_TO_FOLDER} - Uses a variable value
- Archive/${YEAR}/${MONTH} - Moves emails to dynamic folders based on year and month
(Button) Select folderClick to open a folder browser that displays all available folders on the mail server. You can select the destination folder directly from the list.
Create folderSelect the checkbox to automatically create the destination folder, including any required parent folders if it does not already exist on the mail server.

The step fails if the destination folder does not exist

For example,
The Move Email to Folder field contains the path: processed_emails/FY_Years/FY_2026.
Only the processed_emails folder exists on the server.

When you select Create folder:

- The system creates folder FY_Years inside processed_emails.
- The system creates folder FY_2026 inside folder FY_Years.
- The system moves the emails to folder: processed_emails/FY_Years/FY_2026
Batch Settings:
Batch sizeSpecify the number of emails to retrieve at once in one batch.
Start at message numberSpecify the first message number to start retrieving at.
End at message numberSpecify the last message number to end retrieving with.
Attachment Tab:Use the Attachment tab to configure how the step processes and stores email attachments, including nested .eml files.

How .eml Extraction Works

- The step saves all attachments from incoming emails to the Attachment Folder.
- If it detects a .eml file, it parses the file and extracts any embedded attachments to the Extracted attachment location.
- If the system encounters nested .eml files inside the parent .eml, it continues extracting based on your configured Maximum .eml extraction depth:

    - Depth of 1: Extracts attachments from the first .eml file only.
    - Depth of 2: Processes the first .eml file and extracts any .eml files nested directly inside it.
    - Depth of 3: Processes up to three levels of nested emails.

Important:
- If nesting exceeds your configured limit, the system logs a warning, stops extraction, and saves the deepest reached .eml file intact.
- The system preserves original file names during extraction. If it detects duplicate file names, it appends a numeric suffix to the new file (for example, invoice_1.pdf, invoice_2.pdf).
- If the system cannot save an extracted attachment due to any reason (for example, invalid path or permission issue) the step fails and triggers your standard error-handling logic.
- If extraction of even a single file inside an .eml message fails, the step fails. If the workflow includes error handling, it continues execution, but the extraction fails for the step; otherwise, the entire workflow fails.
Save AttachmentsSelect Save Attachments to save attachments from the incoming email. If cleared, the step ignores all attachments, including .eml files.
Attachment FolderSpecify the folder path to save the primary attachments.

Or

Click Select Folder to choose a location.
Extract attachment from .emlSelect Extract attachment from .eml to extract attachments embedded inside .eml file.

Note: When selected, the following fields are enabled: Preserve .eml file, Extracted .eml attachment location and Maximum .eml extraction depth

Preserve .eml fileSelect Preserve .eml file to keep the original .eml file after successful extraction. If cleared, the step deletes the .eml file after it successfully extracts the nested attachments, and saves only last extracted attachment file.
Extracted .eml attachment locationSpecify the path to save the extracted attachments from the .eml files.

Or

Click Select folder to select the required location.
Maximum .eml extraction depthSpecify the number of nested email levels to extract attachments from (for example, 1, 2, …)

Allowed Values: 1,2,3

Default Value: 2

Sanitize attachment filenames?Select Sanitize attachment filenames? to replace illegal characters (! @ # / and so on) in attachment filenames with an underscore (_).
Filters Tab:These are the filters you can set on the header of the mail message.
Sender (FROM)If check box is ticked then filter by Sender (FROM).
Recipient(To)If check box is ticked then filter by Recipient(To).
SubjectIf check box is ticked then filter by Subject.
Received DateChoose a condition on Received Date from the list.
Limit SizePut a size limit on the mail with attachments.
Fields Tab:
NameChoose email attributes to be available as fields.
Keep HTML Tags in the BodySelect the checkbox if you want the HTML tags to be displayed in the output view.

Note: The checkbox is clear by default.