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

[BUG]: Email SMTP SSL is not working with port 465 #351

Open
sebmalissard opened this issue Nov 12, 2024 · 0 comments
Open

[BUG]: Email SMTP SSL is not working with port 465 #351

sebmalissard opened this issue Nov 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@sebmalissard
Copy link

What happened?

I enabled SMTP in the general configuration with the instructions provided by my hosting provider https://www.infomaniak.com/fr/support/faq/2427/synchroniser-les-e-mails-sur-tous-vos-appareils.

So I set:

  • SMTP Host: mail.infomaniak.com
  • SMTP Port: 465
  • Name + password
  • SMTP use TLS to yes
  • Send email when succes login to yes

But the server nerver send any email and the login to cosmos server is very slow (timeout wait)

What should have happened?

The cosmos server should by able to sent email and the login should not be slower.

How to reproduce the bug?

  1. Enable SMTP
  2. Configure SMTP with port 465
  3. Go in cosmos-ui/config-users
  4. Send an user password reset

Relevant log output

In server log I have:
2024/11/12 20:10:36 [ERROR] UserInvite: Error while sending email : EOF
2024/11/12 20:10:36 [ERROR] Request Timeout. Cancelling. : context deadline exceeded
2024/11/12 20:10:36 [ERROR] HTTP Request returned Error 504 : Gateway Timeout :

Other details

I did a quick analysis, and what I understand is that the issue is in the send email function: https://github.com/azukaar/Cosmos-Server/blob/master/src/utils/emails.go#L89.

Port 465 is reserved for SMTPS, and the connection should start encrypted directly. So, I think that if the UseTLS option is enabled and the port is 465, the function tls.Dial+smtp.NewClient should be used instead of smtp.Dial+config.EmailConfig.UseTLS.

System details

  • OS: Ubuntu 24.04.1 LTS
  • Browser Firefox
  • Version 0.16.3
@sebmalissard sebmalissard added the bug Something isn't working label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant