From 5f7ca8e03c9708c8f30786b7003f1e32a6cfe972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Sun, 9 May 2021 14:44:29 +0200 Subject: [PATCH] tests/smtpd.py: Returns a permanent failure for unsupported auth mechanisms smtpd testing server does call a specific method when AUTH PLAIN is used, but ignores without returning any other auth mechanism. As the connector tries auth methods in a non-deterministic order, this leads to a timeout if PLAIN is not the first mechanism tried. This commit makes the smtpd test server return a permanent failure for non-supported auth mechanisms. Fixes issue #171 --- tests/smtpd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/smtpd.py b/tests/smtpd.py index b0e1ac30..79ddaddd 100644 --- a/tests/smtpd.py +++ b/tests/smtpd.py @@ -115,6 +115,8 @@ async def smtp_AUTH(self, arg): if arg[:5] == "LOGIN": await self.smtp_AUTH_LOGIN(arg[6:]) + else: + await self.push("504 Unsupported AUTH mechanism.") async def smtp_AUTH_LOGIN(self, arg): username = base64.b64decode(arg)