Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
- A Gmail or Google Apps mail account (or see below)
- Python 2.5 or later
Get the latest code from GitHub:
git clone https://github.com/mihaip/mail-trends.git
You will also need Cheetah (a template system) installed. You can download it and then follow the installation instructions. If you are using an apt-based Linux distribution
sudo apt-get install python-cheetah may be enough for you.
Go into the
Run the program, replacing the username and passwords as appropriate (if you omit the password in the commandline you will be (securely) prompted for it):
python main.py \ --server=imap.gmail.com \ --use_ssl \ --email@example.com \ --firstname.lastname@example.org,email@example.com \ --skip_labels
You will be prompted for the password for your account (you can also use
--password= to specify it as an argument. The
--me argument lets you specify what emails should be considered as being sent to/from you.
The output is in HTML, placed in
out/index.html. Open that in your favorite web browser.
--skip_labels does not categorize messages into labels (there are not stats that use them yet).
--filter_out=... can be used to ignore certain messages. You can use
list:listid.example.com to filter out by recipient, sender or list (you can have multiple filter clauses by separating them with commas).
You can pass in
--replay as command line arguments to respectively capture and play black message fetches from the IMAP server. This is meant to aid in development by speeding up data fetches.
--max_messages=NNNN can be used to limit the number of messages that are fetched. Normally the most recent messages are selected, use
--random_subset to specify that the messages be chosen over all the messages.
Personal IMAP server
If you are using your personal IMAP server, adjust the commandline options appropriately and edit the
MAILBOX_GMAIL_PREFIX appropriately (e.g.
/, depends on your folder setup).
Running on more than about 25k messages may hit a recursion limit in jwzthreading.py - try reducing the number of messages.