Cannot use offlineimap with gmail

Sridhar M A alaymari at gmail.com
Sat Apr 29 11:13:46 BST 2017


I am trying to use offlineimap but keep getting this error message:

$ offlineimap
OfflineIMAP 7.0.12
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
Account sync xx at yy:
 *** Processing account xx at yy
 Establishing connection to imap.gmail.com:993 (xx-remote)
 ERROR: No CA certificates and no server fingerprints configured.  You
must configure at least something, otherwise having SSL helps nothing.
 *** Finished account 'xx at yy' in 0:00
ERROR: Exceptions occurred during the run!
ERROR: No CA certificates and no server fingerprints configured.  You
must configure at least something, otherwise having SSL helps nothing.

Traceback:
  File "/usr/share/offlineimap/offlineimap/accounts.py", line 278, in syncrunner
    self.__sync()
  File "/usr/share/offlineimap/offlineimap/accounts.py", line 341, in __sync
    remoterepos.getfolders()
  File "/usr/share/offlineimap/offlineimap/repository/IMAP.py", line
452, in getfolders
    imapobj = self.imapserver.acquireconnection()
  File "/usr/share/offlineimap/offlineimap/imapserver.py", line 526,
in acquireconnection
    af=self.af,
  File "/usr/share/offlineimap/offlineimap/imaplibutil.py", line 194,
in __init__
    super(WrappedIMAP4_SSL, self).__init__(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/imaplib2.py", line 2135, in __init__
    IMAP4.__init__(self, host, port, debug, debug_file, identifier,
timeout, debug_buf_lvl)
  File "/usr/lib/python2.7/dist-packages/imaplib2.py", line 357, in __init__
    self.open(host, port)
  File "/usr/share/offlineimap/offlineimap/imaplibutil.py", line 201, in open
    "having SSL helps nothing.", OfflineImapError.ERROR.REPO)

Searching, found this to be a common issue. One of the posts (ubuntu I
guess) mentioned including a fingerprint in the rc file. My
offlinemaprc file looks like this:

[general]
accounts = xx
maxconnections = 8

[Account xx at yy]
localrepository = xx-local
remoterepository = xx-remote
postsynchook = notmuch new

[Repository xx-local]
type = Maildir
localfolders = ~/Mail/xx

[Repository xx-remote]
type = Gmail
remoteuser = xx at yy.zz
remotepass = secret
cert_fingerprint=f3043dd689a2e7dddfbef82703a6c65ea9b634c1
sslcacertfile = /etc/ssl/certs/ca-certificates.crt

No luck even after commenting the certificate line and/or fingerprint
line. I also tried setting ssl=no with the same result.

Any pointers would be helpful.

--
Sridhar M. A.




More information about the OfflineIMAP-project mailing list