Don't try to login with IMAP and courier when user or password is empty
This commit is contained in:
parent
e4af425893
commit
9a49be1e10
@ -43,6 +43,8 @@ IMAP_USE_SSL = config.get("auth", "imap_ssl")
|
|||||||
|
|
||||||
def is_authenticated(user, password):
|
def is_authenticated(user, password):
|
||||||
"""Check if ``user``/``password`` couple is valid."""
|
"""Check if ``user``/``password`` couple is valid."""
|
||||||
|
if not user or not password:
|
||||||
|
return False
|
||||||
|
|
||||||
log.LOGGER.debug(
|
log.LOGGER.debug(
|
||||||
"Connecting to IMAP server %s:%s." % (IMAP_SERVER, IMAP_SERVER_PORT,))
|
"Connecting to IMAP server %s:%s." % (IMAP_SERVER, IMAP_SERVER_PORT,))
|
||||||
|
@ -32,6 +32,8 @@ COURIER_SOCKET = config.get("auth", "courier_socket")
|
|||||||
|
|
||||||
def is_authenticated(user, password):
|
def is_authenticated(user, password):
|
||||||
"""Check if ``user``/``password`` couple is valid."""
|
"""Check if ``user``/``password`` couple is valid."""
|
||||||
|
if not user or not password:
|
||||||
|
return False
|
||||||
|
|
||||||
line = "%s\nlogin\n%s\n%s" % (sys.argv[0], user, password)
|
line = "%s\nlogin\n%s\n%s" % (sys.argv[0], user, password)
|
||||||
line = "AUTH %i\n%s" % (len(line), line)
|
line = "AUTH %i\n%s" % (len(line), line)
|
||||||
|
Loading…
Reference in New Issue
Block a user