aiosmtpd
aiosmtpd copied to clipboard
AUTH not provided in EHLO with SSL/TLS
When using implicit SSL/TLS (so no STARTTLS), the self._tls_protocol will never be set. This results in AUTH not being present in the EHLO response (given that auth_require_tls is true): https://github.com/aio-libs/aiosmtpd/blob/master/aiosmtpd/smtp.py#L833
I would expect that when an SSL/TLS connection is used instead of STARTTLS (and auth_require_tls is true), AUTH is provided to the client. Currently, we are setting auth_require_tls is false to circumvent this issue.
Sadly, I don't think* there's an efficient way for SMTP to detect if it's being wrapped externally in an SSL/TLS context.
For the time being I think the easiest workaround is to add a note to the documentation w.r.t. needing to set auth_require_tls=False when using implicit SSL/TLS.
- I may change my mind, though. Let me refresh my understanding of the code first ... it's been quite awhile 😅
@FinnStutzenstein in fact not only was AUTH not present in response, but was also explicitly rejected when attempted without feature checking. But hopefully it will be merged and fixed soon.