Skip to content

Authentication fails while using Curses #49

@sudipm-mukherjee

Description

@sudipm-mukherjee

General informations

Configuration file offlineimaprc

I have asked for the offlineimaprc from the reporter.

Logs, error

2021-02-05 11:14:15 INFO: OfflineImap 7.3.0 starting...
  Python: 3.9.1 Platform: linux
  Args: /usr/bin/offlineimap -a Example -d ALL -l /tmp/offlineimap.log
2021-02-05 11:14:15 INFO: OfflineIMAP 7.3.0
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
2021-02-05 11:14:15 INFO: imaplib2 v3.05, Python v3.9.1+, OpenSSL 1.1.1i  8 Dec 2020
2021-02-05 11:14:15 DEBUG: Now debugging for imap: IMAP protocol debugging
2021-02-05 11:14:15 DEBUG: Now debugging for maildir: Maildir repository debugging
2021-02-05 11:14:15 DEBUG: Now debugging for thread: Threading debugging
2021-02-05 11:14:15 DEBUG: Now debugging for : Other offlineimap related sync messages
2021-02-05 11:14:15 DEBUG: [thread]: Register new thread 'Account sync Example' (account 'Example')
2021-02-05 11:14:15 DEBUG: [imap]: Using authentication mechanisms ['GSSAPI', 'XOAUTH2', 'CRAM-MD5', 'PLAIN', 'LOGIN']
2021-02-05 11:14:15 DEBUG: [maildir]: MaildirRepository initialized, sep is '.'
2021-02-05 11:14:15 INFO: *** Processing account Example
2021-02-05 11:14:15 INFO: Establishing connection to imap.example.net:993 (LPB-Remote)
2021-02-05 11:14:15 DEBUG: [imap]: LPB-Remote: level 'tls_compat', version 'None'
2021-02-05 11:14:15 DEBUG: [imap]:   14:15.82 Account sync Example imaplib2 version 3.05
2021-02-05 11:14:15 DEBUG: [imap]:   14:15.82 Account sync Example imaplib2 debug level 5, buffer level 3
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.05 Account sync Example connected to imap.example.net on port 993
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.05 imap.example.net writer starting
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.05 imap.example.net reader starting using poll
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.06 Account sync Example _request_push(continuation, welcome, {}) = b'CJOD0'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.06 Account sync Example welcome:b'CJOD0'.ready.wait
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.09 imap.example.net reader poll => [(5, 1)]
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.10 imap.example.net reader rcvd 18
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.10 imap.example.net reader < b'* OK IMAP4 ready\r\n'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.15 imap.example.net handler starting
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.16 imap.example.net handler _put_response(b'* OK IMAP4 ready')
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.16 imap.example.net handler untagged_responses[OK] 0 += ["b'IMAP4 ready'"]
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.16 imap.example.net handler _request_pop(continuation, (False, b'* OK IMAP4 ready')) [0] = b'CJOD0'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.16 imap.example.net handler welcome:b'CJOD0'.ready.set
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.16 Account sync Example _get_untagged_response(OK) => [b'IMAP4 ready']
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.16 Account sync Example state => NONAUTH
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.16 Account sync Example [async] CAPABILITY ()
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.16 Account sync Example state_change_pending.acquire
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.16 Account sync Example state_change_pending.release
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.16 imap.example.net handler state_change_free.set
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.16 Account sync Example _request_push(b'CJOD1', CAPABILITY, {}) = b'CJOD1'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.16 Account sync Example data=b'CJOD1 CAPABILITY'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.16 Account sync Example CAPABILITY:b'CJOD1'.ready.wait
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.16 imap.example.net writer > b'CJOD1 CAPABILITY\r\n'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.21 imap.example.net reader poll => [(5, 1)]
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.21 imap.example.net reader rcvd 63
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.21 imap.example.net reader < b'* CAPABILITY IMAP4rev1 UIDPLUS AUTH=PLAIN\r\n'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.21 imap.example.net reader < b'CJOD1 OK completed\r\n'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 imap.example.net handler _put_response(b'* CAPABILITY IMAP4rev1 UIDPLUS AUTH=PLAIN')
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 imap.example.net handler untagged_responses[CAPABILITY] 0 += ["b'IMAP4rev1 UIDPLUS AUTH=PLAIN'"]
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 imap.example.net handler _put_response(b'CJOD1 OK completed')
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 imap.example.net handler _request_pop(b'CJOD1', ('OK', [b'completed'])) [0] = b'CJOD1'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 imap.example.net handler CAPABILITY:b'CJOD1'.ready.set
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 Account sync Example _get_untagged_response(CAPABILITY) => [b'IMAP4rev1 UIDPLUS AUTH=PLAIN']
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 imap.example.net handler state_change_free.set
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 Account sync Example _untagged_response(OK, ?, CAPABILITY) => [b'IMAP4rev1 UIDPLUS AUTH=PLAIN']
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 Account sync Example CAPABILITY: ('IMAP4REV1', 'UIDPLUS', 'AUTH=PLAIN')
2021-02-05 11:14:16 DEBUG: [imap]: Attempting PLAIN authentication
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 Account sync Example [sync] AUTHENTICATE ('PLAIN',)
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 Account sync Example state_change_pending.acquire
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 Account sync Example _request_push(b'CJOD2', AUTHENTICATE, {}) = b'CJOD2'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 Account sync Example data=b'CJOD2 AUTHENTICATE PLAIN'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 Account sync Example _request_push(continuation, b'AUTHENTICATE', {}) = b'CJOD3'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 Account sync Example b'AUTHENTICATE':b'CJOD3'.ready.wait
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.22 imap.example.net writer > b'CJOD2 AUTHENTICATE PLAIN\r\n'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.27 imap.example.net reader poll => [(5, 1)]
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.27 imap.example.net reader rcvd 4
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.28 imap.example.net reader < b'+ \r\n'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.28 imap.example.net handler _put_response(b'+ ')
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.28 imap.example.net handler _request_pop(continuation, (True, b'')) [1] = b'CJOD3'
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.28 imap.example.net handler b'AUTHENTICATE':b'CJOD3'.ready.set
2021-02-05 11:14:16 DEBUG: [imap]:   14:16.28 Account sync Example continuation => True, b''
2021-02-05 11:14:16 WARNING:  *** Input Required
2021-02-05 11:14:16 WARNING:  *** Please enter password for user 'exampleuser': 
2021-02-05 11:14:20 DEBUG: [imap]:   14:20.76 Account sync Example state_change_pending.release
2021-02-05 11:14:20 ERROR: ERROR: While attempting to sync account 'Example'
  sequence item 2: expected str instance, bytes found
2021-02-05 11:14:20 ERROR: ['  File "/usr/share/offlineimap3/offlineimap/accounts.py", line 298, in syncrunner\n    self.__sync()\n', '  File "/usr/share/offlineimap3/offlineimap/accounts.py", line 374, in __sync\n    remoterepos.getfolders()\n', '  File "/usr/share/offlineimap3/offlineimap/repository/IMAP.py", line 648, in getfolders\n    imapobj = self.imapserver.acquireconnection()\n', '  File "/usr/share/offlineimap3/offlineimap/imapserver.py", line 592, in acquireconnection\n    self.__authn_helper(imapobj)\n', '  File "/usr/share/offlineimap3/offlineimap/imapserver.py", line 449, in __authn_helper\n    if func(imapobj):\n', '  File "/usr/share/offlineimap3/offlineimap/imapserver.py", line 375, in __authn_plain\n    imapobj.authenticate(\'PLAIN\', self.__plainhandler)\n', '  File "/usr/lib/python3/dist-packages/imaplib2.py", line 691, in authenticate\n    typ, dat = self._simple_command(\'AUTHENTICATE\', mechanism.upper())\n', '  File "/usr/lib/python3/dist-packages/imaplib2.py", line 1684, in _simple_command\n    return self._command_complete(self._command(name, *args), kw)\n', '  File "/usr/lib/python3/dist-packages/imaplib2.py", line 1404, in _command\n    literal = literator(data, rqb)\n', '  File "/usr/lib/python3/dist-packages/imaplib2.py", line 2247, in process\n    ret = self.mech(self.decode(data))\n', '  File "/usr/share/offlineimap3/offlineimap/imapserver.py", line 217, in __plainhandler\n    retval = NULL.join((authz, authc, passwd))\n']
2021-02-05 11:14:20 INFO: *** Finished account 'Example' in 0:04

Steps to reproduce the error

  1. Use a password which has a . in it
  2. Add ui = blinkenlights in [general] section of .offlineimaprc
  3. Adding remotepass or remotepassfile or asking password from ui, all will give different types of errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions