Email operations skill for sending, fetching, and reading emails via IMAP/SMTP. Uses curl with OpenSSL/LibreSSL for reliable TLS compatibility with Tencent Enterprise Mail and other providers. Credentials are securely stored in macOS Keychain.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o email.zip https://jpskill.com/download/16767.zip && unzip -o email.zip && rm email.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/16767.zip -OutFile "$d\email.zip"; Expand-Archive "$d\email.zip" -DestinationPath $d -Force; ri "$d\email.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
email.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
emailフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 7
📖 Claude が読む原文 SKILL.md(中身を展開)
この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。
Email Operations Skill
Overview
This skill provides email capabilities through direct IMAP/SMTP protocol access using curl. It supports:
- Sending emails via SMTP with TLS
- Fetching email lists via IMAP
- Reading email content by ID
- Multi-account support with secure credential storage
Architecture
- Protocol: Direct IMAP (port 993) and SMTP (port 465) over TLS
- Security: Passwords stored in macOS Keychain, never in config files
- Compatibility: Uses curl with OpenSSL/LibreSSL (better Tencent Enterprise Mail support than rustls)
- Configuration: YAML-based account management in
references/accounts.yaml
Available Scripts
1. Send Email (send-email.sh)
Send emails via SMTP with support for inline or file-based content.
Usage:
./scripts/send-email.sh -t recipient@example.com -s "Subject" -b "Message"
./scripts/send-email.sh -t recipient@example.com -s "Subject" -f message.txt
./scripts/send-email.sh -t recipient@example.com -c another@example.com -s "Subject" -b "Message"
Parameters:
-a ACCOUNT- Account name (default: from accounts.yaml)-t EMAIL- Recipient email (required)-c EMAIL- CC recipient (optional)-s TEXT- Email subject (required)-b TEXT- Email body inline (required if no -f)-f FILE- Email body from file (required if no -b)
2. Fetch Emails (fetch-emails.sh)
Retrieve email headers from a mailbox.
Usage:
./scripts/fetch-emails.sh # Fetch 10 latest from INBOX
./scripts/fetch-emails.sh -n 20 # Fetch 20 latest
./scripts/fetch-emails.sh -m "Sent" # Fetch from Sent folder
Parameters:
-a ACCOUNT- Account name (default: from accounts.yaml)-m FOLDER- Mailbox folder (default: INBOX)-n N- Number of emails to fetch (default: 10)
3. Read Email (read-email.sh)
Read full content of a specific email by ID.
Usage:
./scripts/read-email.sh 123 # Read full email
./scripts/read-email.sh -p HEADER 123 # Headers only
./scripts/read-email.sh -p BODY 123 # Body only
Parameters:
-a ACCOUNT- Account name (default: from accounts.yaml)-m FOLDER- Mailbox folder (default: INBOX)-p PART- Part to retrieve: HEADER, BODY, or TEXT (default: TEXT)EMAIL_ID- Email ID (required, positional argument)
Configuration
Account Setup
Edit references/accounts.yaml to add email accounts:
default_account: SUSTech
accounts:
SUSTech:
email: qihr2022@mail.sustech.edu.cn
display_name: Hanrui Qi
imap:
host: imap.exmail.qq.com
port: 993
login: qihr2022@mail.sustech.edu.cn
protocol: imaps
smtp:
host: smtp.exmail.qq.com
port: 465
login: qihr2022@mail.sustech.edu.cn
protocol: smtps
Password Management
Passwords are stored in macOS Keychain. Set them using:
# IMAP password
security add-generic-password \
-a "qihr2022@mail.sustech.edu.cn" \
-s "email-imap-sustech" \
-w "your-password" \
-U
# SMTP password
security add-generic-password \
-a "qihr2022@mail.sustech.edu.cn" \
-s "email-smtp-sustech" \
-w "your-password" \
-U
Keychain service naming convention:
- IMAP:
email-imap-{account_name_lowercase} - SMTP:
email-smtp-{account_name_lowercase}
Common Use Cases
1. Send a Quick Email
When user says: "Send an email to alice@example.com about the meeting"
cd /Users/seven/Claude/.claude/skills/email
./scripts/send-email.sh \
-t alice@example.com \
-s "Meeting Discussion" \
-b "Hi Alice, I wanted to follow up on our meeting..."
2. Check Recent Emails
When user says: "Check my email" or "Any new emails?"
cd /Users/seven/Claude/.claude/skills/email
./scripts/fetch-emails.sh -n 5
Parse the output and summarize for the user.
Search / Filter (Pipe + grep/rg)
This is a lightweight way to "search" within the recent emails that fetch-emails.sh fetched (headers only: From/Subject/Date).
cd /Users/seven/Claude/.claude/skills/email
# 任意关键字(例如 github),同时保留邮件 ID 行(便于后续 read)
./scripts/fetch-emails.sh -n 200 | rg -i "github" -B 2
# 主题关键字(建议用 rg;没有 rg 就用 grep -E)
./scripts/fetch-emails.sh -n 200 | rg "主题:.*会议" -B 2
./scripts/fetch-emails.sh -n 200 | grep -E "主题:.*会议" -B 2
# 发件人关键字
./scripts/fetch-emails.sh -n 200 | rg "发件人:.*alice" -B 1
# 提取匹配到的邮件 ID,然后读取正文(取第一个匹配)
email_id="$(
./scripts/fetch-emails.sh -n 200 |
rg -i "github" -B 2 |
sed -nE 's/.*邮件 #([0-9]+).*/\1/p' |
head -n 1
)"
./scripts/read-email.sh "$email_id"
If email_id is empty, increase -n (fetch more recent emails) or adjust the keyword/regex.
3. Read Specific Email
When user says: "Read email #3" or "Show me the latest email"
cd /Users/seven/Claude/.claude/skills/email
./scripts/read-email.sh 3
4. Email Automation
Combine with other skills for automation:
- Check calendar → Send reminder emails
- Monitor inbox → Create system notifications
- Fetch emails → Parse and extract information
Error Handling
Common Issues
-
Authentication Failed
- Verify Keychain passwords are set correctly
- Check if IMAP/SMTP is enabled in email provider settings
- For Tencent Enterprise Mail, use app-specific password
-
Connection Timeout
- Verify network connectivity
- Check firewall settings for ports 993 (IMAP) and 465 (SMTP)
- Confirm host and port in accounts.yaml
-
TLS Handshake Failed
- This skill uses curl with OpenSSL/LibreSSL for better compatibility
- If issues persist, check email provider's TLS requirements
Security Considerations
- Never log or display passwords - they're in Keychain only
- Confirm before sending - especially for important emails
- Validate recipients - check email addresses before sending
- Respect privacy - don't read emails unless explicitly requested
Provider-Specific Notes
Tencent Enterprise Mail (exmail.qq.com)
- IMAP: imap.exmail.qq.com:993 (SSL/TLS)
- SMTP: smtp.exmail.qq.com:465 (SSL/TLS)
- Requires IMAP/SMTP enabled in settings
- Recommend using app-specific password
- Note: IMAP
SEARCHfor string criteria (e.g.SUBJECT/FROM/HEADER) may be unreliable on some Tencent Exmail servers; prefer client-side filtering viafetch-emails.sh | rg/grep.
Gmail
- IMAP: imap.gmail.com:993
- SMTP: smtp.gmail.com:587 (STARTTLS)
- Requires "Less secure app access" or App Password
- May need OAuth2 for enhanced security
Outlook/Office 365
- IMAP: outlook.office365.com:993
- SMTP: smtp.office365.com:587
- Requires modern authentication
Technical Details
Why curl instead of rustls?
The rustls TLS library has compatibility issues with some email providers (notably Tencent Enterprise Mail). curl with OpenSSL/LibreSSL provides:
- Better TLS handshake compatibility
- Wider cipher suite support
- Proven reliability with enterprise email systems
IMAP vs POP3
This skill uses IMAP (not POP3) because:
- IMAP supports folder management
- Messages remain on server
- Better for multi-device access
- More flexible search and filtering
Future Enhancements
Potential improvements (not yet implemented):
- Server-side IMAP SEARCH (subject/sender/date; provider-dependent)
- Attachment handling
- HTML email composition
- Email filtering and rules
- OAuth2 authentication support
- Batch operations
References
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (8,617 bytes)
- 📎 references/accounts.yaml (963 bytes)
- 📎 scripts/common.sh (2,162 bytes)
- 📎 scripts/fetch-emails.sh (7,327 bytes)
- 📎 scripts/read-email.sh (14,202 bytes)
- 📎 scripts/search-mail.sh (381 bytes)
- 📎 scripts/send-email.sh (2,177 bytes)