What version of Go are you using (go version)?
all versions
Does this issue reproduce with the latest release?
yes
What did you do?
Attempt to use libraries which build upon net/SMTP, or use net/SMTP itself, in order to send emails over SMTP and you will quickly realize that having different allowed timeouts for different stages of the connection is not supported by default using net/SMTP. I have not explored using a custom Client as a workaround, but other standard libraries like Python's smtplib support timeouts by default as function arguments. and even using a custom Client doesn't seem like it would allow different timeouts for different stages of the SMTP process.
What did you expect to see?
c, err := smtp.Dial("mail.example.com:25", timeout_in_seconds)
if err != nil {
log.Fatal(err)
}
...
_, err = fmt.Fprintf(wc, "This is the email body", timeout_in_seconds)
if err != nil {
log.Fatal(err)
}
err = wc.Close(timeout_in_seconds)
if err != nil {
log.Fatal(err)
}
What did you see instead?
c, err := smtp.Dial("mail.example.com:25")
if err != nil {
log.Fatal(err)
}
...
_, err = fmt.Fprintf(wc, "This is the email body")
if err != nil {
log.Fatal(err)
}
err = wc.Close()
if err != nil {
log.Fatal(err)
}
If my suggested behavior is desired, I would be happy to make this improvement myself
What version of Go are you using (
go version)?all versions
Does this issue reproduce with the latest release?
yes
What did you do?
Attempt to use libraries which build upon net/SMTP, or use net/SMTP itself, in order to send emails over SMTP and you will quickly realize that having different allowed timeouts for different stages of the connection is not supported by default using net/SMTP. I have not explored using a custom Client as a workaround, but other standard libraries like Python's smtplib support timeouts by default as function arguments. and even using a custom Client doesn't seem like it would allow different timeouts for different stages of the SMTP process.
What did you expect to see?
What did you see instead?
If my suggested behavior is desired, I would be happy to make this improvement myself