Skip to content

Commit

Permalink
tests/smtpd.py: Returns a permanent failure for unsupported auth mech…
Browse files Browse the repository at this point in the history
…anisms

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
  • Loading branch information
P-EB authored and cole committed May 9, 2021
1 parent cdb8d1b commit 5f7ca8e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/smtpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5f7ca8e

Please sign in to comment.