"binascii.Error: Incorrect padding"

Lele Gaifax lele at metapensiero.it
Thu Mar 24 11:45:19 GMT 2016

Nicolas Sebrecht <nicolas.s-dev at laposte.net> writes:

> If none fix it, try instering debug print statements to know more.


since a while, I'm experiencing the same problem. Given that v6.7.0 entered in
Debian sid today, I spent some time to understand what's going on. With the
aid of pdb, I see that the result of the AUTHENTICATE command is a plain

  $ offlineimap --info -a account
  OfflineIMAP 6.7.0
    Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
  Remote repository 'RemoteAccount': type 'IMAP'
  Host: mbox.xxx.yyy Port: None SSL: True
  Establishing connection to mbox.xxx.yyy:993
  > /usr/lib/python2.7/dist-packages/imaplib2.py(2287)process()
  -> ret = self.mech(self.decode(data))
  (Pdb) p data
  'go ahead'
  (Pdb) c
  Traceback (most recent call last):
    File "/usr/share/offlineimap/offlineimap/imapserver.py", line 335, in __authn_plain
      imapobj.authenticate('PLAIN', self.__plainhandler)
    File "/usr/lib/python2.7/dist-packages/imaplib2.py", line 705, in authenticate
      typ, dat = self._simple_command('AUTHENTICATE', mechanism.upper())
    File "/usr/lib/python2.7/dist-packages/imaplib2.py", line 1695, in _simple_command
      return self._command_complete(self._command(name, *args), kw)
    File "/usr/lib/python2.7/dist-packages/imaplib2.py", line 1421, in _command
      literal = literator(data, rqb)
    File "/usr/lib/python2.7/dist-packages/imaplib2.py", line 2287, in process
      ret = self.mech(self.decode(data))
    File "/usr/lib/python2.7/dist-packages/imaplib2.py", line 2317, in decode
      return binascii.a2b_base64(inp)
  binascii.Error: Incorrect padding

Does that suggest a possible fix or workaround?

Thanks in advance,
ciao, lele.
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele at metapensiero.it  |                 -- Fortunato Depero, 1929.

More information about the OfflineIMAP-project mailing list