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 Use proxy is checked)

Protocol

Choose between

  • POP3

  • IMAP

  • MBOX

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 name_{SYS|hhmmss_MMddyyyy|}_#IdFile#.mail

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 Different folder for attachment is checked)

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:

  • All emails

  • Retrieve first …​ emails

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

  • Get all messages

  • Get new messages

  • Get old messages

  • Get read messages

  • Get unread messages

  • Get flagged messages

  • Get not flagged messages

  • Get draft messages

  • Get not draft messages

  • Get answered messages

  • Get not answered messages

The selected value is stored with the workflow (XML tag valueimaplist, for example imaplistunread). Reopening the action keeps the same Retrieve option.

Retrieve the first…​emails

specify the number of messages to retrieve

After retrieved

specify the action to perform on email messages after retrieval:

  • Do nothing

  • Delete message

  • Move message to folder

Move to folder

move the retrieved messages to a different folder on the IMAP server (if Move message to folder was selected)

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

  • None (default, don’t filter on received date)

  • Equal to Date 1

  • Smaller than Date 1

  • Greater than Date 1

  • Between Date 1 and Date 2

Date 1, Date 2

The dates for the condition, in the format yyyy-MM-dd HH:mm:ss.

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 ignore and IMAP list codes such as imaplistunread are 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.