Excel export for IT admins
Migration and offboarding need facts: size, count, last activity and forwarding rules. Guessing here breaks migrations. This page lists the exact columns, an example row and the command that produces it.
Columns to keep
| Column | Why it matters |
|---|---|
mailbox | Which mailbox the row belongs to; essential for audits. |
size | Mailbox size — the number that decides a migration approach. |
messages | Message count; keep it next to the row count as a completeness check. |
last_login | Last activity date — the offboarding signal. |
forwarding | Forwarding status; server rules are not visible over IMAP, so record what you verified. |
Example row
One real-shaped row from this role’s export:
| mailbox | size | messages | last_login | forwarding |
|---|---|---|---|---|
| sales@company.com | 12.4 GB | 48,210 | 2026-10-18 | external |
Export it in one command
python mail_to_excel.py \
--host imap.example.com --user you@example.com \
--days 31 --fields mailbox,size,messages,last_login,forwarding \
--out it-admin.xlsx
The --fields option is what turns a raw dump into a report your role can use.
Provider notes
Microsoft 365 tenants usually disable basic auth; plan OAuth (or an export from the admin center) before the run.
Two pitfalls that ruin the file
- The script is throttled after a few thousand messages — Add a small delay between fetches and use a date filter; providers throttle aggressive clients.
- Forwarding rules are invisible over IMAP — IMAP does not expose server rules — check them in the admin console.
Next step
Step-by-step: export it admin email to Excel · all roles · ready script ($3)
FAQ
Can I audit 200 mailboxes?
Yes, loop the script over a list and keep one row per mailbox; expect hours, not minutes.
Does this change mailbox state?
No — read-only mode is enforced by the script and should never be turned off for audits.
Is there a ready script for this?
Yes — the Python script exports any IMAP mailbox with the fields listed above; it costs $3 and runs locally.
Related guides
- Export it admin email to ExcelStep-by-step with the same columns and command.
- All roles20 professions, one export method.