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

# Email

> Set up IMAP/SMTP credentials for the Email VFS.

## Credentials

The Email VFS connects to password-authenticated IMAP (reading) and SMTP
(sending) servers. You need the server hostnames and a password or app
password accepted by that provider.

> [!WARNING]
>
> Microsoft 365 is unsupported because it requires OAuth for IMAP, while the
> current Email VFS accepts only passwords.

### 1. Find Your IMAP/SMTP Settings

| Provider | IMAP Host | IMAP Port | SMTP Host | SMTP Port |
| - | - | - | - | - |
| Yahoo | `imap.mail.yahoo.com` | 993 | `smtp.mail.yahoo.com` | 587 |
| Fastmail | `imap.fastmail.com` | 993 | `smtp.fastmail.com` | 587 |
| iCloud | `imap.mail.me.com` | 993 | `smtp.mail.me.com` | 587 |
| ProtonMail | `127.0.0.1` | 1143 | `127.0.0.1` | 1025 |
| Self-hosted | Your server hostname | 993 | Your server hostname | 587 |

ProtonMail requires [ProtonMail Bridge](https://proton.me/mail/bridge)
running locally.

### 2. Create an App Password

Many providers require an **app password** instead of your regular account
password. Check that your provider still supports password-authenticated IMAP
and SMTP before creating one.

**Yahoo:**

1. Go to [https://login.yahoo.com/account/security](https://login.yahoo.com/account/security)
2. **Generate app password**
3. Select **Other App**, name it (e.g., "Mirage")
4. Copy the generated password

**Fastmail:**

1. Go to [https://www.fastmail.com/settings/security/tokens](https://www.fastmail.com/settings/security/tokens)
2. **New App Password**
3. Select **IMAP/SMTP** access
4. Copy the generated password

**iCloud:**

1. Go to [https://appleid.apple.com/account/manage](https://appleid.apple.com/account/manage)
2. **Sign-In and Security** -> **App-Specific Passwords**
3. **Generate an app-specific password**
4. Copy the generated password

**Self-hosted / Other:**

Use your regular email password, or whatever your mail server
requires.

### 3. Save the credentials

```bash theme={null}
# .env.development
IMAP_HOST=imap.fastmail.com
SMTP_HOST=smtp.fastmail.com
EMAIL_USERNAME=you@fastmail.com
EMAIL_PASSWORD=your-app-password
```

## Troubleshooting

**"Authentication failed"** - Check whether your provider accepts passwords
for IMAP/SMTP and whether it requires an app password.

**"Connection refused"** - Check the hostname and port. Some networks
block port 993/587. For ProtonMail, make sure Bridge is running.

**"SSL handshake failed"** - Verify the host and implicit-TLS port (commonly
993 for IMAP). The current Python adapter's `use_ssl=False` setting opens a
plain connection; it does not perform a STARTTLS upgrade.

For SDK guides, see [Email (Python)](https://docs.mirage.strukto.ai/python/vfs/email.md) and [Email (TypeScript)](https://docs.mirage.strukto.ai/typescript/setup/email.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.