A program with a user interface to delete spam emails in the inbox folder that match user defined conditions. Works on any email signed onto outlook. Please read README for further details.
############################# DESCRIPTION #############################
I made this program because I have emails filled with
ads and junk that got through my spam filter. It would take
too long to delete them all with the user interface on the web
or on the specific application so I decided to build a simple program
to delete emails that meet certain conditions such as specified date ranges,
subject, and/or sender. I am sharing it here
for others to use. If you decide to add on or modify this code
for yourself, all I ask is that you list me as a contributor or
provide some credit to me, thanks!
############################ PROJECT STATUS ############################
Status: Completed
*** This version soon to be deprecated. I am in the process of writing
and testing a new version with more features and a UI.
Future Goals: Create a simple UI aside from console
############################# HOW TO RUN #############################
0.) Download this repo to your computer
1.) Navigate to the folder containing this code
2.) Run the cmd: python email_cleanup.py
3.) Answer the prompts to inform the program
of which emails (by condition) should be
deleted.
*** PLEASE READ LIMITS Section
############################# REQUIREMENTS #############################
0.) System: Windows
1.) Python version : 3.6
2.) Third Party Python Modules: pywin32 (only works for windows systems)
> You can install it via pip
3.) Application: Microsoft Outlook
4.) Signed in to outlook with the email(s) of your choice
NOTE*** : I understand that the third party modules and windows requirement
does limit this program. I may work on future version that works
across all systems and uses built in libraries to minimize
the requirements to run it.
############################# LIMITS #################################
This program interacts with outlook, NOT the Server the emails are held on.
This means that it can only access emails currently loaded on to the app.
If you have a lot of emails, some may not be loaded up on the application
meaning that this program can not access them until they are loaded
on to the app. How do you know if you fit this case? If you are on outlook
and are using an outlook based email, in the inbox, scroll all the way down.
You will see a prompt stating: "There are more items in this folder on the server".
You can fix this by following the instructions below:
File-> Account Settings-> Account Settings...->
double click on your Exchange account-> set the Mail to keep offline slider to: All.
Note* if you have thousands of emails it may take some time and space(for example: 5000 emails
may result in around using 3 GB of data depending on content) to load
up all emails
After all of the data loads up on outlook, you will need to restart the computer
and rerun this program
############################# CONTRIBUTOR #############################
Designed, coded, and tested by Ramzi Reilly Adil
############################# EXTRA NOTES #############################
NOTES****
My testing showed that:
- Some emails do not contain a sentOn property or even a sender email address.
> These are usually associated with email notifications that an email was not delivered successfully
> There were also emails that had a "sender" but no associated emails (like some the no-reply emails)
- In these cases it is much better to delete those specific emails using subject keyword category.
- In the future I may decide to add an extra feature to delete all such emails.
> There were also emails that had a "sender" but no associated emails (like some no-reply emails)
- In these cases it is much better to delete those specific emails using the subject keyword category.
- In the future I may decide to add an extra feature to delete all such emails.
######################## UPDATE 10/30/2023 #############################
- I added a feature to delete by the name of the sender. The reason is that I noticed
when using this program that I get emails from the same organization (sender name) but coming from
slightly different email address. For example, I may get multiple emails where the sender name is
Indeed but the email addresses are [email protected] and [email protected]; these
addresses are made up, but the effect is the same. In response to this,
- I wanted to add a way to delete emails without having to select for all the different addresses.
- In the future I am thinking of making a version of this program that can analyze the amount of emails
sent by whom and the ability to delete by multiple email addresses/names as opposed to just one each time.
######################## UPDATE 12/19/2023 #############################
- I have been building a newer version of this program, so this program
will soon be deprecated. I will add a link to the new version once
I finish testing.
- Currently working on testing it right now
- The new version has more features like the email analysis I mentioned
in the 10/30/2023 update and a user interface.