# IMAP Email

Trigger workflows when new emails arrive via IMAP (works with any email provider)

The IMAP Email trigger allows your SteelEngine workflows to start automatically whenever a new email is received in any mailbox that supports the IMAP protocol. This works with Gmail, Outlook, Yahoo, and most other email providers.

With the IMAP trigger, you can:

* **Automate email processing**: Start workflows in real time when new messages arrive in your inbox.
* **Filter by sender, subject, or folder**: Configure your trigger to react only to emails that match certain conditions.
* **Extract and process attachments**: Automatically download and use file attachments in your automated flows.
* **Parse and use email content**: Access the subject, sender, recipients, full body, and other metadata in downstream workflow steps.
* **Integrate with any email provider**: Works with any service that provides standard IMAP access, without vendor lock-in.
* **Trigger on unread, flagged, or custom criteria**: Set up advanced filters for the kinds of emails that start your workflows.

With SteelEngine, the IMAP integration gives you the power to turn email into an actionable source of automation. Respond to customer inquiries, process notifications, kick off data pipelines, and more—directly from your email inbox, with no manual intervention.

## Usage Instructions

Connect to any email server via IMAP protocol to trigger workflows when new emails are received. Supports Gmail, Outlook, Yahoo, and any other IMAP-compatible email provider.

## Triggers

A workflow can start when one of these IMAP Email events occurs.

### IMAP Email Trigger

Triggers when new emails are received via IMAP (works with any email provider)

SteelEngine checks IMAP Email for new items on a schedule.

#### Configuration

| Field                | Type     | Description                                                                             |
| -------------------- | -------- | --------------------------------------------------------------------------------------- |
| IMAP Server          | text     | IMAP server hostname (e.g., imap.gmail.com, outlook.office365.com)                      |
| Port                 | text     | IMAP port (993 for SSL/TLS, 143 for STARTTLS)                                           |
| Use SSL/TLS          | toggle   | Enable SSL/TLS encryption (recommended for port 993)                                    |
| Username             | text     | Email address or username for authentication                                            |
| Password             | text     | Password or app-specific password (for Gmail, use an App Password)                      |
| Mailboxes to Monitor | dropdown | Choose which mailbox/folder(s) to monitor for new emails. Leave empty to monitor INBOX. |
| Search Criteria      | code     | ImapFlow search criteria as JSON object. Default: unseen messages only.                 |
| Mark as Read         | toggle   | Automatically mark emails as read (SEEN) after processing                               |
| Include Attachments  | toggle   | Download and include email attachments in the trigger payload                           |

#### Output

| Field              | Type    | Description                                                            |
| ------------------ | ------- | ---------------------------------------------------------------------- |
| `messageId`        | string  | RFC Message-ID header                                                  |
| `subject`          | string  | Email subject line                                                     |
| `from`             | string  | Sender email address                                                   |
| `to`               | string  | Recipient email address                                                |
| `cc`               | string  | CC recipients                                                          |
| `date`             | string  | Email date in ISO format                                               |
| `bodyText`         | string  | Plain text email body                                                  |
| `bodyHtml`         | string  | HTML email body                                                        |
| `mailbox`          | string  | Mailbox/folder where email was received                                |
| `hasAttachments`   | boolean | Whether email has attachments                                          |
| `attachments`      | file\[] | Email attachments as files                                             |
| `email`            | object  |                                                                        |
| ↳ `messageId`      | string  | RFC Message-ID header                                                  |
| ↳ `subject`        | string  | Email subject line                                                     |
| ↳ `from`           | string  | Sender email address                                                   |
| ↳ `to`             | string  | Recipient email address                                                |
| ↳ `cc`             | string  | CC recipients                                                          |
| ↳ `date`           | string  | Email date in ISO format                                               |
| ↳ `bodyText`       | string  | Plain text email body                                                  |
| ↳ `bodyHtml`       | string  | HTML email body                                                        |
| ↳ `mailbox`        | string  | Mailbox/folder where email was received                                |
| ↳ `hasAttachments` | boolean | Whether email has attachments                                          |
| ↳ `attachments`    | file\[] | Array of email attachments as files (if includeAttachments is enabled) |
| `timestamp`        | string  | Event timestamp                                                        |
