Ghost not using SMTP data from ENV

I have this in my env section in docker compose:

environment:
      - url="https://site.com.ua/"
      - database__client=mysql
      - database__connection__host=mysql
      - database__connection__user=$SERVICE_USER_MYSQL
      - database__connection__password=$SERVICE_PASSWORD_MYSQL
      - 'database__connection__database=${MYSQL_DATABASE-ghost}'
      - mail__transport=SMTP
      - 'mail__options__auth__pass=token'
      - 'mail__options__auth__user=resend'
      - 'mail__options__secure=false'
      - 'mail__options__port=465'
      - 'mail__options__service=Resend'
      - 'mail__options__host=smtp.resend.com'

But if i try submit subscrition form - i get error:
Знімок екрана з 2024-10-10 09-50-05

How i can fix that?

Try dropping the single quotes, and in docker compose it’s YAML with
- option: value, two spaces indent, and environment vars does not get the hyphen for some reason

     environment:
       mail__options__auth__pass: 12345abc
       mail__options__auth__user: smtp-user
       mail__options__host: smtp.gateway.com
       mail__options__port: 587

etc

1 Like


Still have same issue with same error

Port? 587 starts unencrypted and upgrades to encrypted.
465 starts with SSL

Here’s Perplexity…

Encryption Method:

  • Port 465: Implicit SSL/TLS (always encrypted)
  • Port 587: Explicit TLS via STARTTLS (upgradeable)

Connection Establishment:

  • Port 465: Secure connection from the start
  • Port 587: Starts unencrypted, then upgrades to secure,

Standardization:

  • Port 587: Widely recommended as the standard for email submission
    2

    4
  • Port 465: Less standardized, but still supported by many providers

Flexibility:

  • Port 587: More flexible, can work with both encrypted and unencrypted connections
  • Port 465: Less flexible, requires SSL/TLS support