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

# Email Channel

> Delegate tasks and receive responses via email.

<Note>
  Email is available as a plugin. Install it with `lukan plugin install-remote` or from the Web UI plugin manager.
</Note>

## Setup

```bash theme={null}
# Gmail preset
lukan mail setup gmail user@gmail.com

# Outlook preset
lukan mail setup outlook user@outlook.com

# Whitelist sender and enable
lukan mail allow sender@example.com
lukan mail on
lukan email
```

## Commands

```bash theme={null}
lukan email                      # Start Email channel
lukan mail on                    # Enable Email
lukan mail off                   # Disable Email
lukan mail setup gmail|outlook <email>  # Setup with preset
lukan mail allow <email>         # Whitelist an email
lukan mail deny <email>          # Remove from whitelist
lukan mail prefix [value]        # Get or set subject prefix filter
lukan mail tools list|add|remove|reset  # Manage allowed tools
lukan mail status                # Show configuration
lukan mail test                  # Test SMTP and IMAP connections
```

## Features

* **IMAP polling** - Receives emails via IMAP
* **SMTP sending** - Sends responses via SMTP
* **Whitelist required** - No emails processed if empty
* **Prefix filtering** - Optional subject prefix filter (case-insensitive)
* **Max response** - 10,000 characters
* **Automatic reconnect** - Reconnects on failure

## Configuration

```json theme={null}
{
  "email": {
    "enabled": true,
    "smtp": { "host": "smtp.gmail.com", "port": 587, "secure": false, "user": "...", "pass": "..." },
    "imap": { "host": "imap.gmail.com", "port": 993, "secure": true, "user": "...", "pass": "..." },
    "whitelist": ["boss@example.com"],
    "prefix": "[lukan]",
    "tools": ["Grep", "Glob", "ReadFile", "WebSearch", "WebFetch"]
  }
}
```

## Email Tools

| Tool           | Description                                |
| -------------- | ------------------------------------------ |
| `EmailList`    | List emails (folder, unseen filter, limit) |
| `EmailRead`    | Read email by UID                          |
| `EmailReply`   | Reply to an email with threading headers   |
| `EmailSend`    | Send a new email                           |
| `EmailFolders` | List available email folders               |
| `EmailConfirm` | Confirm a pending email send               |
| `EmailCancel`  | Cancel a pending email                     |
