Fix the authentication behavior with non-existing users
This commit is contained in:
@@ -11,7 +11,7 @@ STATUSES = {
|
|||||||
"authentication": ("Authentication credentials invalid", {
|
"authentication": ("Authentication credentials invalid", {
|
||||||
"imap": "AUTHENTICATIONFAILED",
|
"imap": "AUTHENTICATIONFAILED",
|
||||||
"smtp": "535 5.7.8",
|
"smtp": "535 5.7.8",
|
||||||
"pop3": ""
|
"pop3": "-ERR Authentication failed"
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,16 +52,14 @@ def handle_authentication(headers):
|
|||||||
"Auth-Server": server,
|
"Auth-Server": server,
|
||||||
"Auth-Port": port
|
"Auth-Port": port
|
||||||
}
|
}
|
||||||
else:
|
status, code = get_status(protocol, "authentication")
|
||||||
status, code = get_status(protocol, "authentication")
|
return {
|
||||||
return {
|
"Auth-Status": status,
|
||||||
"Auth-Status": status,
|
"Auth-Error-Code": code,
|
||||||
"Auth-Error-Code": code,
|
"Auth-Wait": 0
|
||||||
"Auth-Wait": 0
|
}
|
||||||
}
|
|
||||||
# Unexpected
|
# Unexpected
|
||||||
else:
|
return {}
|
||||||
return {}
|
|
||||||
|
|
||||||
|
|
||||||
def get_status(protocol, status):
|
def get_status(protocol, status):
|
||||||
|
|||||||
Reference in New Issue
Block a user