elestio-examples / lobster

Deploy Lobster on Elestio with CI/CD
0 stars 0 forks source link

script/mail_new_activity.rb:91:in `popen': No such file or directory - /usr/sbin/sendmail (Errno::ENOENT) #2

Open a1exus opened 4 weeks ago

a1exus commented 4 weeks ago

hello,

i'm trying to setup lobster, however even though SMTP_HOST, SMTP_USERNAME, SMTP_PASSWORD, SMTP_SENDER, SMTP_STARTTLS_AUTO are all set, i'm still seeing an error on the backend (looks like image is missing sendmail, hence unable to use "mail_new_activity" in order to send out an actually email(

alexus@gamma:~/lobster$ docker compose logs | head -15
lobster  | Current version: 20220806200248
lobster  | 2024-10-25 03:34:45 - Running cron jobs.
lobster  | Puma starting in single mode...
lobster  | * Puma version: 6.2.2 (ruby 3.2.2-p53) ("Speaking of Now")
lobster  | *  Min threads: 5
lobster  | *  Max threads: 5
lobster  | *  Environment: production
lobster  | *          PID: 17
lobster  | script/mail_new_activity.rb:91:in `popen': No such file or directory - /usr/sbin/sendmail (Errno::ENOENT)
lobster  |  from script/mail_new_activity.rb:91:in `block (2 levels) in <main>'
lobster  |  from script/mail_new_activity.rb:78:in `each'
lobster  |  from script/mail_new_activity.rb:78:in `block in <main>'
lobster  |  from /usr/local/bundle/gems/activerecord-7.0.4.3/lib/active_record/relation/delegation.rb:88:in `each'
lobster  |  from /usr/local/bundle/gems/activerecord-7.0.4.3/lib/active_record/relation/delegation.rb:88:in `each'
lobster  |  from script/mail_new_activity.rb:75:in `<main>'
alexus@gamma:~/lobster$

please advise

AmsellemJoseph commented 3 weeks ago

Hey @a1exus,

We are not using sendmail but custom smtp, if you are an Elestio customer, credentials are already set, if not, you can use postfix or another smtp sender.

a1exus commented 3 weeks ago

Hey @a1exus,

We are not using sendmail but custom smtp, if you are an Elestio customer, credentials are already set, if not, you can use postfix or another smtp sender.

i may be mistaken, but i dont think it'll make any difference.. because i too use custom/external smtp server (postfix), however the error states it's missing local sendmail to relay email to your SMTP server, and since it's missing NO SMTP operation will happen until it's get installed..

AmsellemJoseph commented 3 weeks ago

With the current configuration, I receive email for forgot password, invite customer and when someone write something. I cannot reproduce your issue. Maybe show me your current stack.

a1exus commented 3 weeks ago

With the current configuration, I receive email for forgot password, invite customer and when someone write something. I cannot reproduce your issue. Maybe show me your current stack.

i'm not elestio customer, perhaps this image only works for elestio ..

alexus@gamma:~/elestio$ cat docker-compose.yaml
services:
  lobster:
    container_name: lobster
    env_file: X.env
    expose:
      - 3000
    image: elestio/lobster:latest
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=traefik_traefik"
      - "traefik.http.routers.lobster.entrypoints=websecure"
      - 'traefik.http.routers.lobster.rule=Host(`X.com`)'
      - "traefik.http.routers.lobster.tls.certresolver=myresolver"
    networks:
      - mailserver
      - mariadb
      - traefik
    restart: always
networks:
  mailserver:
    name: mailserver_mailserver
    external: true
  mariadb:
    name: mariadb_mariadb
    external: true
  traefik:
    name: traefik_traefik
    external: true
alexus@gamma:~/elestio$
alexus@gamma:~/elestio$ cat X.env | grep -v ^# | cut -d: -f1
APP_DOMAIN
APP_NAME
APP_DOMAIN
DATABASE_URL
RAILS_ENV
RACK_ENV
RAILS_SERVE_STATIC_FILES
SECRET_KEY_BASE
SMTP_HOST
SMTP_USERNAME
SMTP_PASSWORD
SMTP_SENDER
SMTP_STARTTLS_AUTO
alexus@gamma:~/elestio$
jbenguira commented 3 weeks ago

i'm not elestio customer, perhaps this image only works for elestio ..

No it's not limited to Elestio

But I can see you have not filled the SMTP env vars like we do here: https://github.com/elestio-examples/lobster/blob/main/docker-compose.yml

      SMTP_HOST: ${SMTP_HOST}
      SMTP_PORT: ${SMTP_PORT}
      SMTP_STARTTLS_AUTO: "false"
      SMTP_USERNAME: ${SMTP_USERNAME}
      SMTP_PASSWORD: ${SMTP_PASSWORD}
      SMTP_SENDER: ${SMTP_SENDER}
a1exus commented 3 weeks ago

i'm not elestio customer, perhaps this image only works for elestio ..

No it's not limited to Elestio

But I can see you have not filled the SMTP env vars like we do here: https://github.com/elestio-examples/lobster/blob/main/docker-compose.yml

      SMTP_HOST: ${SMTP_HOST}
      SMTP_PORT: ${SMTP_PORT}
      SMTP_STARTTLS_AUTO: "false"
      SMTP_USERNAME: ${SMTP_USERNAME}
      SMTP_PASSWORD: ${SMTP_PASSWORD}
      SMTP_SENDER: ${SMTP_SENDER}

everything is filled, i just removed it from sharing private information public ;-)

i found 1 small issue, which i fixed and now while i don't get that msg anymore, I get different one

Could not send invitation, verify the e-mail address is valid.

i also tried to hit forgot page and got

HTTP ERROR 500

just like /about

a1exus commented 2 weeks ago

I was actually able to get SMTP to work somehow, however when I used "Reset your password", the link which was included inside of email is lobster.rs and not the domain from my APP_DOMAIN, any ideas?

jbenguira commented 2 weeks ago

I was actually able to get SMTP to work somehow, however when I used "Reset your password", the link which was included inside of email is lobster.rs and not the domain from my APP_DOMAIN, any ideas?

what did you changed to make SMTP work? since it's working on our side since the begining I guess something was missing on your side.

For us the lost password feature is sending the correct url based on this env var: https://github.com/elestio-examples/lobster/blob/d2ba66e2aa978acfa805040cbac472d7fc138b1d/docker-compose.yml#L26

a1exus commented 2 weeks ago

I was actually able to get SMTP to work somehow, however when I used "Reset your password", the link which was included inside of email is lobster.rs and not the domain from my APP_DOMAIN, any ideas?

what did you changed to make SMTP work? since it's working on our side since the begining I guess something was missing on your side.

while my submission port already had LE cert setup, I was accessing it with different from cert FQDN - (which in most client is able to overcome, same case is self signed certificate, but not this app) after updating SMTP_HOST to FQDN which matches my cert (instead of internal name), STARTTLS started to work properly.

For us the lost password feature is sending the correct url based on this env var:

https://github.com/elestio-examples/lobster/blob/d2ba66e2aa978acfa805040cbac472d7fc138b1d/docker-compose.yml#L26

but APP_DOMAIN IS set, yet app isn't respecting value from that variable and instead using lobste.rs as "default" value.

alexus@gamma:~/elestio$ docker inspect lobster-elestio | grep APP_DOMAIN
                "APP_DOMAIN=XXX.com",
alexus@gamma:~/elestio$