imap-email

Read and manage email via IMAP (ProtonMail Bridge, Gmail, etc.). Check for new/unread messages, fetch content, search mailboxes, and mark as read/unread. Works with any IMAP server including ProtonMail Bridge.

533 stars

Best use case

imap-email is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Read and manage email via IMAP (ProtonMail Bridge, Gmail, etc.). Check for new/unread messages, fetch content, search mailboxes, and mark as read/unread. Works with any IMAP server including ProtonMail Bridge.

Teams using imap-email should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/imap-email/SKILL.md --create-dirs "https://raw.githubusercontent.com/sundial-org/awesome-openclaw-skills/main/skills/imap-email/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/imap-email/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How imap-email Compares

Feature / Agentimap-emailStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Read and manage email via IMAP (ProtonMail Bridge, Gmail, etc.). Check for new/unread messages, fetch content, search mailboxes, and mark as read/unread. Works with any IMAP server including ProtonMail Bridge.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# IMAP Email Reader

Read, search, and manage email via IMAP protocol. Supports ProtonMail Bridge, Gmail IMAP, and any standard IMAP server.

## Quick Start

**Check for new emails:**
```bash
node skills/imap-email/scripts/imap.js check
```

**Fetch specific email:**
```bash
node skills/imap-email/scripts/imap.js fetch <uid>
```

**Mark as read:**
```bash
node skills/imap-email/scripts/imap.js mark-read <uid>
```

**Search mailbox:**
```bash
node skills/imap-email/scripts/imap.js search --from "sender@example.com" --unseen
```

## Configuration

Create `.env` in the skill folder or set environment variables:

```bash
IMAP_HOST=127.0.0.1          # Server hostname
IMAP_PORT=1143               # Server port
IMAP_USER=your@email.com
IMAP_PASS=your_password
IMAP_TLS=false               # Use TLS/SSL connection
IMAP_REJECT_UNAUTHORIZED=false  # Set to false for self-signed certs (optional)
IMAP_MAILBOX=INBOX           # Default mailbox
```

**ProtonMail Bridge setup:**
- Install and run ProtonMail Bridge
- Use `127.0.0.1:1143` for IMAP
- Password is generated by Bridge (not your ProtonMail password)
- TLS: Use `false` (Bridge uses STARTTLS)
- `REJECT_UNAUTHORIZED`: Set to `false` (Bridge uses self-signed cert)

**Gmail IMAP setup:**
- Host: `imap.gmail.com`
- Port: `993`
- TLS: `true`
- Enable "Less secure app access" or use App Password
- `REJECT_UNAUTHORIZED`: Omit or set to `true` (default)

## Commands

### check
Check for unread/new emails in mailbox.

```bash
node scripts/imap.js check [--limit 10] [--mailbox INBOX] [--recent 2h]
```

Options:
- `--limit <n>`: Max results (default: 10)
- `--mailbox <name>`: Mailbox to check (default: INBOX)
- `--recent <time>`: Only show emails from last X time (e.g., 30m, 2h, 7d)

Returns JSON array of messages with:
- uid, from, subject, date, snippet, flags

### fetch
Fetch full email content by UID.

```bash
node scripts/imap.js fetch <uid> [--mailbox INBOX]
```

Returns JSON with full body (text + HTML).

### search
Search emails with filters.

```bash
node scripts/imap.js search [options]

Options:
  --unseen           Only unread messages
  --seen             Only read messages
  --from <email>     From address contains
  --subject <text>   Subject contains
  --recent <time>    From last X time (e.g., 30m, 2h, 7d)
  --since <date>     After date (YYYY-MM-DD)
  --before <date>    Before date (YYYY-MM-DD)
  --limit <n>        Max results (default: 20)
  --mailbox <name>   Mailbox to search (default: INBOX)
```

Time format examples:
- `30m` = last 30 minutes
- `2h` = last 2 hours  
- `7d` = last 7 days

### mark-read / mark-unread
Mark message(s) as read or unread.

```bash
node scripts/imap.js mark-read <uid> [uid2 uid3...]
node scripts/imap.js mark-unread <uid> [uid2 uid3...]
```

### list-mailboxes
List all available mailboxes/folders.

```bash
node scripts/imap.js list-mailboxes
```

## Cron Integration

Set up periodic email checking with Clawdbot cron:

```bash
# Check email every 15 minutes, deliver to iMessage
clawdbot cron add \
  --name "email-check" \
  --cron "*/15 * * * *" \
  --session isolated \
  --message "Check for new ProtonMail emails and summarize them" \
  --deliver \
  --channel imessage \
  --to "+15085600825"
```

Inside the isolated session, the agent can run:
```bash
node /Users/mike/clawd/skills/imap-email/scripts/imap.js check --limit 5
```

## Workflow Examples

**Morning email digest:**
1. Run `check --limit 10 --recent 12h`
2. Summarize unread emails from overnight
3. Deliver summary to preferred channel

**Check recent emails from specific sender:**
1. Run `search --from "important@company.com" --recent 24h`
2. Fetch full content if needed
3. Mark as read after processing

**Hourly urgent email check:**
1. Run `search --recent 1h --unseen`
2. Filter for important keywords
3. Extract action items
4. Deliver notification if urgent

**Weekly digest:**
1. Run `search --recent 7d --limit 20`
2. Summarize activity
3. Generate weekly report

## Dependencies

Install in skill folder:
```bash
cd skills/imap-email
npm install imap-simple dotenv
```

Or install globally:
```bash
npm install -g imap-simple dotenv
```

## Security Notes

- Store credentials in `.env` (add to `.gitignore`)
- ProtonMail Bridge password is NOT your account password
- Bridge must be running for ProtonMail IMAP access
- Consider using app-specific passwords for Gmail

## Troubleshooting

**Connection timeout:**
- Verify IMAP server is running and accessible
- Check host/port configuration
- Test with: `telnet <host> <port>`

**Authentication failed:**
- Verify username (usually full email address)
- Check password is correct
- For ProtonMail Bridge: use Bridge-generated password, not account password
- For Gmail: use App Password if 2FA is enabled

**TLS/SSL errors:**
- Match `IMAP_TLS` setting to server requirements (true for SSL, false for STARTTLS)
- For self-signed certs (e.g., ProtonMail Bridge): set `IMAP_REJECT_UNAUTHORIZED=false`
- Check port matches TLS setting (993 for SSL, 143 for STARTTLS)

**Empty results:**
- Verify mailbox name (case-sensitive)
- Check search criteria
- List mailboxes with `list-mailboxes`

Related Skills

morning-email-rollup

533
from sundial-org/awesome-openclaw-skills

Daily morning rollup of important emails and calendar events at 8am with AI-generated summaries

email-sequence

533
from sundial-org/awesome-openclaw-skills

When the user wants to create or optimize an email sequence, drip campaign, automated email flow, or lifecycle email program. Also use when the user mentions "email sequence," "drip campaign," "nurture sequence," "onboarding emails," "welcome sequence," "re-engagement emails," "email automation," or "lifecycle emails." For in-app onboarding, see onboarding-cro.

imap-smtp-email

533
from sundial-org/awesome-openclaw-skills

Read and send email via IMAP/SMTP. Check for new/unread messages, fetch content, search mailboxes, mark as read/unread, and send emails with attachments. Works with any IMAP/SMTP server including Gmail, Outlook, 163.com, vip.163.com, 126.com, vip.126.com, 188.com, and vip.188.com.

email

533
from sundial-org/awesome-openclaw-skills

Email management and automation. Send, read, search, and organize emails across multiple providers.

email-management-expert

533
from sundial-org/awesome-openclaw-skills

Expert email management assistant for Apple Mail. Use this when the user mentions inbox management, email organization, email triage, inbox zero, organizing emails, managing mail folders, email productivity, checking emails, or email workflow optimization. Provides intelligent workflows and best practices for efficient email handling.

email-best-practices

533
from sundial-org/awesome-openclaw-skills

Use when building email features, emails going to spam, high bounce rates, setting up SPF/DKIM/DMARC authentication, implementing email capture, ensuring compliance (CAN-SPAM, GDPR, CASL), handling webhooks, retry logic, or deciding transactional vs marketing.

portfolio-watcher

533
from sundial-org/awesome-openclaw-skills

Monitor stock/crypto holdings, get price alerts, track portfolio performance

portainer

533
from sundial-org/awesome-openclaw-skills

Control Docker containers and stacks via Portainer API. List containers, start/stop/restart, view logs, and redeploy stacks from git.

portable-tools

533
from sundial-org/awesome-openclaw-skills

Build cross-device tools without hardcoding paths or account names

polymarket

533
from sundial-org/awesome-openclaw-skills

Trade prediction markets on Polymarket. Analyze odds, place bets, track positions, automate alerts, and maximize returns from event outcomes. Covers sports, politics, entertainment, and more.

polymarket-traiding-bot

533
from sundial-org/awesome-openclaw-skills

No description provided.

polymarket-analysis

533
from sundial-org/awesome-openclaw-skills

Analyze Polymarket prediction markets for trading edges. Pair Cost arbitrage, whale tracking, sentiment analysis, momentum signals, user profile tracking. No execution.