IMAP/SMTP Email Tool
Read, search, and manage email via IMAP protocol. Send email via SMTP.
Configuration
bash setup.sh
Config stored at ~/.config/imap-smtp-email/.env.
IMAP Commands (Receiving Email)
# Check unread emails
node scripts/imap.js check [--limit 10] [--recent 2h]
# Fetch full email by UID
node scripts/imap.js fetch <uid>
# Search emails
node scripts/imap.js search --unseen --recent 7d --limit 20
# Mark as read/unread
node scripts/imap.js mark-read <uid>
SMTP Commands (Sending Email)
# Send email
node scripts/smtp.js send --to recipient@example.com --subject "Subject" --body "Body"
# Send with attachment
node scripts/smtp.js send --to recipient@example.com --subject "Report" --body "See attached" --attach report.pdf
# Multiple recipients
node scripts/smtp.js send --to "a@example.com,b@example.com" --cc "c@example.com" --subject "Update" --body "Team update"
Security Notes
- Configuration stored at
~/.config/imap-smtp-email/.envwith600permissions - For Gmail: use App Password, not regular password
- For 163.com: use authorization code (授权码)