Coder Social home page Coder Social logo

Comments (8)

wmnnd avatar wmnnd commented on August 16, 2024

Thank you for reporting this issue! Could you check if you have configured your system sender with the following environment variables?

  • MAILER_SMTP_HOST
  • MAILER_SMTP_USER
  • MAILER_SMTP_PASSWORD
  • MAILER_SMTP_FROM_EMAIL

from keila.

maeries avatar maeries commented on August 16, 2024

That seems to do the trick. I didn't set MAILER_SMTP_FROM_EMAIL. Now I get a different error:

ops-keila-1     | 14:55:39.820 request_id=F1ohCoPKfG4NGwUAAAKF [info] POST /auth/reset
ops-keila-1     | 14:55:39.847 request_id=F1ohCoPKfG4NGwUAAAKF [info] Sent 500 in 26ms
ops-keila-1     | 14:55:39.847 [error] #PID<0.2689.0> running KeilaWeb.Endpoint (connection #PID<0.2677.0>, stream id 11) terminated
ops-keila-1     | Server: newsletterdomain.com:80 (http)
ops-keila-1     | Request: POST /auth/reset
ops-keila-1     | ** (exit) an exception was raised:
ops-keila-1     |     ** (Swoosh.DeliveryError) delivery error: {:retries_exceeded, {:network_failure, '172.32.20.2', {:error, :econnrefused}}}
ops-keila-1     |         (keila 0.12.1) lib/keila/mailer.ex:2: Keila.Mailer.deliver!/2
ops-keila-1     |         (keila 0.12.1) lib/keila/auth/auth.ex:630: Keila.Auth.send_password_reset_link/2
ops-keila-1     |         (keila 0.12.1) lib/keila_web/controllers/auth_controller.ex:110: KeilaWeb.AuthController.post_reset/2
ops-keila-1     |         (keila 0.12.1) lib/keila_web/controllers/auth_controller.ex:1: KeilaWeb.AuthController.action/2
ops-keila-1     |         (keila 0.12.1) lib/keila_web/controllers/auth_controller.ex:1: KeilaWeb.AuthController.phoenix_controller_pipeline/2
ops-keila-1     |         (phoenix 1.6.11) lib/phoenix/router.ex:354: Phoenix.Router.__call__/2
ops-keila-1     |         (keila 0.12.1) lib/keila_web/endpoint.ex:1: KeilaWeb.Endpoint.plug_builder_call/2
ops-keila-1     |         (keila 0.12.1) lib/keila_web/endpoint.ex:1: KeilaWeb.Endpoint.call/2

I'll check if maybe the port is wrong or something

Edit: Port 587 should be correct. I also tried to setup Authentication on the Postfix like this https://github.com/wader/postfix-relay#relay-client-authentication but the log is the same and it still gives an "Internal Server Error"

from keila.

wmnnd avatar wmnnd commented on August 16, 2024

Do you have the other environment variables configured and do they actually point to a real SMTP server?

from keila.

maeries avatar maeries commented on August 16, 2024

yes, i do. As an SMTP Server I'm using the postfix relay docker container. I used it with other docker stacks already and you usually only have to give it the server address as it doesn't require any encryption or authentication

from keila.

wmnnd avatar wmnnd commented on August 16, 2024

The error message says that the connection to the SMTP server failed. So maybe you also need to configure MAILER_SMTP_PORT.

from keila.

maeries avatar maeries commented on August 16, 2024

I had MAILER_SMTP_PORT set to 587 and just tried 25. Now I have a different error message again

ops-keila-1     | 10:24:05.159 request_id=F1ubH3TSEW9k8VEAAAUE [info] POST /auth/reset
ops-postfix-1   | 2023-05-03T10:24:05.186855+00:00 446d336f145d postfix/smtpd[148]: connect from ops-keila-1.ops_default[172.32.26.4]
ops-postfix-1   | 2023-05-03T10:24:05.190391+00:00 446d336f145d postfix/smtpd[148]: warning: ops-keila-1.ops_default[172.32.26.4]: SASL CRAM-MD5 authentication failed: authentication failure
ops-postfix-1   | 2023-05-03T10:24:06.832484+00:00 446d336f145d postfix/smtpd[148]: warning: ops-keila-1.ops_default[172.32.26.4]: SASL LOGIN authentication failed: authentication failure
ops-postfix-1   | 2023-05-03T10:24:08.607568+00:00 446d336f145d postfix/smtpd[148]: warning: SASL authentication failure: Password verification failed
ops-postfix-1   | 2023-05-03T10:24:08.607613+00:00 446d336f145d postfix/smtpd[148]: warning: ops-keila-1.ops_default[172.32.26.4]: SASL PLAIN authentication failed: authentication failure
ops-postfix-1   | 2023-05-03T10:24:08.608960+00:00 446d336f145d postfix/smtpd[148]: warning: unknown smtpd restriction: ""permit_sasl_authenticated"
ops-postfix-1   | 2023-05-03T10:24:08.609005+00:00 446d336f145d postfix/smtpd[148]: NOQUEUE: reject: RCPT from ops-keila-1.ops_default[172.32.26.4]: 451 4.3.5 Server configuration error; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<60412ec5df5c>
ops-keila-1     | 10:24:08.610 request_id=F1ubH3TSEW9k8VEAAAUE [info] Sent 500 in 3450ms
ops-postfix-1   | 2023-05-03T10:24:08.611691+00:00 446d336f145d postfix/cleanup[151]: 94F00AB870: message-id=<[email protected]>
ops-keila-1     | 10:24:08.610 [error] #PID<0.2692.0> running KeilaWeb.Endpoint (connection #PID<0.2677.0>, stream id 14) terminated
ops-keila-1     | Server: newsletter.domain.com:80 (http)
ops-keila-1     | Request: POST /auth/reset
ops-keila-1     | ** (exit) an exception was raised:
ops-keila-1     |     ** (Swoosh.DeliveryError) delivery error: {:send, {:temporary_failure, '172.32.26.2', "451 4.3.5 Server configuration error\r\n"}}
ops-keila-1     |         (keila 0.12.1) lib/keila/mailer.ex:2: Keila.Mailer.deliver!/2
ops-keila-1     |         (keila 0.12.1) lib/keila/auth/auth.ex:630: Keila.Auth.send_password_reset_link/2
ops-keila-1     |         (keila 0.12.1) lib/keila_web/controllers/auth_controller.ex:110: KeilaWeb.AuthController.post_reset/2
ops-keila-1     |         (keila 0.12.1) lib/keila_web/controllers/auth_controller.ex:1: KeilaWeb.AuthController.action/2
ops-keila-1     |         (keila 0.12.1) lib/keila_web/controllers/auth_controller.ex:1: KeilaWeb.AuthController.phoenix_controller_pipeline/2
ops-keila-1     |         (phoenix 1.6.11) lib/phoenix/router.ex:354: Phoenix.Router.__call__/2
ops-keila-1     |         (keila 0.12.1) lib/keila_web/endpoint.ex:1: KeilaWeb.Endpoint.plug_builder_call/2
ops-keila-1     |         (keila 0.12.1) lib/keila_web/endpoint.ex:1: KeilaWeb.Endpoint.call/2
ops-postfix-1   | 2023-05-03T10:24:08.628793+00:00 446d336f145d postfix/smtpd[148]: disconnect from ops-keila-1.ops_default[172.32.26.4] ehlo=1 auth=0/3 mail=1 rcpt=0/1 quit=1 commands=3/7
ops-postfix-1   | 2023-05-03T10:24:08.628930+00:00 446d336f145d postfix/qmgr[145]: 94F00AB870: from=<[email protected]>, size=1566, nrcpt=1 (queue active)
ops-postfix-1   | 2023-05-03T10:24:08.653818+00:00 446d336f145d postfix/smtp[152]: 94F00AB870: to=<[email protected]>, orig_to=<postmaster>, relay=none, delay=0.03, delays=0.02/0/0.01/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=smtp.domain.com type=AAAA: Host not found)
ops-postfix-1   | 2023-05-03T10:24:08.654528+00:00 446d336f145d postfix/bounce[154]: warning: 94F00AB870: undeliverable postmaster notification discarded
ops-postfix-1   | 2023-05-03T10:24:08.654979+00:00 446d336f145d postfix/qmgr[145]: 94F00AB870: removed

Btw: That's my current docker-compose.yml and basically all the configuration there is:


version: "3"

services:
  keila:
    image: pentacent/keila:latest
    restart: unless-stopped
#    ports:
#      - "4000:4000"
    depends_on:
      - postgres
      - postfix
    build:
      context: ../
      dockerfile: ops/Dockerfile
    environment:
      SECRET_KEY_BASE: "blablabla"
      DB_URL: "postgres://postgres:postgres@postgres/postgres"
      URL_HOST: "newsletter.domain.com"
      MAILER_SMTP_HOST: "postfix"
      MAILER_SMTP_USER: "postfix"
      MAILER_SMTP_PASSWORD: "mypassword"
      MAILER_SMTP_FROM_EMAIL: "[email protected]"
      MAILER_SMTP_PORT: "25"
      DISABLE_REGISTRATION: "True"
      KEILA_USER: "[email protected]"
      KEILA_PASSWORD: "somepassword"
    networks:
      - caddy_net
      - default

  postgres:
    image: postgres:15-alpine
#    ports:
#      - "5432:5432"
    environment:
      POSTGRES_PASSWORD: postgres
    volumes:
      - ./postgres-data:/var/lib/postgresql/data

  postfix:
    image: mwader/postfix-relay
    environment:
      - POSTFIX_myhostname=smtp.domain.com
      - SASL_Passwds=/etc/postfix/sasl/sasl_passwds
      - POSTFIX_cyrus_sasl_config_path=/etc/postfix/sasl
      - POSTFIX_smtpd_sasl_local_domain=smtp.domain.com
      - POSTFIX_smtpd_sasl_auth_enable=yes
      - POSTFIX_broken_sasl_auth_clients=yes
      - POSTFIX_smtpd_sasl_security_options=noanonymous
      - POSTFIX_smtpd_recipient_restrictions="permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination"
    volumes:
      - ./postfix-data/lib-postfix:/var/lib/postfix
      - ./postfix-data/mail:/var/mail
      - ./postfix-data/spool-postfix:/var/spool/postfix
      - ./postfix-data/keys:/etc/opendkim/keys
      - ./postfix-data/passwd_file:/etc/postfix/sasl/sasl_passwds

networks:
  caddy_net:
    external: true

from keila.

maeries avatar maeries commented on August 16, 2024

Forget what I just said. The above error is because I tried to enable authentication on the postfix-relay. I just disabled it again and now it works

from keila.

wmnnd avatar wmnnd commented on August 16, 2024

Glad to hear it’s working now!

from keila.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.