Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authentication failures with maxsyncaccounts = 3 #303

Closed
pschorf opened this issue Feb 9, 2016 · 14 comments
Closed

authentication failures with maxsyncaccounts = 3 #303

pschorf opened this issue Feb 9, 2016 · 14 comments

Comments

@pschorf
Copy link

pschorf commented Feb 9, 2016

I have a gmail account configured to authenticate via oauth. When I sync a large number of emails, it works fine for a time but eventually gets an invalid login (i'm assuming the token is timing out.)

Copy message 72650 (17684 of 74595) Remote:[Gmail]/All Mail -> Local
Copy message from Remote:[Gmail]/All Mail:
Establishing connection to imap.gmail.com:993
XOAUTH2 authentication failed: [AUTHENTICATIONFAILED] Invalid credentials (Failure)

@nicolas33 nicolas33 added the bug label Feb 9, 2016
@nicolas33
Copy link
Member

Coud you share your configuration file, version, etc, please?

@pschorf
Copy link
Author

pschorf commented Feb 9, 2016

Sorry :)
Version: 6.6.1 (from homebrew)
Config:

[general]
accounts = Gmail
maxsyncaccounts = 3

[Account Gmail]
localrepository = Local
remoterepository = Remote

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

[Repository Remote]
type = Gmail
remoteuser = EMAIL
oauth2_client_id = CLIENT_ID
oauth2_client_secret = CLIENT_SECRET
oauth2_refresh_token = REFRESH_TOKEN
realdelete = no
sslcacertfile = /Users/paul/ca-certificates.pem
maxconnections = 1

@nicolas33
Copy link
Member

@pschorf
Copy link
Author

pschorf commented Feb 10, 2016

Thanks, I'll give it a shot

@pschorf
Copy link
Author

pschorf commented Feb 10, 2016

Worked for me, thanks for the help.

@pschorf pschorf closed this as completed Feb 10, 2016
@nicolas33
Copy link
Member

I'm re-opening since the bug is real and valid. Thanks for your feedback that the workaround is working for you. ,-)

@nicolas33 nicolas33 reopened this Feb 10, 2016
@nicolas33 nicolas33 changed the title OAUTH timeout? authentication failures with maxsyncaccounts = 3 Feb 10, 2016
@nicolas33
Copy link
Member

Do you have other accounts to set maxsyncaccounts = 3?
Also, I'm curious to know if you can reproduce this error with v7.0.0 if you're willing to test.

@nicolas33
Copy link
Member

I'm not sure we should introduce a timer, here. Anyway, I'm closing until somebody hit this issue again and help us.

@rkrug
Copy link

rkrug commented Jul 29, 2016

Well - I can't connect at the moment (from today midday) to google anymore.

05:36:18 ~$ offlineimap
OfflineIMAP 7.0.2
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
Account sync iCloud:
 *** Processing account iCloud
Account sync Gmail:
 *** Processing account Gmail
Account sync iCloud:
 Establishing connection to imap.mail.me.com:993
Account sync Gmail:
 Establishing connection to imap.gmail.com:993
Account sync iCloud:
 Establishing connection to tunnel:/usr/local/opt/dovecot/libexec/dovecot/imap -o mail_location=maildir:$HOME/Maildir







 *** Finished account 'iCloud' in 0:02
 Next refresh in 2.0 minutes
Account sync Gmail:
 XOAUTH2 authentication failed: [AUTHENTICATIONFAILED] Invalid credentials (Failure)
 Establishing connection to tunnel:/usr/local/opt/dovecot/libexec/dovecot/imap -o mail_location=maildir:$HOME/Maildir






























 Calling hook: /usr/local/bin/notmuch new
^Cimap(rainerkrug): Info: Server shutting down. in=73 out=4614
imap(rainerkrug): Info: Server shutting down. in=85 out=4640
Terminating NOW (this may take a few seconds)...
 Hook stdout: Processed 7 total files in 3s (1 files/sec.).
No new mail.

I left the empty lines in - maybe they give an indication.

My config is as followed:

## see daomon mode info at [[https://wiki.archlinux.org/index.php/OfflineIMAP#Running_offlineimap_in_the_background]]

[general]
accounts = Gmail,iCloud
# maxsyncaccounts = 3
fsync = true
ignore-readonly = no
pythonfile = ~/.offlineimap.py

[Account Gmail]
localrepository  = LocalRMKrugGMAIL
remoterepository = RemoteRMKrugGMAIL
######
status_backend = sqlite
######
postsynchook = /usr/local/bin/notmuch new
######
autorefresh = 2
quick = 10
######


[Account iCloud]
localrepository =   LocaliCloud
remoterepository =  RemoteiCloud
######
status_backend = sqlite
######
autorefresh = 2
quick = 10
######


## %% GMAIL %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[Repository RemoteRMKrugGMAIL]
type = Gmail
sslcacertfile = /usr/local/etc/openssl/cert.pem
######
remoteuser = R.M.Krug@gmail.com
remotepasseval = get_keychain_pass(account="RMKrugGmailOfflineimap")
######
# maxconnections = 5
######
'[Gmail]/Trash']
/Spam','[Gmail/All Mail]','Lists']
######
nametrans = lambda foldername: 'RMKrugGMAIL.' + foldername
######
######
keepalive = 60
holdconnectionopen = yes
######

## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[Repository LocalRMKrugGMAIL]
type = IMAP
###### Use this {begin]
preauthtunnel = /usr/local/opt/dovecot/libexec/dovecot/imap -o mail_location=maildir:$HOME/Maildir
holdconnectionopen = yes
# maxconnections = 5
######
nametrans = lambda folder: re.sub('^RMKrugGMAIL.', '', folder)
######
folderfilter = lambda folder: folder.startswith('RMKrugGMAIL')
######
######
keepalive = 60
holdconnectionopen = yes
######


## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
## %% iCloud %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[Repository LocaliCloud]
type = IMAP
preauthtunnel = /usr/local/opt/dovecot/libexec/dovecot/imap -o mail_location=maildir:$HOME/Maildir
holdconnectionopen = yes
# maxconnections = 3
folderfilter = lambda folder: folder.startswith('iCloud')
nametrans = lambda folder: re.sub('^iCloud.', '', folder)
keepalive = 60
holdconnectionopen = yes

## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[Repository RemoteiCloud]
type = IMAP
remotehost = imap.mail.me.com
port = 993
ssl = yes
sslcacertfile = /usr/local/etc/openssl/cert.pem
remoteuser = r.m.k.13
remotepasseval = get_keychain_pass(account="rainer.friCloudOfflineimap")
# maxconnections = 3
nametrans = lambda foldername: 'iCloud.' + foldername
######
keepalive = 60
holdconnectionopen = yes
######

## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

@nicolas33
Copy link
Member

@rkrug Please, try current next branch. If it doesn't work, open a new issue.

@rkrug
Copy link

rkrug commented Jul 30, 2016

I am installing using homebrew and I installed HEAD. I assume, this is not the "next" branch. But I get there the following error:


09:48:28 ~$ offlineimap
OfflineIMAP 7.0.3
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
Account sync iCloud:
 *** Processing account iCloud
 Establishing connection to imap.mail.me.com:993 (RemoteiCloud)
Thread 'Account sync Gmail' terminated with exception:
Traceback (most recent call last):
  File "/usr/local/Cellar/offlineimap/HEAD-e460228/libexec/offlineimap/threadutil.py", line 163, in run
    Thread.run(self)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/Cellar/offlineimap/HEAD-e460228/libexec/offlineimap/accounts.py", line 256, in syncrunner
    self.remoterepos = Repository(self, 'remote')
  File "/usr/local/Cellar/offlineimap/HEAD-e460228/libexec/offlineimap/repository/__init__.py", line 84, in __new__
    return repo(name, account)
  File "/usr/local/Cellar/offlineimap/HEAD-e460228/libexec/offlineimap/repository/Gmail.py", line 39, in __init__
    IMAPRepository.__init__(self, reposname, account)
  File "/usr/local/Cellar/offlineimap/HEAD-e460228/libexec/offlineimap/repository/IMAP.py", line 41, in __init__
    self.imapserver = imapserver.IMAPServer(self)
  File "/usr/local/Cellar/offlineimap/HEAD-e460228/libexec/offlineimap/imapserver.py", line 96, in __init__
    None if self.preauth_tunnel else repos.gethost()
  File "/usr/local/Cellar/offlineimap/HEAD-e460228/libexec/offlineimap/repository/Gmail.py", line 48, in gethost
    return super(GmailRepository, self).gethost()
TypeError: super() argument 1 must be type, not classobj


Last 2 debug messages logged for Account sync Gmail prior to exception:
thread: Register new thread 'Account sync Gmail' (account 'Gmail')
imap: Using authentication mechanisms ['GSSAPI', 'XOAUTH2', 'CRAM-MD5', 'PLAIN', 'LOGIN']
09:48:43 ~$

Should I open a new issue with this?

@nicolas33
Copy link
Member

https://github.com/OfflineIMAP/offlineimap/archive/next.zip

And again, please open a new issue.

@rkrug
Copy link

rkrug commented Aug 2, 2016

I decided to run offlineimap on Linux where it is working fine.

@nicolas33
Copy link
Member

Ok, thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants