"binascii.Error: Incorrect padding"

Nicolas Sebrecht nicolas.s-dev at laposte.net
Sun Feb 7 17:39:33 GMT 2016

On Sun, Feb 07, 2016 at 04:42:27PM +0000, ael wrote:

> $ offlineimap --info -a bt
> OfflineIMAP 6.6.1


>   File "/usr/share/offlineimap/offlineimap/imapserver.py", line 321, 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 2286, in process
>     ret = self.mech(self.decode(data))
>   File "/usr/lib/python2.7/dist-packages/imaplib2.py", line 2316, in decode
>     return binascii.a2b_base64(inp)
> binascii.Error: Incorrect padding
> ----------------------------------------------------------------------------
> Before I start digging further, is this a well-known problem?

Never seen this error before. It looks like it is trying to send data
that imaplib2 doesn't support.

Since this happen at authentication time, I'd first check the username
and password. Perhaps there's a non-supported (non-printable) character

Try to comment those options in the configuration file and fully re-type
those lines, regardless you recently opened this file.

What distribution so you use? I ask this because I've realized that some
like Debian and Ubuntu make changes on top of the vanilla sources. You
might like to rule out any bad change by trying with the official

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

Nicolas Sebrecht

More information about the OfflineIMAP-project mailing list