mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-10 18:40:53 +00:00
Merge pull request #1725 from przemub/imap-auth-plain
Use AUTHENTICATE PLAIN instead of LOGIN
This commit is contained in:
commit
0fa50210c9
1 changed files with 4 additions and 1 deletions
|
@ -59,7 +59,10 @@ class Auth(auth.BaseAuth):
|
||||||
if self._security == "starttls":
|
if self._security == "starttls":
|
||||||
connection.starttls(ssl.create_default_context())
|
connection.starttls(ssl.create_default_context())
|
||||||
try:
|
try:
|
||||||
connection.login(login, password)
|
connection.authenticate(
|
||||||
|
"PLAIN",
|
||||||
|
lambda _: "{0}\x00{0}\x00{1}".format(login, password).encode(),
|
||||||
|
)
|
||||||
except imaplib.IMAP4.error as e:
|
except imaplib.IMAP4.error as e:
|
||||||
logger.warning("IMAP authentication failed for user %r: %s", login, e, exc_info=False)
|
logger.warning("IMAP authentication failed for user %r: %s", login, e, exc_info=False)
|
||||||
return ""
|
return ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue