jncraton / gclean

Reduces size of email messages hosted by Gmail

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gclean

Strips the size of Gmail messages by removing attachements and/or converting messages to plain text. Behavior is controlled by assigning labels to messages.

Note that this process is not lossless. Data is permanently removed in order to simplify messages for both storage and export. This can be used retain message contents using less space and speed up the process of backing up a Gmail account.

I offer no guarantees that this won't destroy your data. Use at your own risk.

Usage

  1. Create config.py (see config.example.py)
  2. Disable IMAP access for every label except "All Mail". Note that this program can't work on messages currently in your inbox, so get to inbox zero before running this. If IMAP access isn't disabled, emails can't be properly replaced due to them still existing in an accessible folder.
  3. Set labels on messages to be cleaned
    • _clean - remove html blocks and eliminate many headers
    • _zero_att - same as _clean but also removes attachements and converts message to text/plain if it was multipart
  4. python gclean.py

About

Reduces size of email messages hosted by Gmail

License:MIT License


Languages

Language:Python 100.0%