IMAP
by @ivangdavila
Read, search, and sync IMAP mailboxes with UID-safe fetches, precise filters, and attachment-aware workflows.
clawhub install imapπ About This Skill
name: IMAP slug: imap version: 1.0.0 homepage: https://clawic.com/skills/imap description: "Read, search, and sync IMAP mailboxes with UID-safe fetches, precise filters, and attachment-aware workflows." changelog: "Built a deeper IMAP workflow for reliable mailbox review, incremental sync, safer flag handling, and attachment triage." metadata: {"clawdbot":{"emoji":"π¬","requires":{"bins":[]},"os":["linux","darwin","win32"]}}
When to Use
Use this skill when the user needs to inspect or operate an IMAP mailbox across Gmail, Fastmail, ProtonMail Bridge, Exchange-compatible gateways, or self-hosted mail servers.
Activate it for inbox search, unread triage, header and body fetches, attachment handling, folder mapping, or incremental mailbox sync when correctness matters more than quick ad hoc scraping.
Architecture
Memory lives in ~/imap/. If ~/imap/ does not exist, run setup.md. See memory-template.md for the default structure and file templates.
~/imap/
βββ memory.md # activation defaults, mutation policy, preferred reporting style
βββ accounts.md # mailbox-specific endpoints, auth notes, and server capabilities
βββ folder-map.md # canonical folder mapping and provider quirks
βββ sync-state.md # UIDVALIDITY, last UID, MODSEQ, and sync checkpoints
βββ playbooks.md # saved mailbox workflows and reusable search recipes
Quick Reference
Use these files when the current mailbox task needs more detail than the core rules provide.
| Topic | File |
|-------|------|
| Setup and activation defaults | setup.md |
| Memory and file templates | memory-template.md |
| Session planning and discovery | session-strategy.md |
| Search and fetch patterns | search-and-fetch.md |
| State, flags, and sync rules | state-and-flags.md |
| Attachment and MIME handling | attachments.md |
| Failure diagnosis and provider quirks | troubleshooting.md |
Core Rules
1. Discover mailbox capabilities before making assumptions
UIDPLUS, CONDSTORE, QRESYNC, MOVE, or XLIST replacements.2. Default to read-safe operations unless the user clearly wants mutation
EXAMINE, header fetches, and targeted body retrieval.3. Use UIDs and durable sync markers, not volatile sequence numbers
UIDVALIDITY, last processed UID, and when available HIGHESTMODSEQ or related sync checkpoints in ~/imap/sync-state.md.UIDVALIDITY changes, treat prior cursors as invalid and rescan instead of trusting stale state.4. Fetch the minimum data that answers the question
5. Search with explicit server-side filters and report what they mean
6. Treat MIME and attachments as structured data, not opaque blobs
BODYSTRUCTURE or equivalent metadata before assuming where text lives or which parts are attachments.7. Keep credentials out of skill memory and scope network use tightly
~/imap/.IMAP Traps
UIDVALIDITY resets -> incremental sync silently skips or duplicates messages.MOVE, IDLE, or Gmail-style special folders -> commands fail or behave differently across providers.External Endpoints
| Endpoint | Data Sent | Purpose | |----------|-----------|---------| | User-configured IMAP or IMAPS server | authentication material handled by the runtime, mailbox commands, requested headers, bodies, flags, and attachments | list folders, search messages, fetch content, and update mailbox state when approved |
No other data is sent externally.
Security & Privacy
Data that stays local:
~/imap/Data that leaves your machine:
This skill does NOT:
~/imap/Trust
By using this skill, data is exchanged with the user-configured mail provider or IMAP bridge. Only use it with mailbox systems and local credential flows the user already trusts.
Related Skills
Install withclawhub install if user confirms:
api - use when the mailbox task is really an API integration or authenticated service wrapper problem.http - use when the work is request shaping, header debugging, or protocol inspection outside an IMAP session.json - use when mailbox results need structured transformation, normalization, or downstream machine-readable output.code - use when the user needs a full implementation, parser, or sync worker built and verified end to end.bash - use for shell-first mailbox tooling, local automation, and repeatable command wrappers.Feedback
clawhub star imapclawhub sync