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

Export NetDialTimeout to public #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Elbandi
Copy link

@Elbandi Elbandi commented Oct 8, 2017

Export the netdial function, this allow setup a custom dialer (like tor socks proxy):

dialer, _ := proxy.FromURL("socks5://127.0.0.1:9050", proxy.Direct) 
gomail.NetDialTimeout = func(network, address string, timeout time.Duration) (net.Conn, error) {
  return dialer.Dial(network, address)
}

@@ -182,7 +182,7 @@ func (c *smtpSender) Close() error {

// Stubbed out for tests.
var (
netDialTimeout = net.DialTimeout
NetDialTimeout = net.DialTimeout
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be moved out of this var block so no one's confused later by the // Stubbed out for tests. comment.

@pedromorgan
Copy link

This is merged in the WIP fork https://github.com/go-mail/gomail/commits/master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants