sagemathinc / cocalc-docker

DEPRECATED (was -- Docker setup for running CoCalc as downloadable software on your own computer)
https://cocalc.com
Other
398 stars 103 forks source link

email configuration not taken into account ? #103

Closed mperreir closed 1 year ago

mperreir commented 3 years ago

Hello,

I configured cocalc docker so that it can send emails through our email server (not secured, on port 25 with any authentication) but do not receive any email when I click on the "Forgot password" button in the admin panel (which is here to test email sending I guess).

Looking at hub.log in the docker container, it seems that cocalc tries to send mail using SMTP, but on 127.0.0.1 and port 465.

Here is en excerpt of the log (just changed my email to xxx for privacy protection)

2020-09-21T15:18:27.169Z - debug: send_email(to:xxx@univ-nantes.fr) -- <div>Hello,</div>
<div>&nbsp;</div>
<div>
Somebody just requested to change the password of your Cocalc Computer science department - Polytech Nantes account.
If you requested this password change, ple...
2020-09-21T15:18:27.169Z - debug: send_email(to: xxx@univ-nantes.fr) -- sendgrid not configured, starting...
2020-09-21T15:18:27.170Z - debug: send_email(to: xxx@univ-nantes.fr) -- Problem initializing Sendgrid -- Error: unable to read the file '/cocalc/src/data/secrets/sendgrid', which is needed to send emails -- Error: ENOENT: no such file or directory, open '/cocalc/src/data/secrets/sendgrid'
2020-09-21T15:18:27.170Z - debug: send_email(to: xxx@univ-nantes.fr) -- sending email via SMTP backend
2020-09-21T15:18:27.172Z - debug: send_email(to: xxx@univ-nantes.fr) -- error sending email -- {"errno":"ECONNREFUSED","code":"ESOCKET","syscall":"connect","address":"127.0.0.1","port":465,"command":"CONN"}
haraldschilly commented 3 years ago

well, theoretically it should work. it just sends off the email via smtp, which is quite basic.

did you try right after setting the parameters? maybe the data in the hub is stale (it should clear a cache when settings are saved, but maybe it's flaky)

the other thing you can do is to connect to the database (psql somehow) and run select * from server_settings; to see what's actually in the DB.

mperreir commented 3 years ago

Information in the DB is ok. The SMTP server address and ports are present (which is logical since in the web UI the settings are also ok). However send_email still tries to connect to localhost on port 465.

mperreir commented 3 years ago

I stopped and restarted the docker container. Now it works. So it seems that even if the mail configuration is correctly stored in the DB, it is somehow not reloaded when it is changed from the admin panel.

haraldschilly commented 3 years ago

ok, I see, it was stale then. I created this ticket about this https://github.com/sagemathinc/cocalc/issues/4881