Error using Google two-factor authentication using mu4e & Gmail

I have been using the Google 2 answering machine for some time and have configured several applications. One of them is offlineimap (where I download mail), but when I use mu4e to create a message, I get the following error:

Sending failed: 534-5.7.9 Application-specific password required. 
Learn more at  534-5.7.9 
http://support.google.com/accounts/bin/answer.py?answer=185833

I have configured ~ / .authinfo.gpg (and it decrypts successfully manually), and my ~ / .offlineimaprc calls get_password_emacs (the example I used can be found here ).

I even tried to skip the gpg part to see if it works using my mu4e Google App Password directly in ~ / .offlineimaprc, but I get the same result.

My file is ~ / .authinfo.gpg: (decrypted here, confidential information deleted)

machine imap.gmail.com login me@gmail.com port 993 password GoogleAppPassword
machine smtp.gmail.com login me@gmail.com port 587 password GoogleAppPassword

My ~ / .offlineimaprc file:

[general]
accounts = Gmail
maxsyncaccounts = 3
pythonfile = ~/.offlineimap.py

[Account Gmail]
localrepository = Local
remoterepository = Remote

[Repository Local]
type = Maildir
localfolders = ~/Maildir

[Repository Remote]
remotehost = imap.gmail.com 
remoteuser = me@gmail.com 
remotepasseval = get_password_emacs("imap.gmail.com",  "me@gmail.com", "993")
ssl = yes
maxconnections = 1
realdelete = no
holdconnectionopen = true
keepalive = 60
type = IMAP

and my ~ / .offlineimap.py

#!/usr/bin/python
import re, os

def get_password_emacs(machine, login, port):
    s = "machine %s login %s port %s password ([^ ]*)\n" % (machine, login, port)
    p = re.compile(s)
    authinfo = os.popen("gpg -q --no-tty -d ~/.authinfo.gpg").read()
    return p.search(authinfo).group(1)

- , ? , ~/.authinfo.gpg Google Apps .

.

+4
1

mu4e Google App Password ~/.offlineimaprc

. . , , . , URL-:

https://security.google.com/settings/security/apppasswords

. , , , . , 2- .

+1

All Articles