Delete emails out of Gmail programatically.
  • PHP 81.9%
  • Dockerfile 14.8%
  • Shell 3.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2019-08-07 18:15:46 +02:00
bin Also flag as deleted 2019-08-07 15:17:06 +02:00
.dockerignore Cleanup 2019-08-07 14:23:26 +02:00
.gitignore Cleanup 2019-08-07 14:23:26 +02:00
.travis.yml Better documentation, move build config out into build.yml 2019-08-07 15:28:38 +02:00
_config.yml Set theme jekyll-theme-hacker 2019-08-07 15:29:05 +02:00
build.yml Better documentation, move build config out into build.yml 2019-08-07 15:28:38 +02:00
composer.json Email Deleter first commit 2019-08-07 13:58:19 +02:00
composer.lock Email Deleter first commit 2019-08-07 13:58:19 +02:00
docker-compose.yml Better documentation, move build config out into build.yml 2019-08-07 15:28:38 +02:00
Dockerfile Email Deleter first commit 2019-08-07 13:58:19 +02:00
email-deleter.runit Email Deleter first commit 2019-08-07 13:58:19 +02:00
LICENSE Initial commit 2019-08-07 14:26:59 +02:00
README.md Accidentally published credentials - Reset at Google and change in docs 2019-08-07 18:15:46 +02:00

Matt's Email Deleter

Build Status

What? Why?

So my 15 year old Gmail for Business account has about a trillion frigging emails in it that I don't care about any more.

And deleting 10k+ emails through the UI doesn't work.

So I'll delete 'em automatically over imap I guess?

Running it

docker run --rm \
    --env USERNAME=you@gmail.com \
    --env PASSWORD=changeme \
    --env IMAP_SERVER=imap.gmail.com \
    --env IMAP_PORT=993 \
    --env IMAP_FLAGS="/imap/ssl/novalidate-cert" \
    --env FROM_BEFORE="2016-12-31" \
    matthewbaggett/email-deleter \
    bin/email-deleter

or use the provided example docker-compose.yml

version: '2.4'
services:
  email-deleter:
    image: matthewbaggett/email-deleter
    environment:
      USERNAME: matthew@baggett.me
      PASSWORD: changeme
      IMAP_SERVER: imap.gmail.com
      IMAP_PORT: 993
      IMAP_FLAGS: "/imap/ssl/novalidate-cert"
      FROM_BEFORE: "2016-12-31"

Why novalidate-cert?

Because Google's Gmail product doesn't like PHP's ancient imap library's SSL gubbins and throws an error when we try to connect. Also because I'm a bad person and in this context I don't care.