IMAP4 protocol error: <class 'TypeError'>
General informations
- system/distribution (with version): openSUSE Tumbleweed 20211029
- offlineimap version (
offlineimap -V): OfflineIMAP 7.3.4 - Python version: python38-3.8.12-2.1.x86_64
- server name or domain: imap.gmx.com
- CLI options: none
Configuration file offlineimaprc
[general]
accounts = gmx
[Account gmx]
localrepository = gmx-local
remoterepository = gmx-remote
[Repository gmx-local]
type = Maildir
localfolders = ~/.gmx/Mail
[Repository gmx-remote]
type = IMAP
#added for troubleshooting, didn't work with "yes" either
starttls = no
#added for troubleshooting
ssl = yes
remotehost = imap.gmx.com
remoteport = 993
remoteuser = [email protected]
#not sure why offlineimap wouldn't use the system ca certs, but I had to add this manually
sslcacertfile = ~/.gmx/global-root-ca-chain-demos-digicert-com.pem
#added for troubleshooting, tried various options here, no difference
auth_mechanisms = GSSAPI, XOAUTH2, CRAM-MD5, PLAIN, LOGIN
Logs, error
$ offlineimap -d imap
OfflineIMAP 7.3.4
Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
imaplib2 v2.101 (bundled), Python v3.8.12, OpenSSL 1.1.1l 24 Aug 2021
Debug mode: Forcing to singlethreaded.
Now debugging for imap: IMAP protocol debugging
Now debugging for : Other offlineimap related sync messages
Account sync gmx:
[imap]: Using authentication mechanisms ['GSSAPI', 'XOAUTH2', 'CRAM-MD5', 'PLAIN', 'LOGIN']
*** Processing account gmx
Establishing connection to imap.gmx.com:993 (gmx-remote)
[imap]: gmx-remote: level 'tls_compat', version 'None'
ERROR: While attempting to sync account 'gmx'
IMAP4 protocol error: program error: <class 'TypeError'> - cannot use a bytes pattern on a string-like object
[' File "/usr/local/lib/python3.8/site-packages/offlineimap/accounts.py", line 293, in syncrunner\n self.__sync()\n', ' File "/usr/local/lib/python3.8/site-packages/offlineimap/accounts.py", line 372, in __sync\n remoterepos.getfolders()\n', ' File "/usr/local/lib/python3.8/site-packages/offlineimap/repository/IMAP.py", line 452, in getfolders\n imapobj = self.imapserver.acquireconnection()\n', ' File "/usr/local/lib/python3.8/site-packages/offlineimap/imapserver.py", line 557, in acquireconnection\n imapobj = imaplibutil.WrappedIMAP4_SSL(\n', ' File "/usr/local/lib/python3.8/site-packages/offlineimap/imaplibutil.py", line 202, in __init__\n super(WrappedIMAP4_SSL, self).__init__(*args, **kwargs)\n', ' File "/usr/local/lib/python3.8/site-packages/offlineimap/bundled_imaplib2.py", line 2191, in __init__\n IMAP4.__init__(self, host, port, debug, debug_file, identifier, timeout, debug_buf_lvl)\n', ' File "/usr/local/lib/python3.8/site-packages/offlineimap/bundled_imaplib2.py", line 399, in __init__\n self.welcome = self._request_push(name=\'welcome\', tag=\'continuation\').get_response(\'IMAP4 protocol error: %s\')[1]\n', ' File "/usr/local/lib/python3.8/site-packages/offlineimap/bundled_imaplib2.py", line 200, in get_response\n raise typ(exc_fmt % str(val))\n']
*** Finished account 'gmx' in 0:00
ERROR: Exceptions occurred during the run!
ERROR: While attempting to sync account 'gmx'
IMAP4 protocol error: program error: <class 'TypeError'> - cannot use a bytes pattern on a string-like object
Traceback:
File "/usr/local/lib/python3.8/site-packages/offlineimap/accounts.py", line 293, in syncrunner
self.__sync()
File "/usr/local/lib/python3.8/site-packages/offlineimap/accounts.py", line 372, in __sync
remoterepos.getfolders()
File "/usr/local/lib/python3.8/site-packages/offlineimap/repository/IMAP.py", line 452, in getfolders
imapobj = self.imapserver.acquireconnection()
File "/usr/local/lib/python3.8/site-packages/offlineimap/imapserver.py", line 557, in acquireconnection
imapobj = imaplibutil.WrappedIMAP4_SSL(
File "/usr/local/lib/python3.8/site-packages/offlineimap/imaplibutil.py", line 202, in __init__
super(WrappedIMAP4_SSL, self).__init__(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/offlineimap/bundled_imaplib2.py", line 2191, in __init__
IMAP4.__init__(self, host, port, debug, debug_file, identifier, timeout, debug_buf_lvl)
File "/usr/local/lib/python3.8/site-packages/offlineimap/bundled_imaplib2.py", line 399, in __init__
self.welcome = self._request_push(name='welcome', tag='continuation').get_response('IMAP4 protocol error: %s')[1]
File "/usr/local/lib/python3.8/site-packages/offlineimap/bundled_imaplib2.py", line 200, in get_response
raise typ(exc_fmt % str(val))
Additional notes
- I currently have this account set up and working in claws. Setup was pretty straightforward. I've reviewed the configs, but I still may be overlooking something.
- GMX IMAP info: https://support.gmx.com/pop-imap/imap/server.html
This reports the same issue: https://github.com/OfflineIMAP/offlineimap/issues/472
This issue seems to be running the Py2 version of offlineimap in Py3. But I installed via pip3 install offlineimap, and it's explicitly calling Python 3.8:
$ head -1 /usr/local/bin/offlineimap
#!/usr/bin/python3.8
so not sure what's going on?
Hi @mrfuton
Please, could you try to run the version 8.0.0 and check if the problem already exists?
Thanks a lot, Best regards, kix
I had the exact same error and stack trace with OfflineIMAP 7.3.4. Then tried with 8.0.0 and it seems to be fixed.
Same for me.
I installed via
pip install -v git+https://github.com/offlineIMAP/[email protected]
and then it worked fine.