Before Emacs is involved, a bunch of applications have to be installed and configured. First, notmuch and gmailieer have to be installed.

These instructions are OS X+Macports specific, but hopefully they are easy to understand and adapt to other platforms. These instructions also assume you have python-3.6, virtualenv, and virtualenvwrapper installed and virtualenvwrapper has been sourced in your current shell (i.e. you are actually using virtualenvwrapper).

# Make sure notmuch is installed: sudo port install notmuch cat > ~/.notmuch-config <<EOF [database] path=~/Mail [user] name=John Borwick primary_email=john_borwick@pobox.com [new] tags=new ignore= [search] exclude_tags=deleted;spam; [maildir] synchronize_flags=true [crypto] gpg_path=gpg EOF # Create & then use virtualenv. (mkvirtualenv does this) mkvirtualenv --python=python3.6 gmailieer mkdir -p ~/build cd ~/build # install notmuch libraries. ideally this would be from the same # notmuch source as the above, but this works: git clone https://git.notmuchmail.org/git/notmuch cd notmuch/bindings/python python setup.py install # install gmailieer: cd ~/build git clone https://github.com/gauteh/gmailieer.git cd gmailieer python setup.py install # create notmuch database: mkdir ~/Mail cd ~/Mail notmuch new # ... ideally get a Google developer API certificate and call # gmi auth -c your-client-secrets.json gmi init # This changes gmi to pull the "promotions", "updates", etc tags: gmi set --ignore-tags-remote "" # This is the step that takes forever: gmi pull # make notmuch call gmi when 'notmuch new' is called: mkdir -p .notmuch/hooks cat > .notmuch/hooks/pre-new <<EOF #!/bin/sh source ~/.virtualenvs/gmailieer/bin/activate cd ~/Mail gmi sync EOF chmod +x .notmuch/hooks/pre-new