net/smtp: unable to retrieve SMTP server response error information after EHLO command in (*Client).hello() function #56125
Labels
help wanted
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
send email using a non-whitelist ip address
What did you expect to see?
function
smtp.SendMail
return the real error{"Code": 117, "Msg": "The IP Address is not whitelisted: x.x.x.x"}
from(*Client).ehlo()
What did you see instead?
function smtp.SendMail return the error
EOF
from(*Client).helo()
Proposal
Before
The comment of
(*Client).helo()
ishelo sends the HELO greeting to the server. It should be used only when the server does not support ehlo.
, but in(*Client) hello()
the implement is:When we get a error from
(*Client).helo()
not only502 (permitted only with an old-style server that does not support EHLO)
(see 4.3.2 Command-Reply Sequences), thec.helo()
will still execute and return another error likeEOF
what I got. When we print error like "EOF" in log, we cannot get any thing helpful to debug.After
The text was updated successfully, but these errors were encountered: