It looks like the thing to do is set mail.NetDialTimeout (see
https://godoc.org/github.com/go-mail/mail#pkg-variables).

Unfortunately, the socks proxy module doesn't appear to support timeouts.
If you don't need connection timeouts, though, it should work to create
your own DialTimeout that ignores the timeout and calls the socks dialer:

dialer := proxy.FromEnvironment()
mail.NetDialTimeout = func(network, address string, timeout time.Duration)
(net.Conn, error) {
    return dialer.Dial(network, address)
}

To make things better, probably both modules should be updated to use /
provide a net.Dialer, which supports timeouts, cancellation, and other
features.

On Tue, Jan 8, 2019 at 8:45 PM No Name <hrdcod...@gmail.com> wrote:

> How I can create a custom dialer for https://github.com/go-mail/mail for
> using socks proxy (golang.org/x/net/proxy)?
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to