https://github.com/robcranfill/py-addr-extract
Extract email addresses from an inbox.
https://github.com/robcranfill/py-addr-extract
Last synced: 2 months ago
JSON representation
Extract email addresses from an inbox.
- Host: GitHub
- URL: https://github.com/robcranfill/py-addr-extract
- Owner: RobCranfill
- License: gpl-3.0
- Created: 2022-11-18T17:16:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-22T18:53:01.000Z (over 2 years ago)
- Last Synced: 2025-01-15T06:51:07.852Z (4 months ago)
- Language: Python
- Size: 470 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# py-addr-extract
Python program to extract email addresses from an online inbox and create a CSV file suitable for importing into Google Contacts.## Overview
This program will use IMAP to read the specified inbox (note: other Inboxes?) from your online email provider.
It will look at all "To:", "From:", and "CC:" headers, and create a CSV file containing each distinct name,
along with up to 4 associated email addresses. (note: this is a shortcoming of the GMail import format: a max
of 4 addresses are allowed. Workaround?)## Requirements
* Python 3.x
* Libraries (all standard libs)
* sys
* csv
* imaplib## Usage
There are 3 arguments to invoke this with:
* HOST Your email host name, like mail.gmail.com
* USER Your user name
* PASSWORD Your email passwordFor example,
`python3 extract.py imap.gmail.com [email protected] 16_char_app_pwd!`
## Limitations
* (MAJOR ISSUE) Does _not_ ignore case, so it will consider [email protected] and [email protected] to be different. A semi-easy
fix to the code would be to use some sort of case-insensitive dictionary.
* Only associates a maximum of 4 email addresses with a name. This is a limitation of the Google Contacts CSV format,
for which there is probably a work-around (create more than one entry and let Google Contacts 'merge' them?)