HaskellNet-SSL
HaskellNet-SSL copied to clipboard
TLS fails to authorise if the server stopped supporting HELO command
trafficstars
Yandex smtp server dropped support of the HELO command in the protocol as a result authorisation fail with log:
HaskellNet-SSL RECV: "220 sas1-37da021029ee.qloud-c.yandex.net SMTP\r"
HaskellNet-SSL SEND: "HELO Alexanders-MacBook-Pro.local\r\n"
HaskellNet-SSL RECV: "502 5.5.1 Unrecognized command\r"
)
If we don't try to send HELO , and sent EHLO immediately everything works fine:
openssl s_client -connect smtp.yandex.ru:465
220 iva8-a4a480c9f089.qloud-c.yandex.net SMTP
EHLO alexander.vershilov.localhost
250-8BITMIME
250-PIPELINING
250-SIZE 42991616
250-STARTTLS
250-AUTH LOGIN PLAIN XOAUTH2
250-DSN
250 ENHANCEDSTATUSCODES
There are two options to fix this issue:
- drop support of the old servers that can't work with HELO
- do not fail if the server returns 502 on HELO command.
I think that the second option is better and will try to provide a MR soon.