--- name: imap-smtp-email description: 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 standard IMAP/SMTP server. metadata: openclaw: emoji: "📧" requires: env: - IMAP_HOST - IMAP_USER - IMAP_PASS - SMTP_HOST - SMTP_USER - SMTP_PASS bins: - node - npm primaryEnv: SMTP_PASS --- # IMAP/SMTP Email Tool Read, search, and manage email via IMAP protocol. Send email via SMTP. Works with any standard IMAP/SMTP server. ## Configuration Create `.env` in the skill folder or set environment variables: ```bash # IMAP Configuration (receiving email) IMAP_HOST=imap.gmail.com # Server hostname IMAP_PORT=993 # Server port IMAP_USER=your@email.com IMAP_PASS=your_password IMAP_TLS=true # Use TLS/SSL connection IMAP_REJECT_UNAUTHORIZED=true # Set to false for self-signed certs IMAP_MAILBOX=INBOX # Default mailbox # SMTP Configuration (sending email) SMTP_HOST=smtp.gmail.com # SMTP server hostname SMTP_PORT=587 # SMTP port (587 for STARTTLS, 465 for SSL) SMTP_SECURE=false # true for SSL (465), false for STARTTLS (587) SMTP_USER=your@gmail.com # Your email address SMTP_PASS=your_password # Your password or app password SMTP_FROM=your@gmail.com # Default sender email (optional) SMTP_REJECT_UNAUTHORIZED=true # Set to false for self-signed certs ``` ## Common Email Servers ### Global Providers | Provider | IMAP Host | IMAP Port | SMTP Host | SMTP Port | SMTP Secure | |----------|-----------|-----------|-----------|-----------|-------------| | Gmail | imap.gmail.com | 993 | smtp.gmail.com | 587 | false | | Outlook / Hotmail | outlook.office365.com | 993 | smtp.office365.com | 587 | false | | Yahoo Mail | imap.mail.yahoo.com | 993 | smtp.mail.yahoo.com | 465 | true | | iCloud Mail | imap.mail.me.com | 993 | smtp.mail.me.com | 587 | false | | Zoho Mail | imap.zoho.com | 993 | smtp.zoho.com | 465 | true | | Fastmail | imap.fastmail.com | 993 | smtp.fastmail.com | 465 | true | | AOL Mail | imap.aol.com | 993 | smtp.aol.com | 465 | true | | GMX Mail | imap.gmx.com | 993 | mail.gmx.com | 587 | false | | ProtonMail (Bridge) | 127.0.0.1 | 1143 | 127.0.0.1 | 1025 | false | ### Japan Providers (日本のメールサービス) | Provider | IMAP Host | IMAP Port | SMTP Host | SMTP Port | SMTP Secure | |----------|-----------|-----------|-----------|-----------|-------------| | Yahoo! JAPAN | imap.mail.yahoo.co.jp | 993 | smtp.mail.yahoo.co.jp | 465 | true | | OCN | imap.ocn.ne.jp | 993 | smtp.ocn.ne.jp | 465 | true | | BIGLOBE | mail.biglobe.ne.jp | 993 | mail.biglobe.ne.jp | 465 | true | | @nifty | imap.nifty.com | 993 | smtp.nifty.com | 587 | false | | plala | imap.plala.or.jp | 993 | secure.plala.or.jp | 465 | true | | So-net | imap.so-net.ne.jp | 993 | mail.so-net.ne.jp | 587 | false | | au Mail (@au.com) | imap.au.com | 993 | smtp.au.com | 465 | true | | Excite Mail | imap.excite.co.jp | 993 | smtp.excite.co.jp | 587 | false | | Infoseek Mail | imap.infoseek.jp | 993 | smtp.infoseek.jp | 587 | false | | SAKURA Internet | imap.sakura.ne.jp | 993 | smtp.sakura.ne.jp | 587 | false | ### China Providers (中国邮箱) | Provider | IMAP Host | IMAP Port | SMTP Host | SMTP Port | SMTP Secure | |----------|-----------|-----------|-----------|-----------|-------------| | 163.com | imap.163.com | 993 | smtp.163.com | 465 | true | | vip.163.com | imap.vip.163.com | 993 | smtp.vip.163.com | 465 | true | | 126.com | imap.126.com | 993 | smtp.126.com | 465 | true | | vip.126.com | imap.vip.126.com | 993 | smtp.vip.126.com | 465 | true | | 188.com | imap.188.com | 993 | smtp.188.com | 465 | true | | vip.188.com | imap.vip.188.com | 993 | smtp.vip.188.com | 465 | true | | yeah.net | imap.yeah.net | 993 | smtp.yeah.net | 465 | true | | QQ Mail | imap.qq.com | 993 | smtp.qq.com | 587 | false | ### Provider-specific Notes **Gmail:** - Does **not** accept regular account password - Must generate an **App Password**: https://myaccount.google.com/apppasswords - Requires Google Account with 2-Step Verification enabled **iCloud Mail:** - Requires an **App-Specific Password**: https://appleid.apple.com/account/manage - Enable "Access IMAP" in iCloud Mail settings **Yahoo! JAPAN (Yahoo! JAPANメール):** - Use **App Password** (アプリパスワード), not account password - Enable IMAP access in Yahoo! JAPAN Mail settings (設定 → IMAP/POP/SMTPアクセス) **163.com / 126.com / yeah.net:** - Use **authorization code** (授权码), not account password - Enable IMAP/SMTP in web settings first **OCN / BIGLOBE / @nifty / plala / So-net:** - Some ISPs require you to enable IMAP/SMTP access first from web settings - Use the mail password provided by the ISP (may differ from login password) ## IMAP Commands (Receiving Email) ### check Check for new/unread emails. ```bash node scripts/imap.js check [--limit 10] [--mailbox INBOX] [--recent 2h] ``` Options: - `--limit `: Max results (default: 10) - `--mailbox `: Mailbox to check (default: INBOX) - `--recent