Routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355

Hello,

For about two hours I just can’t figure this out. I want to send email from ghost, just registration etc… in documentation which kind of skip this step and just ask you to pay for mailgun :-/ its not documented just simple SMTP server.

I for sure can send from the same server email with python for example:

python3 -c "import smtplib; from email.mime.text import MIMEText; msg = MIMEText('This is a test message'); msg['Subject'] = 'Test'; msg['From'] = 'info@some_mail.com'; msg['To'] = 'test@mail.com'; s = smtplib.SMTP('smtp.server.com', 587); s.ehlo(); s.starttls(); s.login('info@some_mail.com', 'some_pass'); s.send_message(msg); s.quit()"

Note: the values are not real in the above command, but trust me it works.

I have this setting in my docker compose file:

      mail__transport: "SMTP"
      mail__logger: true
      mail__from: "info@some_mail.com"
      mail__options_requireTLS: true
      mail__options__secure: false
      mail__options__host: smtp.server.com
      mail__options__port: 587
      mail__options__auth__user: "info@some_mail.com"
      mail__options__auth__pass: "some_pass"

I have tried all combinations of:
mail__options_requireTLS: true
mail__options__secure: false

But always I get:

[2024-03-27 13:35:16] ERROR "POST /members/api/send-magic-link/" 500 267ms

Failed to send email. Reason: 00588ADBF67F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355:
.

"Please see https://ghost.org/docs/config/#mail for instructions on configuring email."

Error ID:
    d88de750-ec3e-11ee-9298-510c5e9194e1

Error Code: 
    ESOCKET

----------------------------------------

Error: 00588ADBF67F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355:
.

You should have two underscores before requireTLS.