Send activation mail with self-signed certificate for SMTP


(Martial) #1

Hello,

I just install a new discourse instance and i never receive the email activation.

The configuration of the app.yml with the SMTP information :

  ## TODO: The mailserver this Discourse instance will use
  DISCOURSE_SMTP_ADDRESS: smtp.domain.com 
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: forum@domain.com
  DISCOURSE_SMTP_PASSWORD: password
  #DISCOURSE_SMTP_ENABLE_START_TLS: true 
  DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: "none"

The certificate of the SMTP is self-signed so i add DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: "none" then a rebuild everythings with ./launcher rebuild app

Log file tail shared/standalone/log/rails/production.log

rocessing by FinishInstallationController#confirm_email as HTML
  Rendered finish_installation/confirm_email.html.erb within layouts/finish_installationB)
 (1.1ms
  Rendered common/_special_font_face.html.erb (0.1ms)
  Rendered layouts/_head.html.erb (0.2ms)
Completed 200 OK in 24ms (Views: 23.5ms | ActiveRecord: 0.0ms)

Sent mail to forum@domain.fr (60252.4ms)
Job exception: Net::ReadTimeout    

But when I click “send email activation”, I get nothing. Any idea ?


(Jay Pfaffman) #2

Digital ocean has been silently blocking outgoing connections to 587. Can your server access the smtp server?


(Matt Palmer) #3

Net::ReadTimeout doesn’t mean “the server certificate was invalid”, it means “your network is b0ned”. Also, if you’re running an SMTP server that can be connected to over the Internet, you almost certainly have a globally-registered name for it, and so you can get a Let’s Encrypt cert for it.