Implements SASL PLAIN authentication, RFC 4616, http://tools.ietf.org/html/rfc4616
(self, response)
| 199 | imapobj.login(self.username, self.__getpassword()) |
| 200 | |
| 201 | def __plainhandler(self, response): |
| 202 | """Implements SASL PLAIN authentication, RFC 4616, |
| 203 | http://tools.ietf.org/html/rfc4616""" |
| 204 | |
| 205 | authc = self.username |
| 206 | if not authc: |
| 207 | raise OfflineImapError("No username provided for '%s'" |
| 208 | % self.repos.getname(), |
| 209 | OfflineImapError.ERROR.REPO) |
| 210 | |
| 211 | passwd = self.__getpassword() |
| 212 | authz = b'' |
| 213 | if self.user_identity != None: |
| 214 | authz = self.user_identity |
| 215 | # At this point all authz, authc and passwd are expected bytes encoded |
| 216 | # in UTF-8. |
| 217 | NULL = b'\x00' |
| 218 | retval = NULL.join((authz, authc, passwd)) |
| 219 | logsafe_retval = NULL.join((authz, authc, b'(passwd hidden for log)')) |
| 220 | self.ui.debug('imap', '__plainhandler: returning %s'% logsafe_retval) |
| 221 | return retval |
| 222 | |
| 223 | def __xoauth2handler(self, response): |
| 224 | now = datetime.datetime.now() |
nothing calls this directly
no test coverage detected