Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
net/smtp: in smtp.go, c.cmd(501, "*") takes long for server to respond. #18094
What version of Go are you using (
By reading the RFC: https://www.ietf.org/rfc/rfc2554.txt
And in the case of OP, when incorrect credentials are sent by client, the server returns 535 which means the AUTH exchange has already been rejected, so there's no need to send "*" to ask server to reject the AUTH command.
My first time reading this RFC, so let's see what expert says about this issue.
Feel free to ignore this/close this smtp package issue too. I was already looking at it when you closed the other, I figure I may as well finish what I was writing. Sorry for the noise! At least it may lead to closing some issues :-)
I concur with the RFC reading that sending the
However simply deleting sending the
We also need to send
Essentially I think what would be the most correct would be to check if the server rejected the AUTH exchange, and if so, quit without sending
Of course, testing this in the wild would be good to confirm.
This could be done by checking
Note there is still an issue in the above: If decoding failed when code was 334, we should send
I ran a modified example that connects to gmail's smtp servers, and was able to reproduce this behavior on my DigitalOcean VM. I believe this has to do with them blocking SMTP over IPV6.
Running this on my macbook produced the correct error immediately:
But running it on my VM took ~2 minutes to respond. After researching the error, I came across https://www.digitalocean.com/community/questions/outgoing-connections-on-port-25-587-143-blocked-over-ipv6.
Changing this line
Hi, I have a fix from https://golang.org/cl/104435 to resolve this issue, please help review.
The test file need to be changed as well. However as the smtp_test.go contains a private key, I cannot push that change, the git -o nokeycheck not work for me as my git does not have a -o switch. Any idea what shall I do to change the test file?