I'm well aware of solutions like mail storm and all the other similar email cleaning solutions out there. These are SAAS tools with the free-trial then subscription-paid models that I'm not interested in. I'm more interested in a free or open-source tool even if a little complicated.

My current routine is to go through my emails, sort by unread find a bunch of unread ones that are sent by an advertiser, unsubscribe, then mass delete after filtering my inbox by this sender's email.

I am curious if someone made a lightweight simple tool that can filter emails by most received from X domain, or most repeated words in the subject and so on.

1 Answer 1


By using the standard Python libraries imaplib, email & counter you should, with a little work and learning, be able to get exactly what you need by adapting the information in the question at https://stackoverflow.com/questions/7314942/python-imaplib-to-get-gmail-inbox-subjects-titles-and-sender-name the question involves getting the 15 most recent email headers but it should be simple enough to adapt for things like:

  1. Counting mails by originator
  2. Counting mails by originator domain
  3. Counting mails by subject
  4. Counting mails by subject word
  5. etc.

So my suggested software is Python and a little work.

  • All free
  • Cross Platform
  • Flexible
  • Valuable learning

You might even be able to adapt it to categorise mail based on the above criteria and automatically bulk move it to deleted or junk.

  • -1 This is not a software recommendation, this is a library recommendation at most, while leaving the whole bunch of work of making the actual program to the OP. There is no indication that he wants or even knows how to develop a program.
    – Alejandro
    Commented Aug 11, 2022 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.