My inbox is FULL. Not in the sense of storage capacity but my mental capacity. Email is here to stay and i have chose not to commit to a zero inbox game. So this is my attempt to using some code to analyze and clean up existing messages. Let's get some control back.


TLDR; the who_has_email_the_most script loops through 11 times by 30 days in an inbox using an IMAP protocol. Builds a "top FROM" emails then displays it. The mark_for_deletions script handles removing a single from email address at a time.


Mostly newsletters, some transactional. Having a time-to-live on some of these emails would make sense. That's not a feature i'm aware of so lets just do some data deletion. EDIT: there is a feature called Sweep in that does this.

[('', 290),
 ('', 218),
 ('', 215),
 ('', 211),
 ('', 207),
 ('', 195),
 ('', 179),
 ('', 178),
 ('', 159),
 ('', 157),
 ('', 151),
 ('', 149),
 ('', 122),
 ('', 114),
 ('', 112),
 ('REDACTED02@REDACTED02', 106),
 ('', 101),
 ('', 95),
 ('', 95),
 ('', 93)]


  • Unsubscribe from the top offenders
  • Using a script, delete the top offending emails.
  • Created some rules to archive emails via the web portal.
  • Run the script top offenders monthly to evaluate who is wasting my time the most


A bit of house cleaning will keep some sanity in my inbox. With the addition of automation, it should get better over time.