Linux

Purgatorius: The Open Source App That Helps You Clean Up Gmail

Is your Google storage almost full and you don’t know where to start cleaning things up? Purgatorius should help! This open source application turns your Gmail inbox into an interactive map so you can spot what is taking up space at a glance.

As a reminder, the 15 GB included with a free Google account is shared between Gmail, Google Drive and Google Photos. When the meter reaches its limit, Gmail no longer lets you send or receive emails. You then have two options: pay for more storage, or do some cleanup. Here, we’ll focus on the second option.

Gmail does offer search operators such as larger:10M (email larger than 10 MB) or older_than:2y (emails older than 2 years), but you still need to know what to look for. After ten years of notifications and all kinds of emails, the real question is what should be deleted. That is exactly the problem Purgatorius aims to solve. The project is developed by Benoît Desnos, it is free and distributed under the AGPL-3.0 license on the Purgatorius GitHub repository.

A map of your Gmail inbox, block by block

Purgatorius displays your mailbox as a treemap: each block represents a domain, a sender, or a time period, and its surface is proportional to its size. A double-click lets you zoom into a block to go one level deeper: you can see what is inside. The size of the blocks can reflect (depending on the chosen configuration):

  • Size : the surface corresponds to the volume of messages.
  • Count : the surface corresponds to the number of messages.

You can also choose grouping criteria: domain, sender, recipient, subject, received or sent messages, year, month, and size range (from less than 100 KB to more than 10 MB), and more. In addition, a filter can isolate read or unread messages. The side panel provides details about the selected block: volume, year-by-year breakdown, top senders, and attachment size by type. Multiple accounts can be added, and they appear in the "Accounts" section on the left.

Below is an example taken from the Purgatorius GitHub repository. I tested it on my Gmail account, and it is honestly very practical. I should say I’m a fan of this kind of tool with WinDirStat-style visualizations, so it could only win me over!

Interface of Purgatorius: a Gmail inbox represented as a treemap by domain, with details for the selected domain
Source : Purgatorius

If you want to delete a selection, just click the "Send to Purgatory" button. Nothing is deleted directly: you send blocks or messages to the « Purgatoire », a waiting area whose gauges show the space freed up and the number of messages affected. Once your selection is confirmed, the only possible action is to move it to Gmail Trash, where messages remain recoverable for 30 days. So you stay in control.

How does the connection to the Gmail account work?

Purgatorius connects to Gmail over IMAP using an app password, which means two-step verification must be enabled on the Google account. On a Google Workspace account, IMAP access must also be authorized by the administrator. OAuth authentication is planned for a future version.

I recommend creating an app password, doing the cleanup, and then deleting it right away so your Gmail account is not exposed.

Here are also some useful details about how the application works:

  • Local data : the application keeps a SQLite cache of metadata only (sender, recipients, subject, date, size, labels, attachments), never the message body. The app password is stored in the system keychain, or on Linux without a keychain in a file readable only by you. No third-party server is involved.
  • Read-only : folders are opened in read-only mode and headers are read so that no unread message is marked as read. Before moving anything to Trash, each message is rechecked using its Gmail ID, and the operation is blocked if Purgatory has changed since it was displayed.
  • Unsigned binaries : the executables are neither signed nor notarized, so SmartScreen on Windows and Gatekeeper on macOS will block the first launch. That said, the tool is safe; this is a common issue with open source tools.

You can use it on a PC or Mac. Binaries are available for Windows (x86-64 and ARM64), macOS 13 and later (Intel and Apple Silicon), as well as Linux (x86-64 and ARM64).

What do you think?

author avatar
Florian Burnel Co-founder of IT-Connect
Systems and network engineer, co-founder of IT-Connect and Microsoft MVP "Cloud and Datacenter Management". I'd like to share my experience and discoveries through my articles. I'm a generalist with a particular interest in Microsoft solutions and scripting. Enjoy your reading.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.