GithubHelp home page GithubHelp logo

karteum / gmvaultdb Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 72 KB

Store emails from a GMvault backup into an sqlite DB and extracts attachments in a dedicated folder

License: GNU General Public License v3.0

Python 100.00%

gmvaultdb's Introduction

gmvaultdb

Store emails from a GMvault backup into an sqlite DB and extracts attachments in a dedicated folder

GMvault is a great tool to backup a gmail account (N.B. in my case, I archived the whole dir in squashfs-lzma so I left the eml uncompressed rather than eml.gz).

This program is an attempt to extract data from such a gmvault backup and/or from a Google Takeout mbox file. In particular

  • walks through a db/ folder from a GMvault backup (assuming .eml are not gzipped, but support for eml.gz should be easy to add)
  • parses the .meta and .eml files, the latter can be MIME with various encoding, attachments, etc.
  • stores the emails (header, txt, html, signatures) in an SQLite database. For HTML, the attached images are extracted and inserted as base64 embedded images within the html in order to avoid keeping a separate file
  • extracts the other attached files to a dedicated folder (so all the attached files can be accessed directly through the filesystem). If the same file (same name, same md5) has already been extracted, it will not be stored twice. If a file with similar name but different md5 has already been extracted, it will be stored with a different name
  • adds a small GUI to walk through the emails and add additional "where" conditions to the SQL query (for the moment it works with plain sqlite including "like" clauses. In the future I will test SQLite's full-text search features)

Usage

  • gmvaultdb createdb gmvault_backup_dir out_dir : scans gmvault_backup_dir, and extracts emails (html+text+images) in mails.db and other attachments directly as files in subdirs
  • gmvaultdb mbox mboxfile out_dir : same as createdb but with an mbox file (e.g. from Google Takeout) instead of gmvault backup. N.B. note that Google performs some encoding conversions that permanently break all non-ascii characters (they are all replaced by 0xEFBFBD, therefore encoding display issues are not a bug in this script but a prior issue from Google Takeout that cannot be solved here)
  • gmvaultdb gui db_file : gui (in pyside/qt5) to navigate/search through mails.db and make SQL queries

gmvaultdb's People

Contributors

karteum avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.