aio-libs / aiosmtpd

A reimplementation of the Python stdlib smtpd.py based on asyncio.
https://aiosmtpd.aio-libs.org
Apache License 2.0
312 stars 95 forks source link

Fix authentication #375

Open remram44 opened 1 year ago

remram44 commented 1 year ago

What do these changes do?

Update the documentation and example to mention that auth_required=True should be set when setting authenticator, otherwise clients can still send messages with no authentication.

Are there changes in behavior for the user?

No

Related issue number

374

Checklist

remram44 commented 1 year ago

This also fixes other issues with the example, such as the username not being decoded from bytes (so no row would ever be found in the database), Argon2 being used incorrectly (it uses a random seed, you can't hash multiple passwords and compare the hashes, use verify()), and auth_require_tls=False (otherwise you can't auth at all).