This is an old revision of the document!
sudo apt-get install \ libencode-imaputf7-perl \ libfile-copy-recursive-perl \ libio-socket-inet6-perl \ libio-tee-perl \ libmail-imapclient-perl \ libunicode-string-perl \ libsys-meminfo-perl \ libregexp-common-perl \ libfile-tail-perl
apt-get install offlineimap
#!/bin/bash d="$HOME/Mail/gmail-oauth2-tools/python" clientid='<id>.apps.googleusercontent.com' clientsecret='<secrect>' ${d}/oauth2.py \ --generate_oauth2_token \ --client_id=${clientid} \ --client_secret=${clientsecret}
Also works with a google apps account with a custom domain.
[general] accounts = user@gmail.com [Account user@gmail.com] localrepository = user@gmail.com-local remoterepository = user@gmail.com-remote [Repository user@gmail.com-local] type = Maildir localfolders = ~/Mail/user@gmail.com [Repository user@gmail.com-remote] type = IMAP remotehost = imap.gmail.com remoteuser = user@gmail.com ssl = yes sslcacertfile = /etc/ssl/certs/ca-certificates.crt auth_mechanisms = XOAUTH2 oauth2_client_id = oauth2_client_secret = oauth2_access_token = oauth2_request_url = https://accounts.google.com/o/oauth2/token oauth2_refresh_token =
https://console.cloud.google.com/apis/api/gmail.googleapis.com/credentials