go-simple-mail icon indicating copy to clipboard operation
go-simple-mail copied to clipboard

EHLO isn't sent after STARTTLS

Open KemarCodes opened this issue 2 years ago • 2 comments

Per RFC3207, "The client SHOULD send an EHLO command as the first command after a successful TLS negotiation."

There are some email servers that enforce the RFC like Microsoft Exchange. Seeing this error when sending to an Exchange 2016 server: 503 5.5.2 Send hello first

This part of the code shows the 'hello' only being sent before STARTTLS I believe.

KemarCodes avatar Nov 19 '23 20:11 KemarCodes

Currently a EHLO is sent after a STARTTLS, but maybe your Exchange Server supports HELO instead EHLO, but I doubt this. I made a tiny change in branch helo-after-starttls, you can test it, but only works if really your Exchange Server doesn't supports EHLO.

Can you please response with the complete Mail error message from this package?

Also, are you using LOGIN Auth? If yes, try another like PLAIN if server supports, if Exchange is behind a Firewall is possible AUTH command was stripped and this scenario can trigger this error too.

xhit avatar Nov 21 '23 19:11 xhit

Hello xhit, thank you. It is behavior a user found and I haven't tested myself. Will be setting up an Exchange server for testing to confirm it is reproducible.

Also failed to note that part of the code, smtp.go, so a bit of an oversight on my end.

If the behavior is reproducible, I'll provide my findings.

KemarCodes avatar Nov 28 '23 14:11 KemarCodes

Closed because package works as RFC3207 says, nothing to do here.

xhit avatar Feb 28 '24 20:02 xhit