Get mails (POP3/IMAP)
Description
The Get mails (POP3/IMAP) action retrieves mails from a POP3 or IMAP server and stores them into one or more files.
Options
General tab
| Option | Description |
|---|---|
Mail Server Connection |
|
Mail Server Connection |
If a mail server connection is selected here, the rest of this tab is ignored. The server configuration will be taken from the Mail Server Connection metadata item. |
Server Settings |
|
Action name |
The name of the workflow action. |
Source Host |
The host name or IP-address of the pop server. |
Use SSL |
If checked A secure connection will be used to communicate with the server. |
Use XOAUTH2 |
If checked XOAuth2 will be used to authenticate with the server. |
Port |
The port of the POP3 or IMAP server, with or without SSL. |
Username |
The username to log in with. |
Password |
The password to log in with. |
Use proxy |
check to enable proxy authentication |
Proxy username |
proxy authorised user (only available if |
Protocol |
Choose between
|
Test connection |
Click this button to test the provided settings |
Target folder |
|
Target directory |
The directory in which you want to put the mail files. |
Create folder |
check to create the specified target directory if it doesn’t exist |
Target filename pattern |
The filename pattern (start of filename). The default pattern is |
Save message content |
check to save the message body text for retrieved email messages |
Get mail attachment |
check to save the attachments for retrieved email messages |
Different folder for attachment |
check to save the attachments for retrieved email messages in a different folder than the message body |
Attachment files folder |
the folder to store attachments for retrieved email messages in (only available if |
Attachment wildcard |
the wildcard to use to save attachments for retrieved email messages (none = all) |
Settings tab
| Option | Description |
|---|---|
Action |
This dropdown box lets you specify the action to perform on the retrieved email messages: * Get messages * Move messages to folder (IMAP only since POP3 only knows one folder "INBOX") * Delete messages |
POP3 settings |
|
Retrieve |
Select the e-mails to retrieve:
|
Retrieve the .. first emails |
Allows you to specify the number of emails to retrieve if "first … emails" is selected. |
Delete emails after retrieval |
check to delete the mails on the pop server after retrieval. |
IMAP settings |
|
IMAP folder |
the folder on the IMAP server to retrieve messages from |
Include subfolders |
check to select messages for subfolders from the selected IMAP folder |
Retrieve |
choose one of
The selected value is stored with the workflow (XML tag |
Retrieve the first…emails |
specify the number of messages to retrieve |
After retrieved |
specify the action to perform on email messages after retrieval:
|
Move to folder |
move the retrieved messages to a different folder on the IMAP server (if |
Create folder |
create a folder on the IMAP server to move the messages to if it doesn’t exist. |
Filters tab
| Option | Description |
|---|---|
Header |
|
Sender (FROM) |
messages will be filtered on sender |
Recipient (TO) |
messages will be filtered on recipient |
Subject |
messages will be filtered on subject |
Content |
|
Body |
messages will be filtered on the specified text in the email body |
Received date |
|
Condition |
Choose a date or date range. The available options are
|
Date 1, Date 2 |
The dates for the condition, in the format |
Notes
-
IMAP Retrieve (unread, new, flagged, and the other list options) is stored with the workflow. Saving and reopening keeps the selected option.
-
Workflows saved in Hop 2.13 still load: date conditions such as
ignoreand IMAP list codes such asimaplistunreadare accepted, not only integer indexes.
Result
What this action passes on to the next action. See Action results for how results travel through a workflow.
| Result | Value |
|---|---|
True |
The action connected and processed the selected messages, with 0 errors. No message to process, for example an empty mailbox, is also true. |
False |
The number of errors is 1. Target directory is empty, or doesn’t exist and Create folder is unchecked, Different folder for attachment is checked and Attachment files folder is empty, or doesn’t exist and Create folder is unchecked, the server can’t be reached or refuses the login, the Mail Server Connection doesn’t exist, the IMAP folder doesn’t exist, Move to folder is empty or doesn’t exist and Create folder is unchecked, or a Received date condition is selected without Date 1. |
Result files |
Passed on unchanged: the saved messages and attachments are not added. |
Result rows |
Passed on unchanged. |
Lines written |
The number of messages saved with Save message content. |
Files retrieved |
The number of attachments saved. |
Lines deleted |
The number of messages deleted, by the Delete messages action, Delete emails after retrieval or Delete message after retrieval. A message moved on its own also counts here: with Move message to folder after retrieval, or with the Move messages to folder action and Retrieve the first…emails. |
Lines updated |
The number of messages moved to another IMAP folder. |
When the action is false, these metrics keep the values of the previous action.
The IdFile number in Target filename pattern starts again in each folder: with Include subfolders, a message of a subfolder can overwrite the file of a message of the first folder.
|
| Retrieve the first…emails also applies to the Delete messages and Move messages to folder actions: only that number of messages is deleted or moved. |