imap-emailRead 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.
Install via ClawdBot CLI:
clawdbot install mvarrieur/imap-emailRead, search, and manage email via IMAP protocol. Supports ProtonMail Bridge, Gmail IMAP, and any standard IMAP server.
Check for new emails:
node skills/imap-email/scripts/imap.js check
Fetch specific email:
node skills/imap-email/scripts/imap.js fetch <uid>
Mark as read:
node skills/imap-email/scripts/imap.js mark-read <uid>
Search mailbox:
node skills/imap-email/scripts/imap.js search --from "sender@example.com" --unseen
Quick setup (ProtonMail Bridge):
cd skills/imap-email
./setup.sh
The setup helper will prompt for Bridge credentials and test the connection.
Manual setup:
.env.example to .env in the skill folder.env file is automatically ignored by gitEnvironment variables:
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
⚠️ Security: Never commit your .env file! It's already in .gitignore to prevent accidents.
ProtonMail Bridge setup:
127.0.0.1:1143 for IMAPfalse (Bridge uses STARTTLS)REJECT_UNAUTHORIZED: Set to false (Bridge uses self-signed cert)Gmail IMAP setup:
imap.gmail.com993trueREJECT_UNAUTHORIZED: Omit or set to true (default)Check for unread/new emails in mailbox.
node scripts/imap.js check [--limit 10] [--mailbox INBOX] [--recent 2h]
Options:
--limit : Max results (default: 10)--mailbox : Mailbox to check (default: INBOX)--recent : Only show emails from last X time (e.g., 30m, 2h, 7d)Returns JSON array of messages with:
Fetch full email content by UID.
node scripts/imap.js fetch <uid> [--mailbox INBOX]
Returns JSON with full body (text + HTML).
Search emails with filters.
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 minutes2h = last 2 hours 7d = last 7 daysMark message(s) as read or unread.
node scripts/imap.js mark-read <uid> [uid2 uid3...]
node scripts/imap.js mark-unread <uid> [uid2 uid3...]
List all available mailboxes/folders.
node scripts/imap.js list-mailboxes
Set up periodic email checking with Clawdbot cron:
# 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:
node /Users/mike/clawd/skills/imap-email/scripts/imap.js check --limit 5
Morning email digest:
check --limit 10 --recent 12hCheck recent emails from specific sender:
search --from "important@company.com" --recent 24hHourly urgent email check:
search --recent 1h --unseenWeekly digest:
search --recent 7d --limit 20Required packages: imap-simple, mailparser, dotenv
Installation:
cd skills/imap-email
npm install
This will install all dependencies listed in package.json.
.env (add to .gitignore)Connection timeout:
telnet Authentication failed:
TLS/SSL errors:
IMAP_TLS setting to server requirements (true for SSL, false for STARTTLS)IMAP_REJECT_UNAUTHORIZED=falseEmpty results:
list-mailboxesGenerated Feb 27, 2026
Automatically checks a shared support inbox for new customer inquiries every 15 minutes, fetches unread emails, and routes them to a ticketing system or notifies agents via Slack. This ensures timely responses and reduces manual inbox monitoring.
Generates a daily summary of unread emails for executives by checking overnight messages, filtering by priority senders or keywords, and delivering a concise report via email or messaging app. This saves time and highlights critical communications.
Monitors email responses to marketing campaigns by searching for replies or unsubscribes from specific senders within the last 24 hours, then updates CRM records and triggers follow-up actions. This automates lead nurturing and engagement analysis.
Scans a dedicated IT alert inbox for system notifications or error reports from automated tools, fetches new emails hourly, and forwards urgent issues to on-call teams via SMS or pager. This improves incident response times.
Checks for new project inquiries or contract updates from clients daily, searches by sender or recent time frames, and organizes emails into a task list for follow-up. This helps freelancers manage multiple clients efficiently.
Offer a SaaS platform where businesses pay a monthly fee to automate email monitoring tasks, such as support ticket creation or executive summaries, using this skill integrated with custom workflows. Revenue comes from tiered subscriptions based on usage volume.
Provide consulting services to help companies set up and customize this skill for their specific needs, such as integrating with existing CRM or messaging systems, with one-time setup fees and ongoing support contracts. Revenue is generated from project-based fees and retainer agreements.
License this skill as a white-label solution to other software vendors or agencies, allowing them to rebrand it as part of their own email management products. Revenue comes from licensing fees and potential revenue-sharing agreements.
💬 Integration Tip
Use the cron integration feature to schedule regular email checks, and ensure the .env file is securely configured with IMAP credentials to avoid exposure.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
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.
Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
Automatically logs into email accounts (Gmail, Outlook, QQ Mail, etc.) and generates daily email summaries. Use when the user wants to get a summary of their emails, check important messages, or create daily email digests.
Fetch content from Feishu (Lark) Wiki, Docs, Sheets, and Bitable. Automatically resolves Wiki URLs to real entities and converts content to Markdown.
Manage Feishu (Lark) calendars by listing, searching, checking schedules, syncing events, and marking tasks with automated date extraction.