> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://mammoth.io/docs/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# Import email attachments into Mammoth over IMAP

> Connect Mammoth to a mailbox over IMAP with host, port, security and an app password, and collect CSV and Excel attachments with a File Collection.

The Email (IMAP) connector reads a mailbox over IMAP so files that arrive as email attachments can come into Mammoth. It's a file source, like a drive or file server. Open it from **Data Library** > **New dataset** > **Connectors** and search for **Email (IMAP)**. Project Admins create the connection; Project Editors can start datasets from a connection the project already has. Which connectors you can add depends on your plan.

## What you can bring in from email

- Attachments of these types: `.csv`, `.tsv`, `.xls`, `.xlsx` and `.xlsm`.
- Attachments from unread messages. Mammoth lists attachments from the 50 most recent unread messages in a folder, newest first. The default folder is `INBOX`.

## Before you connect a mailbox

You need:

- The mailbox's IMAP server, port and security setting.
- The email address and its password. Many providers require an app password for IMAP access. For Gmail, create one at myaccount.google.com/apppasswords.
- IMAP access turned on for the mailbox.

## Connect a mailbox over IMAP

1. Go to the **Data Library**, click **New dataset**, and choose **Connectors**.
2. Search for **Email (IMAP)** and click its tile. The connector workspace opens with the **Chat** showing. See [Connect a database or app](https://mammoth.io/docs/learn/get-data-in/connect-a-source/) for the shared steps.
3. Enter the connection details below and connect.

| Field | What to enter |
| --- | --- |
| **Host** | IMAP server. Default `imap.gmail.com`. Other examples: `outlook.office365.com`, `imap.mail.yahoo.com` |
| **Port** | Default `993` |
| **Security** | **SSL/TLS (port 993)** (default), **STARTTLS (port 143)** or **None** |
| **Email** | The mailbox address |
| **Password** | The mailbox password or app password |
| **Display Name** | Optional label for this connection in Mammoth |
| **Allow self-signed certificate** | Tick only if your mail server uses a self-signed certificate |



| Security option | What it does |
| --- | --- |
| **SSL/TLS (port 993)** | Encrypts the connection from the start |
| **STARTTLS (port 143)** | Upgrades a plain connection to an encrypted one |
| **None** | Sends credentials in clear text |

When **Allow self-signed certificate** is off (the default), Mammoth checks the server's TLS certificate. Turn it on only for a trusted server.

## Keep collecting new email attachments

A file you save from a file source is saved once; Mammoth shows **Saved once. Scheduled refresh for files is coming.** Email (IMAP) datasets can't be added to a [Dataset Refresh](https://mammoth.io/docs/learn/automate/refresh-a-dataset/) automation. To keep bringing in new attachments:

1. Set up a **File Collection** automation with Email (IMAP) as the source. See [What you can automate](https://mammoth.io/docs/learn/automate/).
2. Set up a [Data Consolidation](https://mammoth.io/docs/learn/automate/consolidate/) automation to add the collected files to a dataset.

## Email (IMAP) limits

| Limit | Value |
| --- | --- |
| Messages scanned when listing attachments | The 50 most recent unread messages in the folder |
| Attachment size | Attachments over 100 MB are skipped |
| Attachment types | `.csv`, `.tsv`, `.xls`, `.xlsx`, `.xlsm` |

## Troubleshoot IMAP connections

| Symptom | Likely cause | Fix |
| --- | --- | --- |
| Connection fails | **Port** doesn't match **Security** | Use 993 for SSL/TLS and 143 for STARTTLS |
| Connection fails | IMAP is off, or the provider needs an app password | Turn on IMAP access for the mailbox, and use an app password |
| Certificate error | The server uses a self-signed certificate | Tick **Allow self-signed certificate** |
| An attachment doesn't appear | It's on an older or already-read message, too large, or an unsupported type | Check it's among the 50 most recent unread messages, under 100 MB, and a supported type |

## Related

- [Connect a database or app](https://mammoth.io/docs/learn/get-data-in/connect-a-source/): the shared connector workspace steps.
- [What you can automate](https://mammoth.io/docs/learn/automate/): set up a File Collection automation.
- [Combine incoming data](https://mammoth.io/docs/learn/automate/consolidate/): add collected attachments to one dataset.
- [Receive data by webhook](https://mammoth.io/docs/learn/get-data-in/webhooks/): let another system push data to Mammoth instead.
- [Manage saved connections](https://mammoth.io/docs/learn/get-data-in/connections/): reuse or remove this connection.

---
Source: https://mammoth.io/docs/learn/get-data-in/connectors/email-imap.md · Updated: 2026-11-08
