Export Crypto ops emails to Excel
Four steps, one command, and a completeness check at the end — for exchange statements and support threads.
Step 1 — connect read-only
Use an app password, never the main password. The script opens the folder in read-only mode, so nothing is marked as read or deleted.
python mail_to_excel.py --host imap.example.com --user you@example.com --days 31 --fields exchange,txid,asset,amount,date --out crypto-ops.xlsx
Step 2 — filter to one period
A month or a quarter, not «everything». Exchange support threads and withdrawal confirmations are the only evidence when a transfer is disputed.
Step 3 — keep only the columns that matter
| Column | Why it matters |
|---|---|
exchange | Which exchange or wallet provider sent the message. |
txid | Full transaction id — truncated ids cannot be verified on-chain. |
asset | Ticker of the asset moved. |
amount | Store as a number with a separate currency column; never sum mixed currencies. |
date | Message date in ISO 8601; sortable and unambiguous across time zones. |
Step 4 — verify completeness
- Run the same search in your mail client and note the message count.
- Compare it with the row count in the spreadsheet.
- If the numbers differ, the filter or the folder is wrong — fix it before using the file.
Example output
| exchange | txid | asset | amount | date |
|---|---|---|---|---|
| Binance | 0x8f3a…c21d | USDT | 500.00 | 2026-10-15 |
Pitfalls
- Exchange emails land in Promotions and are missed — Create a filter for exchange domains and export that label, not the whole inbox.
- Transaction ids are truncated in the UI — Export the raw text and keep the full id; partial ids cannot be verified on-chain.
Provider notes
Proton Mail requires Proton Bridge for IMAP — without it there is no standard IMAP access.
FAQ
Can this be used for tax reporting?
It gives you the raw rows; tax calculation is a separate step and jurisdiction-specific.
Is it safe to keep txids in a spreadsheet?
Txids are public, but the mapping to your accounts is sensitive — store the file encrypted.
How many messages can it handle?
Thousands per run with a date filter; very large mailboxes are better exported month by month.
Will it change anything in the mailbox?
No. Read-only access is the default and should stay enabled.
Related guides
- Crypto ops: columns and pitfallsThe compact overview for this role.
- Universal IMAP guideApp passwords, decoding and Excel output.