-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
SMTP: TLS + port 465 doesn't work #437
Comments
The error includes Maybe the connection is closed by the SMTP server due to incompatible TLS version? Have you tried setting |
It seems the network failure is due to the misspelling on my password. But after I corrected the password, the email job just has no response. And still, I have tried specifying the I am trying to build the server with debug messages enabled. I will comment later if I found any new updates. |
Try to remove
I had issues with these options. After deleting them, leaving only these:
I got everything to work. IDK why but tls+465 just didn't work with asciinema + my mail server. It could work as a temporary fix but it still should be investigated why these options don't seem to be working. |
OMG IT WORKS!!! I have spent my whole weekend last week diving into the code. But I still can't find out what's wrong in the config. The STMP client (Bamboo) just fired a log about the mail content and hung. Maybe there's something problem related to the Boomboo SMTP client itself. I almost decide to modify the code to send emails externally. You save my time! But I just remove the line SMTP_PORT, which means it will use the predefined port 587 in code. And the SMTP_TLS can't be removed in my case as my mailiing server froce the usage of SSL. ANYWAY, THANK YOU SO MUCH |
@ku1ik The issue is solved in my case. If you think this can be accepted as a temporary solution, you can close the issue. |
I am not sure how I solved it but I think that my mail server reported some login issues and that's why I tried it this way. I may look into it again it that's something @ku1ik wants.
You're welcome, glad I could help <3 |
Thanks for help @jiriks74 🙌 I'm not sure why wouldn't TLS + 465 work. The configuration is defined here, and all the options are passed directly to Bamboo's SMTP adapter: asciinema-server/config/runtime.exs Lines 144 to 177 in b3a852d
But, since both of you got it working I'm going to close this issue. |
@ku1ik |
Fine by me 👍 Feel free to investigate then :) |
Since I've upgraded the SMTP client library in the today's release you may want to try it out. There's a slight chance it fixed the issue. |
Also, I believe there's a difference between using TLS and using SSL... Maybe what you need is enabling SSL mode? The SMTP client we use allows enabling both, separately, so there is a distinction. Right now SSL is always disabled, and there's no env var to enable it, but we could add one. However, SSL mode can also be enabled today by using a custom config file and putting this in it: import Config
config :asciinema, Asciinema.Emails.Mailer, ssl: true This will work in addition to the existing env vars, although it's probably wise to remove |
Using
results in 502 when logging in for me. |
There's a difference but you could say that TLS is basically SSLv2?
According to this you don't want to use SSL as it's quite old. |
Right. At the client library level (both the previous one and the new one I switched to) there's distinction, there are 2 separate options to enable/disable those, named |
502? As in Bad Gateway error? Is there anything interesting in the container logs when this happens? |
This is from Cloudflare, which I assume you put in front of asciinema server. Can you pull container logs from the moment this error happened? |
Yup but this issue is caused by Asciinema. The only thing that Cloudflare does is make a cool site for the error. Nothing interesting in logs Logs
|
So there's no corresponding |
Hey! Sorry to randomly jump in, but it looks like the discussion here is mixing up a couple of different SMTP security options. SMTP has two ways of enabling encryption (implicit and explicit) and three different ports (25, 465, 587). "Implicit" means the client connects to the server with encryption already turned on. This is what the "ssl" option for gen_smtp does. Port 465 is specifically for implicit encryption, so if you use 465, you have to have "ssl" turned on and "tls" turned off. No other port will work with "ssl" turned on. "Explicit" means the client connects to the server with no encryption, then uses the Your best bet is to stick to explicit encryption using:
|
Thanks Mark. I thought it's something like this but couldn't put my finger on it. This explanation makes it super clear. Given the above, I think we should either rename the issue to mention "SSL + port 465" (if what you guys want here is implicit encryption on port 465), or close it (if you want explicit encryption on port 465, which is impossible). |
Describe the bug
Sending email with SMTP not work.
To Reproduce
Steps to reproduce the behavior:
Using the docker compose version to self-host a asciinema server. Setting the SMTP_* environments below:
Then send with the test email command:
The command is freeze without any output.
The signup page triggers a Asciinema.Emails.Job with the log below:
After formatted:
The error message maybe indicated that there are some bugs in the source code.
Expected behavior
The server should send the email as expected.
Screenshots
The screenshot of the above log:
Versions:
Additional context
The SMTP configs are verified on both thunderbird client and online wordpress SMTP plugin, which means the SMTP settings should be correct and the issue is not relative to the firewall.
The text was updated successfully, but these errors were encountered: