Skip to content

SMTP configuration incorrect in installer - with fix #23180

@chrisale

Description

@chrisale

Steps to reproduce the problem

Case 1) In the script:

  1. Follow steps on joinmastodon.org to install mastodon and prerequisites from source
  2. run RAILS_ENV=production bundle exec rake mastodon:setup
  3. attempt to configure with any SSL related authentication setting

Case 2) In a running mastodon instance have in the .env.production file the standard settings using port 465 / SSL:

SMTP_SERVER=mymailserver
SMTP_PORT=465
SMTP_LOGIN=myloginemail
SMTP_PASSWORD=mypassword
SMTP_AUTH_METHOD=plain
SMTP_OPENSSL_VERIFY_MODE=client_once
SMTP_ENABLE_STARTTLS=always
SMTP_FROM_ADDRESS=notifications@emailaddress

Expected behaviour

An email should be generated and successfully sent

Actual behaviour

The commands timeout and produces: "Net::ReadTimeout: "Net::ReadTimeout with #TCPSocket:(closed)" in script output and syslog

Detailed description

To resolve this problem we consulted this discourse link:
https://discourse.joinmastodon.org/t/new-mailserver-no-mails/3420

The problem appears to be in the SSL settings. SMTP_AUTH_METHOD, SMTP_OPENSSL_VERIFY_MODE and SMTP_ENABLE_STARTTLS are commented out and SMTP_TLS=true must be added.

My successful settings were:

SMTP_SERVER=mymailserver
SMTP_PORT=465
SMTP_LOGIN=myloginemail
SMTP_PASSWORD=mypassword
#SMTP_AUTH_METHOD=plain
#SMTP_OPENSSL_VERIFY_MODE=client_once
#SMTP_ENABLE_STARTTLS=always
SMTP_TLS=true
SMTP_FROM_ADDRESS=notifications@emailaddress

Related Mastodon Thread:
https://mstdn.ca/@chrisale/109725219048851990

Specifications

Debian 11
Mastodon | 4.0.2
Ruby | 3.0.4p208
PostgreSQL | 15.1
Redis | 6.0.16
OpenSSL 1.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions