41 lines
1.4 KiB
Markdown
41 lines
1.4 KiB
Markdown
# fastmail-receipts
|
|
|
|
Extracts receipt/purchase emails from Michael's Fastmail account via JMAP API.
|
|
Used for YNAB reconciliation.
|
|
|
|
## Quick start
|
|
|
|
python3 /data/tools/fastmail-receipts/receipts.py --days 30
|
|
python3 /data/tools/fastmail-receipts/receipts.py --days 30 --format csv
|
|
python3 /data/tools/fastmail-receipts/receipts.py --days 30 --format json
|
|
|
|
## Options
|
|
|
|
--days N Days back to search (default: 30)
|
|
--after YYYY-MM-DD Start date
|
|
--before YYYY-MM-DD End date (default: now)
|
|
--format summary | csv | json (default: summary)
|
|
--limit N Max emails per filter pass (default: 500)
|
|
--verbose Show JMAP debug on stderr
|
|
|
|
## Auth
|
|
|
|
API token in /data/tools/fastmail-receipts/.env (chmod 600, root only)
|
|
Token: fmu1-ad294022-... (see .env)
|
|
Fastmail JMAP account: uad294022
|
|
|
|
## Output fields (JSON)
|
|
|
|
date, time, vendor, from_name, from_email, subject, amount (best guess),
|
|
all_amounts (all found), preview, email_id
|
|
|
|
## Notes
|
|
|
|
- Apple receipts: HTML-only, amounts extracted from raw HTML
|
|
- Vanguard/SoFi entries are brokerage notifications, not purchase receipts
|
|
- Forwarded threads (Fwd:/Re:) can appear — filter by from_email if needed
|
|
- Duplicate shipping updates: deduplicate by vendor+amount+date window
|
|
- $ JMAP text search returns 0 (Fastmail doesn't index $) — keyword filters used instead
|
|
|
|
## Last tested: 2026-03-19 — 102 receipts in 30 days, 70 with amounts
|