Skip to main content

IMAP Connector

IMAP IMAP (Internet Message Access Protocol) is an Internet standard protocol used by email clients to retrieve email messages from a mail server over a TCP/IP connection. This component gives you the ability to list mailboxes, search and fetch emails, manage message flags, and copy or move messages on any IMAP server.

API Documentation

This component was built using the ImapFlow Node.js library.

Connections

IMAP Connection

Provide the details of your IMAP server.

To configure a connection to an IMAP server, the server's host address, port, login credentials, and TLS settings are required.

The setup can vary widely depending on the email service in use. Context for some popular services is provided below.

Prerequisites

  • Access to an IMAP-enabled email account
  • The IMAP server host address and port
  • Valid login credentials (username and password or app password)

Setup Steps

Gmail

To set up an IMAP connection to a Gmail account, create a Google App Password:

  1. Navigate to the Google Account page and select Security.
  2. Under Signing in to Google, select App Passwords. Sign-in may be required.
  3. If the App Passwords option is not available, possible reasons include:
    • 2-Step Verification is not set up for the account
    • 2-Step Verification is only set up for security keys
    • The account is through work, school, or another organization
    • Advanced Protection is enabled
  4. At the bottom, click Select App and choose Mail, then click Select device and choose Other (Custom name).
  5. Click GENERATE.
  6. A 16-character code will be generated — this is the app password. Copy it to a safe location.

If authentication problems occur, ensure the account has IMAP enabled.

Microsoft Office 365

If the Office 365 domain does not use multi-factor authentication (this is rare), the username and password can be used to authenticate directly.

If MFA is enabled, an app password is required to authenticate. To create an app password:

  1. Log in to the Microsoft Security Center and open the Security info tab.
  2. Click +Add method and choose App password.
  3. Enter a name for the app password, and copy the password that is generated.

If the App password option is unavailable, contact the Office 365 administrator to enable it.

Configure the Connection

Create a connection of type IMAP Connection and enter the following values:

InputDescriptionDefault
HostThe IMAP server hostname (e.g., imap.gmail.com for Gmail, outlook.office365.com for Office 365)
PortThe IMAP server port993
SecureWhether to use a secure (TLS) connectiontrue
UsernameThe email address or username for the IMAP account
PasswordThe account password or app password
Minimum TLS VersionThe minimum TLS version accepted by the connectionTLSv1.1
Maximum TLS VersionThe maximum TLS version accepted by the connectionTLSv1.3
Min DH SizeMinimum key size (in bits) to accept in a TLS connection1024
InputCommentsDefault
HostProvide the host address for the desired IMAP server.
PortProvide the port for the desired IMAP server.993
SecureDetermines if the connection is secure.true
UsernameProvide a valid username or email.
PasswordProvide the password for the given user. This value is required if secured is set to true.
Minimum TLS VersionProvide a valid TLS version to be used in the connection.TLSv1.1
Maximum TLS VersionProvide a valid TLS version to be used in the connection.TLSv1.3
Min DH SizeMinimum size of bits to accept in a TLS connection1024

Triggers

New Emails

Fetches new emails from a specified mailbox on a recurring schedule.

InputCommentsDefault
ConnectionThe IMAP connection to use.
MailboxProvide a string value for the name of the mailbox.
Fetch ContentWhen enabled, downloads and parses the full message body for each new email.false
Mark as ReadWhen enabled, sets the Seen flag on new emails after polling.false

Actions

Add Flags

Add new flags to an existing message

InputCommentsDefault
ConnectionThe IMAP connection to use.
MailboxProvide a string value for the name of the mailbox.
RangeProvide a range of messages. Alternatively you can specify * to get the latest message.
FlagsFor each item, provide a string value to be added to an existing message.

Append Message

Appends a new message to an existing mailbox

InputCommentsDefault
ConnectionThe IMAP connection to use.
MailboxProvide a string value for the name of the mailbox.
PathMailbox path to upload the message to.
Message ContentThe raw RFC 822 formatted message content to append.

Copy Message

Copies a message from one mailbox to another.

InputCommentsDefault
ConnectionThe IMAP connection to use.
MailboxProvide a string value for the name of the mailbox.
RangeProvide a range of messages. Alternatively you can specify * to get the latest message.
New PathMailbox path to upload the message to.

Create Mailbox

Creates a new mailbox folder and sets up subscription for the created mailbox

InputCommentsDefault
ConnectionThe IMAP connection to use.
PathMailbox path to upload the message to.

Delete Message

Delete an existing message

InputCommentsDefault
ConnectionThe IMAP connection to use.
MailboxProvide a string value for the name of the mailbox.
Message UIDThe UID of the message.

Download Message

Download either full RFC-822 formatted message or a specific body structure part

InputCommentsDefault
ConnectionThe IMAP connection to use.
MailboxProvide a string value for the name of the mailbox.
Message Index or IDThe index of the message you would like to download (1 for the oldest message, 2 for second oldest, etc), or the ID of the message.

Get Mailbox Status

Returns the status of a mailbox's properties

InputCommentsDefault
ConnectionThe IMAP connection to use.
MailboxProvide a string value for the name of the mailbox.

List Mailboxes

Returns a list of available mailboxes

InputCommentsDefault
ConnectionThe IMAP connection to use.

Remove Flags From Message

Remove existing flags from an existing message

InputCommentsDefault
ConnectionThe IMAP connection to use.
MailboxProvide a string value for the name of the mailbox.
RangeProvide a range of messages. Alternatively you can specify * to get the latest message.
FlagsFor each item, provide a string value to be added to an existing message.

Rename Mailbox

Change the name of an existing mailbox

InputCommentsDefault
ConnectionThe IMAP connection to use.
PathMailbox path to upload the message to.
New PathMailbox path to upload the message to.

Search / List Mailbox Messages

Returns all messages in the given mailbox

InputCommentsDefault
ConnectionThe IMAP connection to use.
MailboxProvide a string value for the name of the mailbox.
FromFilter email messages by sender.
ToFilter email messages by recipient.
Read / Unread FilterFilter messages by read or unread status.all
Filter OptionsExtra parameters to filter the search results.

Set Flags

Set a value for an existing message flag

InputCommentsDefault
ConnectionThe IMAP connection to use.
MailboxProvide a string value for the name of the mailbox.
RangeProvide a range of messages. Alternatively you can specify * to get the latest message.
FlagsFor each item, provide a string value to be added to an existing message.