Check if username is provided before trying plain authentication.
If the username value is not provided on the configuration file, then username if of NoneType and NULL.join will bomb since Nones can't be joined with strings. So check if username is empty and raise an exception if so.
This commit is contained in:
parent
950702d605
commit
2257e12b63
|
@ -199,6 +199,11 @@ class IMAPServer(object):
|
|||
http://tools.ietf.org/html/rfc4616"""
|
||||
|
||||
authc = self.username
|
||||
if not authc:
|
||||
raise OfflineImapError("No username provided for '%s'"
|
||||
% self.repos.getname(),
|
||||
OfflineImapError.ERROR.REPO)
|
||||
|
||||
passwd = self.__getpassword()
|
||||
authz = b''
|
||||
if self.user_identity != None:
|
||||
|
|
Loading…
Reference in New Issue