Email Triage
Triage inbox using mu (maildir-utils) via bash. Identify urgent items, archive noise.
Commands
# Sync email first (if stale)
mbsync -a
# Search recent emails (last 24 hours)
mu find date:1d.. --fields="d f s" -n 50
# Search unread
mu find flag:unread --fields="d f s"
# Search from specific sender
mu find from:alice --fields="d f s" -n 10
# Search by subject
mu find subject:urgent --fields="d f s"
# Read full email (use message path from mu find)
mu view /path/to/message
# JSON output for structured parsing
mu find date:1d.. --format=json -n 20
Process
- Sync:
mbsync -a(skip if recently synced) - Check unread:
mu find flag:unread --fields="d f s" -n 50 - Categorize each email:
- Urgent: deadline, “asap”, financial alerts
- Needs response: questions, personal emails
- FYI: notifications, receipts
- Marketing: newsletters, promotions
- Report summary to user
Query Examples
# Last 24 hours, unread only
mu find date:1d.. AND flag:unread
# Important senders
mu find from:boss@company.com OR from:wife@home.com
# With attachments
mu find flag:attach date:1w..
# Mailing lists (often noise)
mu find list:* date:1d..
# Exclude mailing lists
mu find date:1d.. AND NOT list:*
Field Codes
d= datef= froms= subjectt= tog= flags (U=unread, F=flagged, etc)l= path (needed formu view)
Example Session
User: check my email
Agent:
$ mu find flag:unread --fields="d f s" -n 30
Found 12 unread:
- 3 from mailing lists → FYI
- 2 from LinkedIn → marketing
- 1 from boss → URGENT (has "deadline")
- 2 from colleagues → needs response
- 4 receipts/notifications → FYI
Summary:
🔴 1 urgent: Boss re: Q4 deadline
💬 2 need response: Alice (project question), Bob (meeting)
📬 9 FYI/marketing (can ignore)
Tips
- Use
--format=jsonwhen you need to parse programmatically mu findis fast - search liberally- Path field (
l) needed to read full message withmu view