Export Recruiter emails to Excel
Four steps, one command, and a completeness check at the end — for applications and CVs into a pipeline.
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 candidate,email,role,source,stage --out recruiter.xlsx
Step 2 — filter to one period
A month or a quarter, not «everything». Applications arrive faster than anyone updates the ATS. A weekly export keeps the pipeline honest.
Step 3 — keep only the columns that matter
| Column | Why it matters |
|---|---|
candidate | Display name for humans; deduplicate by email, not by name. |
email | Lowercase address — the true unique key for people. |
role | The position applied for; makes the pipeline filterable. |
source | Where the application came from (job board, referral, inbound). |
stage | Pipeline stage as a fixed vocabulary, not free text. |
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
| candidate | role | source | stage | |
|---|---|---|---|---|
| Maria Petrova | maria@example.com | Backend Engineer | screening |
Pitfalls
- CVs are saved as inline images instead of attachments — Check the message body for parts without a filename; log those rows for manual review.
- The same candidate appears under two roles — Deduplicate by email address, not by name.
Provider notes
Gmail app passwords need 2-step verification enabled. Recruiting agencies on Google Workspace should use OAuth.
FAQ
Can this feed an ATS?
Export CSV instead of Excel and map columns to your ATS import template.
Is candidate data safe?
The script runs locally and nothing is uploaded. Still treat the file as personal data and restrict access.
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
- Recruiter: columns and pitfallsThe compact overview for this role.
- Universal IMAP guideApp passwords, decoding and Excel output.