mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 10:15:27 -04:00
docs(email): clarify Outlook password auth failures
Co-authored-by: Alexandre Teixeira <111787685+alteixeira20@users.noreply.github.com>
This commit is contained in:
@@ -71,6 +71,38 @@ def _send_smtp_message(cfg: dict, from_addr: str, recipients: list[str], message
|
||||
smtp.sendmail(from_addr, recipients, message)
|
||||
|
||||
|
||||
def _friendly_email_auth_error(protocol: str, host: str, error: object) -> str:
|
||||
"""Return a clearer setup error for known provider auth policies."""
|
||||
raw = str(error or "")
|
||||
lower = raw.lower()
|
||||
host_lower = (host or "").lower()
|
||||
microsoft_host = any(
|
||||
marker in host_lower
|
||||
for marker in (
|
||||
"outlook.office365.com",
|
||||
"smtp.office365.com",
|
||||
"office365.com",
|
||||
"outlook.com",
|
||||
"hotmail.com",
|
||||
"live.com",
|
||||
)
|
||||
)
|
||||
microsoft_basic_auth_failure = (
|
||||
"5.7.139" in lower
|
||||
or "basic authentication is disabled" in lower
|
||||
or ("authenticate failed" in lower and microsoft_host)
|
||||
or ("authentication unsuccessful" in lower and microsoft_host)
|
||||
)
|
||||
if microsoft_basic_auth_failure:
|
||||
return (
|
||||
"Microsoft no longer accepts normal mailbox passwords for "
|
||||
"Outlook/Office 365 IMAP/SMTP in most accounts. Odysseus "
|
||||
"does not support Microsoft OAuth/Graph mail yet, so Outlook "
|
||||
"accounts cannot be added with this password form."
|
||||
)
|
||||
return raw[:200]
|
||||
|
||||
|
||||
def _strip_think(text: str) -> str:
|
||||
"""Email-flavored think strip — thin wrapper over the central helper.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user