Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/smtp: timeout support similar to net.DialTimeout #16436

Closed
harlow opened this issue Jul 20, 2016 · 3 comments
Closed

net/smtp: timeout support similar to net.DialTimeout #16436

harlow opened this issue Jul 20, 2016 · 3 comments

Comments

@harlow
Copy link

harlow commented Jul 20, 2016

Similar to the addition of DialTimeout to net package:
#240

func DialTimeout(net, addr string, timeout time.Duration) (Conn, error) {

Would be nice to add some symmetry with DialTimeout for smtp package:
https://github.com/golang/go/blob/master/src/net/smtp/smtp.go#L43-L45

@harlow harlow changed the title smtp: timeout support similar to net.DialTimeout net/smtp: timeout support similar to net.DialTimeout Jul 20, 2016
@bradfitz
Copy link
Contributor

Sorry, the SMTP package is frozen. Please fork it and add features on Github. We should have never included it in the standard library.

I'll keep this bug open to document that it's frozen though. We'll fix bugs but not add features.

@harlow
Copy link
Author

harlow commented Jul 20, 2016

OK sounds good - thanks for the quick reply. I worked around it by passing in the net client:

// Dial the tcp connection
conn, err := net.DialTimeout("tcp", addr, 10*time.Second)
if err != nil {
    return "", err
}

// Connect to the SMTP server
c, err := smtp.NewClient(conn, host)
if err != nil {
    return "", err
}
defer c.Quit()

@harlow harlow closed this as completed Jul 20, 2016
@bradfitz bradfitz reopened this Jul 20, 2016
@gopherbot
Copy link

CL https://golang.org/cl/25080 mentions this issue.

dishmael pushed a commit to opsvision/email-verification that referenced this issue Jan 18, 2017
@golang golang locked and limited conversation to collaborators Jul 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants