---
title: "IMAP Connector | Lansweeper Platform"
slug: "imap-connector"
description: "Learn how to connect your IMAP email account, including Gmail and Office 365, with detailed steps for authentication and setup."
status: "update"
updated: 2026-07-17T16:00:39Z
published: 2026-07-17T16:00:39Z
canonical: "docs.lansweeper.com/imap-connector"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lansweeper.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IMAP Connector

Note on third‑party tools

              

We aim to provide accurate and helpful details about third‑party tools, but we can’t guarantee that this information is always complete or up to date. If you notice any discrepancies, feel free to share them in the feedback section below. For the most reliable information, please always refer to the third‑party tool’s official documentation.

[IMAP](https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol) (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](https://imapflow.com/docs/).

## 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](https://support.google.com/accounts/answer/185833?hl=en):

1. Navigate to the [Google Account](https://myaccount.google.com/) 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](https://support.google.com/mail/answer/7126229).

#### 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](https://mysignins.microsoft.com/security-info) 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](https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9).

#### Configure the Connection

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

| Input | Description | Default |
| --- | --- | --- |
| **Host** | The IMAP server hostname (e.g., `imap.gmail.com` for Gmail, `outlook.office365.com` for Office 365) | — |
| **Port** | The IMAP server port | `993` |
| **Secure** | Whether to use a secure (TLS) connection | `true` |
| **Username** | The email address or username for the IMAP account | — |
| **Password** | The account password or app password | — |
| **Minimum TLS Version** | The minimum TLS version accepted by the connection | `TLSv1.1` |
| **Maximum TLS Version** | The maximum TLS version accepted by the connection | `TLSv1.3` |
| **Min DH Size** | Minimum key size (in bits) to accept in a TLS connection | `1024` |

| Input | Comments | Default |
| --- | --- | --- |
| Host | Provide the host address for the desired IMAP server. |  |
| Port | Provide the port for the desired IMAP server. | 993 |
| Secure | Determines if the connection is secure. | true |
| Username | Provide a valid username or email. |  |
| Password | Provide the password for the given user. This value is required if secured is set to true. |  |
| Minimum TLS Version | Provide a valid TLS version to be used in the connection. | TLSv1.1 |
| Maximum TLS Version | Provide a valid TLS version to be used in the connection. | TLSv1.3 |
| Min DH Size | Minimum size of bits to accept in a TLS connection | 1024 |

## Triggers

### New Emails

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

| Input | Comments | Default |
| --- | --- | --- |
| Connection | The IMAP connection to use. |  |
| Mailbox | Provide a string value for the name of the mailbox. |  |
| Fetch Content | When enabled, downloads and parses the full message body for each new email. | false |
| Mark as Read | When enabled, sets the Seen flag on new emails after polling. | false |

## Actions

### Add Flags

Add new flags to an existing message

| Input | Comments | Default |
| --- | --- | --- |
| Connection | The IMAP connection to use. |  |
| Mailbox | Provide a string value for the name of the mailbox. |  |
| Range | Provide a range of messages. Alternatively you can specify * to get the latest message. |  |
| Flags | For each item, provide a string value to be added to an existing message. |  |

### Append Message

Appends a new message to an existing mailbox

| Input | Comments | Default |
| --- | --- | --- |
| Connection | The IMAP connection to use. |  |
| Mailbox | Provide a string value for the name of the mailbox. |  |
| Path | Mailbox path to upload the message to. |  |
| Message Content | The raw RFC 822 formatted message content to append. |  |

### Copy Message

Copies a message from one mailbox to another.

| Input | Comments | Default |
| --- | --- | --- |
| Connection | The IMAP connection to use. |  |
| Mailbox | Provide a string value for the name of the mailbox. |  |
| Range | Provide a range of messages. Alternatively you can specify * to get the latest message. |  |
| New Path | Mailbox path to upload the message to. |  |

### Create Mailbox

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

| Input | Comments | Default |
| --- | --- | --- |
| Connection | The IMAP connection to use. |  |
| Path | Mailbox path to upload the message to. |  |

### Delete Message

Delete an existing message

| Input | Comments | Default |
| --- | --- | --- |
| Connection | The IMAP connection to use. |  |
| Mailbox | Provide a string value for the name of the mailbox. |  |
| Message UID | The UID of the message. |  |

### Download Message

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

| Input | Comments | Default |
| --- | --- | --- |
| Connection | The IMAP connection to use. |  |
| Mailbox | Provide a string value for the name of the mailbox. |  |
| Message Index or ID | The 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

| Input | Comments | Default |
| --- | --- | --- |
| Connection | The IMAP connection to use. |  |
| Mailbox | Provide a string value for the name of the mailbox. |  |

### List Mailboxes

Returns a list of available mailboxes

| Input | Comments | Default |
| --- | --- | --- |
| Connection | The IMAP connection to use. |  |

### Remove Flags From Message

Remove existing flags from an existing message

| Input | Comments | Default |
| --- | --- | --- |
| Connection | The IMAP connection to use. |  |
| Mailbox | Provide a string value for the name of the mailbox. |  |
| Range | Provide a range of messages. Alternatively you can specify * to get the latest message. |  |
| Flags | For each item, provide a string value to be added to an existing message. |  |

### Rename Mailbox

Change the name of an existing mailbox

| Input | Comments | Default |
| --- | --- | --- |
| Connection | The IMAP connection to use. |  |
| Path | Mailbox path to upload the message to. |  |
| New Path | Mailbox path to upload the message to. |  |

### Search / List Mailbox Messages

Returns all messages in the given mailbox

| Input | Comments | Default |
| --- | --- | --- |
| Connection | The IMAP connection to use. |  |
| Mailbox | Provide a string value for the name of the mailbox. |  |
| From | Filter email messages by sender. |  |
| To | Filter email messages by recipient. |  |
| Read / Unread Filter | Filter messages by read or unread status. | all |
| Filter Options | Extra parameters to filter the search results. |  |

### Set Flags

Set a value for an existing message flag

| Input | Comments | Default |
| --- | --- | --- |
| Connection | The IMAP connection to use. |  |
| Mailbox | Provide a string value for the name of the mailbox. |  |
| Range | Provide a range of messages. Alternatively you can specify * to get the latest message. |  |
| Flags | For each item, provide a string value to be added to an existing message. |  |
