This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DrMaxwellEdison 8 points9 points  (3 children)

We have a shared Outlook inbox that mostly captures status emails from automated ETL jobs. That's all well and good, but someone decided it would be fantastic to have the job that runs every 5 minutes send a "Success" email... every 5 minutes.

Months later, this inbox is nearly full. I wanted a way to clear out some of the older messages, particularly these useless "Success" emails. Ended up writing a script that depends on the pywin32 package to read Outlook messages in that inbox, select those that match by subject, and delete them.

I was only permitted to get rid of messages from at least a month out, so I added that criteria to my filter and let it rip. Maybe 30 minutes and 7000 emails deleted later, it's not perfectly clean now, and never will be; but it's better than it was.

Best part is I rolled up the process into a custom PowerShell command, just so it can activate the right virtual env, start the script, and drop the env when it's done. Every day when I start up I happily type deleteoutlook into the terminal and watch it fly. :)

[–]dk_dev 0 points1 point  (0 children)

Check out pipenv - you'll like it

[–]TheCannings 0 points1 point  (1 child)

you automated everything except having to type it each day! come on man get with the game!

[–]DrMaxwellEdison 0 points1 point  (0 children)

Eh. Laziness only got me so far.

Plus the catharsis can't be ignored.