Giter Club home page Giter Club logo

gmail-dump's Introduction

gmail-dump

Dump all Email from GMail via API (no IMAP). Very useful if your GMail administrator disabled IMAP for "security" reasons.

Setup & Run

  1. Clone this code, I tested it with Python 3
  2. Go to Google API Developer Console and create a set of client credentials enabled for the GMail API
  3. Download the credentials JSON and save as client_secrets.json
  4. Install Virtualenv
  5. Create virtualenv with virtualenv -p python3 venv
  6. Activate virtualenv with source venv/bin/activate
  7. Install Google API Client Libraries with pip install google-api-python-client
  8. Run code with python gmail-dump.py.

On first run your browser should open up and ask for your Google Authorization. It will then download all Email into the maildir folder mail.

You can use mutt like mutt -f mail to browse through the downloaded email.

On successive runs the script will only download new messages. Ideal for running as a nightly cron job.

Caveats

  • I use the message ID as file name for the mail files, it seems to work so far. Please report if you have a problem with that.
  • This script just dumps the bare email and completely ignores any labels. Pull requests are welcome.

gmail-dump's People

Contributors

schlomo avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

wprobot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.