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 howto #145

Closed szazs89 closed 1 year ago

szazs89 commented 2 years ago

I struggled to setup emailing in docker version:

I have found some logs in /var/log/hub/out - at least the errors can be debugged w.r.t. password reset at the login page.

  1. It seems that if I set up SMTP then I also need to set up SMTP to Override email backend for password reset email sending.
    Error: SMTP password_reset server must be configured.
  2. There is no way to use SMTP without authentication data (empty username field).
    Error: SMTP password_reset username must be configured.
  3. Using secure SMTP through port 465 did not work for me (possibly different ssl version):
    sending password reset via secondary smtp server failed; trying sendgrid. [Error: 140383091120000:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
    ] {
    library: 'SSL routines',
    function: 'ssl3_get_record',
    reason: 'wrong version number',
    code: 'ESOCKET',
    command: 'CONN'
    }

    our SMTP server logs:

    SMTP protocol synchronization error (input sent without waiting for greeting): rejected connection from ...
  4. finally, I was able to get password reset email using unsecure SMTP 25 and authenticating with a dummy account. Hopefully, these settings as primary Email sending will also work.

(during playing with these settings I have not tried to restart the image)

Conclusions

  1. IMHO for Override emailbackend there should be the following options:
    • no/default: to use the primary settings (sendgrid/smtp)
    • sendgrid(?)
    • smtp: to set up secondary SMTP
  2. for unsecure SMTP setting if there are no auth data (username, etc.) given then unauthenticated smtp connection should be enabled (I admit, that it may be a rare situation nowadays)
  3. The Tests: Email: ... [Forgot Password] still doesn't do anything, no log, etc.
  4. It should be noted which modifications do require image restart...
haraldschilly commented 2 years ago

hi, I am not sure what exactly is going wrong, but this ticket should be in the cocalc repo, since that's the place where the relevant code is. Besides that, all this uses https://nodemailer.com/about/ … so, part of what I see would be to figure out which config settings for nodemailer work for you, and then make sure cocalc let's you set those values.