Skip to content

Docker compose SMPT: MAIL_FROM_ADDRESS setting ignoredΒ #461

@itsamemarkus

Description

@itsamemarkus

Describe the bug
I changed the SMPT server for an existing asciinema docker compose installation. Asciinema sends the email but doesn't use the value defined in MAIL_FROM_ADDRESS as sender.
The email server that only accepts one sender rejects sending the mail.

(the previous mailserver didn't have this strict check)

To Reproduce
Steps to reproduce the behavior:

  1. Have an existing asciinema installation (I don't know if it affects new ones)
  2. Change the smpt server settings in docker compose (addresses and credentials modified)
    environment:
      - SECRET_KEY_BASE=mysecretkey
      - URL_HOST=terminal.mydomain.tld
      # - URL_PORT=80
      - URL_SCHEME=https
      - SMTP_HOST=the-email.server.tld
      - [email protected]
      - SMTP_PASSWORD=mypassword
      - DATABASE_URL=postgresql://postgres:mypassword@asciinema_postgres/asciinema
      - SIGN_UP_DISABLED=true
      - [email protected]
      # - [email protected]
  1. user enters his user name on the self hosted asciinema login page, triggering magic link
  2. Asciinema tries to send the mail
  3. Email server rejects the mail because it comes from hello@$URL_HOST (default value)

Expected behavior
MAIL_FROM_ADDRESS in docker-compose.yml is used to set the from address in the mail that gets send out.

Logs

(addresses and credentials modified)

asciinema log

21:07:29.656 [info] {"args":{"to":"[email protected]","type":"login","url":"https://terminal.mydomain.tld/session/new?t=sessiontoken"},"attempt":1,"duration":407779,"error":"** (ArgumentError) raise/1 and reraise/2 expect a module name, string or exception as the first argument, got: {:permanent_failure, '1.2.3.4', \"553 5.7.1 <[email protected]>: Sender address rejected: not owned by user [email protected]\\r\\n\"}","event":"job:exception","id":82148,"max_attempts":20,"meta":{},"queue":"emails","queue_time":8682,"source":"oban","state":"failure","tags":[],"worker":"Asciinema.Emails.Job"}

mailserver log

03/01/2025, 10:07:55 PM NOQUEUE: reject: RCPT from unknown[4.3.2.1]: 553 5.7.1 <[email protected]>: Sender address rejected: not owned by user [email protected]; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<hex-replaced>

Versions:

  • Server-OS: Ubuntu 22.04 current dist-upgrade, docker compose
  • asciinema server: ghcr.io/asciinema/asciinema-server:20240428
  • Edit: I also tested this later with current latest, which had the same behaviour sha256:07d4349c0f9ef259f36f39ffb9e3b571dd245d4fe459d9ee08cbdddd6ae90e82

Troubeshooting

  • docker compose down and up again
  • reboot docker host

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions