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

SSL/TLS communication isn't possible when using Pool #77

Open
ifraixedes opened this issue Dec 21, 2018 · 6 comments
Open

SSL/TLS communication isn't possible when using Pool #77

ifraixedes opened this issue Dec 21, 2018 · 6 comments

Comments

@ifraixedes
Copy link
Contributor

I tried to use the the Pool for sending emails to a SMTP server which offers SSL/TLS connections (not STARTTLS) and the pool.Send hangs on pool.build; that doesn't happen with Email.SendWithTLS because it uses the TLS package to dial the connection.

Hence the pool type cannot send emails using SSL/TLS connections, only send emails on unencrypted connections or encrypted ones through STARTTLS.

On the other hand, in ab implementation of a function which checks SMTP server connections which I've done, I deal differently.
When the server advertise the STARTTLS connection, there is no need to dial a TLS connection, a unencrypted dial (net.Dial) works and after, it's the client.StartTLS which upgrades the connection, that's mostly is how the pool works. The thing is that it differs from the implementation of Email.SendWithTLS function, which always dial the connection with TLS independently if STARTTLS is available or not.

I cannot say if that's an issue or not, because I haven't used the Email.SendWithTLS of this package, so I'm mostly reporting as an insight.

@KasterZhang
Copy link

KasterZhang commented Aug 24, 2020

Pool.Send hangs on pool.build because use (net.Dial) on TLS connection.
the pool builder try startTLS after that

@slurdge
Copy link

slurdge commented Feb 15, 2021

Hello,
I believe this issue is still present. I hit it with slurdge/goeland#3 and while I can provide a flag to have explicit SSL, I believe it wouldn't work with pools.

I think a fix would be to have the pool have an ExplicitSSL (or ExplicitTLS) member and the dial would be done by the appropriate mechanism in build. Thoughts ?

@jeefs
Copy link

jeefs commented Aug 8, 2023

I'm having the same problem as you, using pool to send emails with :sent error:timed out, sending without pool works fine, I don't think pool is working properly!

@slurdge
Copy link

slurdge commented Aug 8, 2023

@jeefs Can you give me the two config, the one that works and the one that doesn't work ?

@jeefs
Copy link

jeefs commented Aug 10, 2023

@slurdge I've switched to the official package net/stmp to send emails and use ssl support for encrypted emails, no problems so far!

@jeefs
Copy link

jeefs commented Aug 10, 2023

I gave up using pooled connections

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

No branches or pull requests

4 participants