Open liangxj8 opened 2 years ago
There doesn't seem to be an API change here, so I don't think this has to be a proposal. This looks more like a bug fix (though I don't know whether it is the right thing to do). Taking this issue out of the proposal process.
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