Cannot use offlineimap with gmail

Everything about X, Gnome, KDE, ... and everything running on it

Cannot use offlineimap with gmail

Postby anmys » 2017-04-29 04:03

I am trying to use offlineimap but keep getting this error message:
Code: Select all
$ offlineimap
OfflineIMAP 7.0.12
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
Account sync xx@yy:
 *** Processing account xx@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@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:
Code: Select all
[general]
accounts = xx
maxconnections = 8

[Account xx@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@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.
anmys
 
Posts: 10
Joined: 2011-11-30 05:06

Re: Cannot use offlineimap with gmail

Postby dasein » 2017-04-29 10:39

anmys wrote:Any pointers would be helpful.

A Google search for the error message "You must configure at least something, otherwise having SSL helps nothing" (including the quotes) returns multiple hits, including posts @ superuser and stackexchange, as well as a thread in the Debian mail list archive.

So my question to you is this: which of these existing solutions to your problem have you already tried? There's no point in folks here suggesting something that you've already discovered doesn't work.

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

See, now this makes me think you're just trying stuff at random. Gmail doesn't allow unencrypted connections, and they haven't for several years.

Speaking of existing solutions, I noticed that the renowned and revered Arch Wiki has a long and quite detailed-looking page regarding offlineimap. Have you read that entry thoroughly enough to be certain that the answer you're looking for isn't there?

For that matter, since your question really has nothing to do with Debian and everything to do with offlineimap, have you tried asking the folks who actually know something about offlineimap? Their Web site claims that they have some sort of chat support available.
User avatar
dasein
 
Posts: 7775
Joined: 2011-03-04 01:06
Location: Terra Incantationum


Re: Cannot use offlineimap with gmail

Postby Treehugger » 2018-07-27 19:50

Just upgraded to 9.5 and spent two hours with finding an answer how to get this security feature to work:
Code: Select all
sslcacertfile = /etc/ssl/certs/ca-certificates.crt


in the [remote] section worked for me. I'm not using gmail, though.

Credits: https://superuser.com/questions/927632/configuring-offlineimap-for-gmail-ssl-error

I found the previous answers so dissatisfying that I felt the urge to register here to post this. Looking for this discussion, I just stumbled over this post
http://forums.debian.net/viewtopic.php?f=5&t=138091&p=677250&hilit=offlineimap#p677250

recommending isync (mbsync) as offlineimap replacement as offlineimap may be discontinued.
Treehugger
 
Posts: 6
Joined: 2018-07-27 19:09


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable