OfflineIMAP / offlineimap

Read/sync your IMAP mailboxes (python2) [LEGACY: move to offlineimap3]
http://www.offlineimap.org
Other
1.78k stars 360 forks source link

Password printed when "All authentication types failed" #481

Open l2dy opened 7 years ago

l2dy commented 7 years ago

General informations

Configuration file offlineimaprc

[general]
pythonfile = ~/.offlineimap.py
accounts = Apple

[Account Apple]
localrepository = Local
remoterepository = Remote
proxy = SOCKS5:127.0.0.1:9050
autorefresh = 30
postsynchook = /opt/local/bin/notmuch new

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

[Repository Remote]
type = IMAP
remotehost = imap.mail.me.com
remoteuser = l2dy
remotepasseval = get_keychain_pass(account="l2dy", server="imap.mail.me.com")
ssl = yes
sslcacertfile = /opt/local/share/curl/curl-ca-bundle.crt
idlefolders = ['INBOX', 'Junk']

pythonfile (if any)

def get_keychain_pass(account=None, server=None):
...

Logs, error

Password replaced by **redacted**.

 *** Finished account 'Apple' in 0:23
 Next refresh in 30.0 minutes
Thread 'Folder Archives [acc: Apple]' terminated with exception:
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/offlineimap/threadutil.py", line 160, in run
    Thread.run(self)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/offlineimap/accounts.py", line 612, in syncfolder
    check_uid_validity()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/offlineimap/accounts.py", line 487, in check_uid_validity
    remotefolder.save_uidvalidity()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/offlineimap/folder/Base.py", line 261, in save_uidvalidity
    newval = self.get_uidvalidity()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/offlineimap/folder/IMAP.py", line 125, in get_uidvalidity
    imapobj = self.imapserver.acquireconnection()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/offlineimap/imapserver.py", line 558, in acquireconnection
    self.__authn_helper(imapobj)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/offlineimap/imapserver.py", line 431, in __authn_helper
    "failed:\n\t%s"% msg, OfflineImapError.ERROR.REPO)
OfflineImapError: All authentication types failed:
    PLAIN: AUTHENTICATE command error: BAD ['[UNAVAILABLE] Service temporarily unavailable']. Data: GGAE2 AUTHENTICATE PLAIN

    LOGIN: LOGIN command error: BAD ['[UNAVAILABLE] Service temporarily unavailable']. Data: GGAE5 LOGIN l2dy "**redacted**"

Last 8 debug messages logged for Folder Archives [acc: Apple] prior to exception:
thread: Register new thread 'Folder Archives [acc: Apple]' (account 'Apple')
imap: Remote: level 'tls_compat', version 'None'
imap: Attempting PLAIN authentication
imap: __plainhandler: returning l2dy(passwd hidden for log)
imap:   **:**.16 Folder Archives [acc: Apple] last 20 log messages:
imap: Attempting LOGIN authentication
imap: Attempting IMAP LOGIN authentication
imap:   **:**.72 Folder Archives [acc: Apple] last 20 log messages:

Reproduced in August:

OfflineImapError: All authentication types failed:
    PLAIN: AUTHENTICATE command error: BAD ['[UNAVAILABLE] Service temporarily unavailable']. Data: EJHL2 AUTHENTICATE PLAIN

    LOGIN: LOGIN command error: BAD ['[UNAVAILABLE] Service temporarily unavailable']. Data: EJHL5 LOGIN l2dy "**redacted**"

Steps to reproduce the error

nicolas33 commented 7 years ago

The server is returning the password in the IMAP response. We might like to regex the response...

roshhh commented 7 years ago

Did you manage to get this working?

nicolas33 commented 7 years ago

No. I'm welcoming patches. This should not be too hard to get this done, BTW.