Skip to main content
  1. Projects/

Rescuing 20 Years of Photos from Email

·291 words·2 mins
Author
Oscar Gala
I like making things with code, tinkering with infrastructure, and writing about what I learn along the way.

Back in the day, one of the primary ways to share photos was by email. I kept most of my emails over the past 20 years. As I was setting up my local Immich photo storage, I knew I had to have a bunch of photos trapped in those 20 years of emails.

I used Claude code to come up with a plan. First problem: I use Proton for my email and they are pretty well protected. But Claude knew of a service I could run inside a docker image to download my emails locally and then it could create a Python script to scan the emails for images. It took about 14 hours to download all the emails.

The Python script ran and grabbed about 16,000 images. A lot of those were those small images which are part of email signatures. And a lot of duplicates of those. Time to filter out all the useless images. First step was to delete all images below 60kb. That removed about 10,000. Then Claude knew a couple of scripts we could run to remove duplicates based on size and color patterns. That removed a bunch. Next up: There were over a thousand of screenshots in there which I had sent back and forth for work during my career. Removed those based on screen resolution. Final step was to browse through them manually.

After all the filtering, I ended up with roughly 700 real photos that I’d basically lost track of. Pictures of the kids, old trips, stuff I hadn’t seen in years.

They all live in our Immich library now, right alongside everything else. It felt like finding a box of old prints in the attic, except the attic was my email archive.