← Back to Skills Marketplace
wazixuan

Email IMAP/SMTP

by WaziXuan · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ Security Clean
284
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install email-imap-smtp
Description
Connect to mainstream email providers and perform reliable send/receive workflows through IMAP and SMTP with password or OAuth2 authentication. Use when a us...
README (SKILL.md)

Email IMAP/SMTP

Use this skill to automate email operations with standard IMAP/SMTP protocols using local scripts.

Workflow

  1. Confirm provider and auth mode (password or oauth2).
  2. Run connection checks first.
  3. List/search emails before reading full content.
  4. Send email only after previewing key fields (to/subject/body/attachments).

Security Rules

  • Prefer app passwords over account login passwords in password mode.
  • Prefer OAuth2 tokens for Gmail, Outlook, Yahoo, AOL, and Zoho.
  • Do not print secrets in terminal output.
  • Load credentials from environment variables whenever possible.
  • Avoid storing real credentials in repository files.

Required Inputs

  • Email address (login username)
  • Authentication:
    • Password mode: app password / authorization code
    • OAuth2 mode: access token, or refresh token + client info
  • IMAP host/port
  • SMTP host/port

Use references/provider-presets.md for common provider host/port defaults.

Script

Run:

python scripts/email_ops.py --help

Subcommands:

  • check: Verify IMAP/SMTP login connectivity.
  • list: List recent/unread email summaries.
  • read: Read one email by UID.
  • send: Send an email with optional HTML and attachments.
  • token: Resolve OAuth2 access token (masked output by default).
  • auth-url: Build OAuth2 browser login URL for authorization code flow.

Common Commands

Check mailbox connectivity:

python scripts/email_ops.py check --provider qq --email [email protected]

Check connectivity with OAuth2 (Gmail):

python scripts/email_ops.py check --provider gmail --email [email protected] --auth-mode oauth2 --access-token "\x3CACCESS_TOKEN>"

List unread emails:

python scripts/email_ops.py list --provider qq --email [email protected] --unseen --limit 20

Read one email:

python scripts/email_ops.py read --provider qq --email [email protected] --uid 12345

Send email:

python scripts/email_ops.py send --provider qq --email [email protected] --to [email protected] --subject "Test" --body "Hello from Codex"

Resolve a new OAuth2 token from refresh token:

python scripts/email_ops.py token --provider outlook --email [email protected] --auth-mode oauth2 --refresh-token "\x3CREFRESH_TOKEN>" --client-id "\x3CCLIENT_ID>" --client-secret "\x3CCLIENT_SECRET>"

Build OAuth2 authorization URL (Gmail example):

python scripts/email_ops.py --provider gmail --client-id "\x3CCLIENT_ID>" --redirect-uri "http://localhost:8080/callback" auth-url

Environment Variables

  • EMAIL_ADDRESS: Login email address.
  • EMAIL_PROVIDER: Provider preset key (for example qq, gmail, outlook, yahoo, aol, zoho, icloud).
  • EMAIL_AUTH_MODE: auto/password/oauth2.
  • EMAIL_APP_PASSWORD or EMAIL_PASSWORD: Password mode credential.
  • EMAIL_ACCESS_TOKEN: OAuth2 access token.
  • EMAIL_REFRESH_TOKEN: OAuth2 refresh token.
  • EMAIL_TOKEN_ENDPOINT: OAuth2 token endpoint.
  • EMAIL_AUTH_ENDPOINT: OAuth2 authorization endpoint.
  • EMAIL_CLIENT_ID: OAuth2 client id.
  • EMAIL_CLIENT_SECRET: OAuth2 client secret.
  • EMAIL_REDIRECT_URI: OAuth2 redirect URI for auth-url.
  • EMAIL_SCOPE: Optional scope for refresh request.
  • EMAIL_IMAP_HOST, EMAIL_IMAP_PORT: Override IMAP endpoint.
  • EMAIL_SMTP_HOST, EMAIL_SMTP_PORT: Override SMTP endpoint.
  • EMAIL_SMTP_SSL: true/false, default from provider preset.

Troubleshooting

  • Authentication failed in password mode: confirm app password and IMAP/SMTP permissions are enabled.
  • Authentication failed in OAuth2 mode: confirm token has IMAP/SMTP scopes and token endpoint/client info are correct.
  • SSL/TLS handshake failed: verify host/port pair and whether SMTP SSL is enabled.
  • Empty list results: switch mailbox folder (--mailbox) or remove filters.
Usage Guidance
This skill appears to be what it claims: a local Python tool for IMAP/SMTP with support for password or OAuth2. Before installing or running it: (1) review scripts/email_ops.py yourself (it will talk to mail servers and OAuth token endpoints); (2) provide only least-privilege credentials — prefer app passwords or an OAuth client with minimal scopes and a refresh token you can revoke; (3) do not paste production account passwords or long-lived secrets into public repos; (4) run in an environment you control (or use throwaway/test accounts) if you are unsure; and (5) note the registry metadata omission — the SKILL.md reads many EMAIL_* env vars, so expect to supply those when using the skill.
Capability Analysis
Type: OpenClaw Skill Name: email-imap-smtp Version: 0.1.0 The skill bundle provides a standard implementation for IMAP/SMTP email operations, including support for OAuth2 and common provider presets. The core logic in `scripts/email_ops.py` uses Python's standard libraries (imaplib, smtplib, urllib) to handle authentication and message processing, following security best practices such as masking tokens by default and preferring environment variables for secrets. No evidence of data exfiltration, malicious execution, or prompt injection was found.
Capability Assessment
Purpose & Capability
The name/description (IMAP/SMTP mailbox access) matches the included script and SKILL.md which require IMAP/SMTP host info and either password or OAuth2 credentials. One inconsistency: registry metadata lists no required env vars or primary credential, while SKILL.md and the script explicitly read many EMAIL_* environment variables (credentials and endpoints). This is likely an omission in registry metadata but worth noting.
Instruction Scope
SKILL.md confines actions to mailbox operations (connect, list/search/read/send, build auth URL, refresh token). It explicitly tells the agent to load credentials from env vars and avoid printing secrets. There are no instructions to read unrelated system files, other skills' configs, or to send data to arbitrary external hosts beyond standard OAuth/token endpoints and mail servers.
Install Mechanism
No install spec (instruction-only), and the included Python script runs locally. No downloads or external installers are involved, so installation risk is low. The presence of a code file is expected for this kind of skill.
Credentials
The skill requests many sensitive environment variables (email address, app password or client secret/refresh token/access token). Those are proportionate to performing IMAP/SMTP and OAuth flows. However, the registry metadata does not declare these env vars, creating a transparency gap the user should be aware of.
Persistence & Privilege
The skill is not forced-always and does not request system-wide config changes. It does not claim or appear to modify other skills or system-wide agent settings. Autonomous invocation is allowed (platform default) but not combined with other concerning privileges.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install email-imap-smtp
  3. After installation, invoke the skill by name or use /email-imap-smtp
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.0
Initial release: IMAP/SMTP email ops with password and OAuth2, plus auth-url support.
Metadata
Slug email-imap-smtp
Version 0.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Email IMAP/SMTP?

Connect to mainstream email providers and perform reliable send/receive workflows through IMAP and SMTP with password or OAuth2 authentication. Use when a us... It is an AI Agent Skill for Claude Code / OpenClaw, with 284 downloads so far.

How do I install Email IMAP/SMTP?

Run "/install email-imap-smtp" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Email IMAP/SMTP free?

Yes, Email IMAP/SMTP is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Email IMAP/SMTP support?

Email IMAP/SMTP is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Email IMAP/SMTP?

It is built and maintained by WaziXuan (@wazixuan); the current version is v0.1.0.

💬 Comments