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

# IMAP Email

> Connect email accounts via IMAP for unified search across messages and attachments

The IMAP connector enables Omni to index and search content from any IMAP-compatible email account, including messages, attachments, and threaded conversations.

## Overview

### What Gets Indexed

| Source      | Content                                           |
| ----------- | ------------------------------------------------- |
| Emails      | Subject, body, sender, recipients, and dates      |
| Attachments | Text-based file attachments                       |
| Threads     | Grouped email conversations via message threading |

### How It Works

1. You provide IMAP server credentials (host, port, username, password)
2. The connector syncs emails from configured folders
3. Folder allow/deny lists control which mailbox folders are indexed
4. Email threads are grouped for efficient search

<Note>
  The connector uses read-only access — it only reads email via IMAP. Omni cannot send, modify, or delete any emails.
</Note>

<Tip>
  This is a general-purpose email connector that works with any IMAP-compatible provider (Gmail, Outlook, Yahoo, self-hosted mail servers, etc.).
</Tip>

## Prerequisites

Before setting up the IMAP connector, ensure you have:

* **IMAP server access credentials** (username and password)
* **For Gmail/Outlook**: an app-specific password is recommended
* **Omni deployment** with the IMAP connector service running

## Setup

### Step 1: Gather IMAP Server Details

Common IMAP settings for popular providers:

| Provider           | Host                    | Port | Encryption |
| ------------------ | ----------------------- | ---- | ---------- |
| Gmail              | `imap.gmail.com`        | 993  | TLS        |
| Outlook/Office 365 | `outlook.office365.com` | 993  | TLS        |
| Yahoo              | `imap.mail.yahoo.com`   | 993  | TLS        |

<Tip>
  For Gmail, you'll need to create an App Password at [https://myaccount.google.com/apppasswords](https://myaccount.google.com/apppasswords).
</Tip>

### Step 2: Connect in Omni

1. Navigate to **Settings** → **Integrations** in Omni
2. Find **IMAP Email** and click **Connect**
3. Enter connection details:
   * **Display name** (optional): A label for this account
   * **Host**: IMAP server hostname
   * **Port**: Server port (default 993 for TLS)
   * **Encryption**: TLS (recommended), STARTTLS, or None
   * **Username**: Your email address
   * **Password**: Your password or app-specific password
4. Optionally configure advanced settings:
   * **Folder allowlist**: Only sync specific folders (comma-separated)
   * **Folder denylist**: Skip specific folders (comma-separated)
   * **Max message size**: Limit for individual messages (0 = unlimited)
   * **Webmail URL template**: Template for linking back to the source in webmail, with `{folder}`, `{uid}`, and `{message_id}` placeholders (e.g. `https://mail.example.com/?folder={folder}&msg={uid}`)
5. Click **Connect**
6. Click **Sync Now** to start the initial sync

<Warning>
  Using "None" for encryption sends credentials in plaintext. Only use this for trusted local networks.
</Warning>

<Check>
  Your IMAP connector is now configured. Initial indexing may take a while depending on the number of emails in your mailbox.
</Check>

## Managing the Integration

### Viewing Sync Status

Navigate to **Settings** → **Integrations** to view the sync status for each source directly on the list, including last sync time, number of indexed items, and any errors. Click **Configure** on a source for more details.

### Sync Modes

The IMAP connector supports two sync modes:

| Mode            | Description                                                      |
| --------------- | ---------------------------------------------------------------- |
| **Full**        | Syncs all emails from configured folders (used for initial sync) |
| **Incremental** | Syncs only new emails since last sync (used for updates)         |

After the initial full sync, the connector automatically performs incremental syncs to capture new emails.

### Default Excluded Folders

By default, the following folders are excluded from indexing: **Trash**, **Spam**, **Junk**, **Junk Email**, **Deleted Items**, **Deleted Messages**, **\[Gmail]/Trash**, and **\[Gmail]/Spam**.

You can override this behavior by configuring the folder denylist in the connector settings.

### Removing the Integration

1. Navigate to **Settings** → **Integrations**
2. Click **Configure** against the IMAP source
3. Click **Delete Permanently**

## Troubleshooting

<AccordionGroup>
  <Accordion title="Emails not appearing in search">
    Common causes:

    * Folder allow/deny lists may be excluding the target folder
    * Sync has not completed yet

    **Solution**: Check your folder allow/deny list configuration and verify the sync has completed in **Settings** → **Integrations** → **IMAP Email**.
  </Accordion>

  <Accordion title="Authentication failed">
    The credentials may be incorrect, or your provider may require an app-specific password.

    **Solution**:

    1. Verify your username and password are correct
    2. For Gmail, create an App Password at [https://myaccount.google.com/apppasswords](https://myaccount.google.com/apppasswords)
    3. For Outlook, check if your organization requires app-specific passwords
    4. Update the credentials in Omni via **Settings** → **Integrations** → **IMAP Email**
  </Accordion>

  <Accordion title="Connection timeout">
    The server may be unreachable or the connection settings may be incorrect.

    **Solution**: Verify the host, port, and encryption settings match your provider. Refer to the common IMAP settings table in Step 1.
  </Accordion>

  <Accordion title="Large mailbox sync is slow">
    Mailboxes with many emails can take a long time to sync initially.

    **Solution**: Consider using the folder allowlist to limit the scope of the sync, or set a max message size to skip very large emails.
  </Accordion>
</AccordionGroup>

## Security Considerations

* **Read-only access**: The connector only reads email via IMAP
* **TLS encryption**: Always use TLS or STARTTLS for production deployments
* **App passwords**: Use app-specific passwords instead of your main account password
* **Encrypted storage**: Credentials are encrypted at rest in Omni

## What's Next

<CardGroup cols={3}>
  <Card title="Search Your Data" icon="magnifying-glass" href="/user-guide/search">
    Learn how to search across your emails
  </Card>

  <Card title="AI Assistant" icon="robot" href="/user-guide/ai-assistant">
    Ask questions about your email conversations
  </Card>

  <Card title="Add More Connectors" icon="plug" href="/connectors/overview">
    Connect additional data sources
  </Card>
</CardGroup>
