From 8fee0e41de46f2f30e53498b98b3280c14856d78 Mon Sep 17 00:00:00 2001 From: Changaco Date: Sat, 30 Nov 2024 13:43:53 +0100 Subject: [PATCH] handle yet another noncompliant SMTP response Yandex improperly responds with a 5.7.1 enhanced mail status code when an inbox doesn't exist. --- liberapay/utils/emails.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/liberapay/utils/emails.py b/liberapay/utils/emails.py index 8df0e05ec..e113cd2d9 100644 --- a/liberapay/utils/emails.py +++ b/liberapay/utils/emails.py @@ -388,7 +388,9 @@ def test_email_server(ip_address: str, email=None, timeout=None) -> None: # OpenSMTPD msg.startswith("Invalid recipient: ") or # Tutanota's SMTP server - msg.endswith("Recipient address rejected: Recipient not found") + msg.endswith("Recipient address rejected: Recipient not found") or + # Yandex + msg.startswith("No such user") ) if recipient_rejected: raise EmailAddressRejected(email, msg, ip_address)