M.login(account.username, account.password)
except UnicodeEncodeError:
+ self.log("debug", "Falling back to AUTH=PLAIN")
try:
# rfc2595 section 6 - PLAIN SASL mechanism
client: IMAP4 = M.client
# Need to transition out of AUTH state to SELECTED
M.folder.set("INBOX")
except Exception:
+ self.log(
+ "error",
+ "Unable to authenticate with mail server using AUTH=PLAIN",
+ )
raise MailError(f"Error while authenticating account {account}")
except Exception:
+ self.log("error", "Unable to authenticate with mail server")
raise MailError(f"Error while authenticating account {account}")
self.log(
"""
GIVEN:
- Mail account with password containing non-ASCII characters
- - Incorrect password alue
+ - Incorrect password value
THEN:
- Should raise a MailError for the account
"""