mailctl
v1.1.0
Published
Lightweight CLI for IMAP/SMTP email operations
Readme
mailctl
Lightweight CLI for IMAP/SMTP email operations.
Setup
npm install
npm run build
npm link # optional, makes `mailctl` available globallyConfiguration
Create ~/.config/mailctl/.env:
IMAP_HOST=mail.example.com
IMAP_PORT=993
[email protected]
IMAP_PASS=password
IMAP_TLS=true
SMTP_HOST=mail.example.com
SMTP_PORT=587
[email protected]
SMTP_PASS=password
SMTP_TLS=true
MAIL_FROM="Display Name <[email protected]>"Usage
# List inbox
mailctl inbox
mailctl inbox --unread --since 1h --json
# Read email
mailctl read 12345
mailctl read 12345 --json --mark-read
# Send email
mailctl send --to [email protected] --subject "Hello" --body "Hi there"
echo "Body text" | mailctl send --to [email protected] --subject "Hello"
# Reply
mailctl reply 12345 --body "Thanks!"
mailctl reply 12345 --all --body "Noted"
# Poll for new messages
mailctl poll --since 5m --json
# List folders
mailctl folders
# Mark messages
mailctl mark 12345 --read
mailctl mark 12345 --flagged
# Search
mailctl search --from [email protected] --since 7d --json
# List attachments
mailctl attachments 12345
mailctl attachments 12345 --json
# Download attachments
mailctl download 12345 # download all attachments
mailctl download 12345 1.2 # download specific part
mailctl download 12345 --output /tmp --json