8000 GitHub - gauteh/lieer at todo-label
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ lieer Public

Fast email-fetching, sending, and two-way tag synchronization between notmuch and GMail

License

Notifications You must be signed in to change notification settings

gauteh/lieer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gmailieer

This program can pull email and labels (and changes to labels) from your GMail account and store them locally in a maildir with the labels synchronized with a notmuch database. The changes to tags in the notmuch database may be pushed back remotely to your GMail account.

disclaimer

Gmailieer will not and can not:

  • Add or delete messages on your remote account (except syncing the trash or spam label to messages, and those messages will eventually be deleted)
  • Modify messages other than their labels

While Gmailieer has been used to successfully synchronize millions of messages and tags by now, it comes with NO WARRANTIES.

requirements

  • Python 3
  • tqdm
  • google_api_python_client (sometimes google-api-python-client)
  • oauth2client
  • notmuch python bindings: latest from git://notmuchmail.org/git/notmuch or >= 0.25 (when released)

installation

After cloning this repository, symlink gmi to somewhere on your path, or use python setup.py.

usage

This assumes your root mail folder is in ~/.mail, all commands should be run from the local mail repository unless otherwise specified.

  1. Make a directory for the gmailieer storage and state files
$ cd    ~/.mail
$ mkdir account.gmail
$ cd    account.gmail/
  1. Ignore the .json files in notmuch and use new for new tags. Set up a post-new hook as described to process mail and remove the new tag afterwards. The new tag is not synchronized with the remote by gmailieer.
[new]
tags=new
ignore=*.json;
  1. Initialize the mail storage:
$ gmi init your.email@gmail.com

gmi init will now open your browser and request limited access to your e-mail.

The access token is stored in .credentials.gmailieer.json in the local mail repository. If you wish, you can specify your own api key that should be used.

  1. You're now set up, and you can do the initial pull.

Use gmi -h or gmi command -h to get more usage information.

pull

will pull down all remote changes since last time, overwriting any local tag changes of the affected messages.

$ gmi pull

the first time you do this, or if a full synchronization is needed it will take longer.

push

will push up all changes since last push, conflicting changes will be ignored unless -f is specified. these will be overwritten with the remote changes at the next pull.

$ gmi push

normal synchronization routine

$ cd ~/.mail/account.gmail
$ gmi sync

This effectively does a push followed by a pull. Any conflicts detected with the remote in push will not be pushed. After the next pull has been run the conflicts should be resolved, overwriting the local changes with the remote changes. You can force the local changes to overwrite the remote changes by using push -f.

using your own API key

gmailieer ships with an API key that is shared openly, this key shares API quota, but cannot be used to access data unless access is gained to your private access_token or refresh_token.

You can get an api key for a CLI application to use for yourself. Store the client_secret.json file somewhere safe and specify it to gmi auth -c. You can do this on a repository that is already initialized.

caveats

  • The GMail API does not let you sync muted messages. Until this Google bug is fixed, the mute and muted tags are not synchronized with the remote.

  • The todo label seems to be reserved and will be ignored.

  • Only one of the tags inbox, spam, and trash may be added to an email. For the time being, trash will be prefered over spam, and spam over inbox.

About

Fast email-fetching, sending, and two-way tag synchronization between notmuch and GMail

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Languages

0