Closed Freddo3000 closed 6 months ago
Are you using the Keila Docker image and are you sure you’ve correctly set MAILER_SMTP_FROM_EMAIL
? That the mailer is using keila@localhost
sounds like either the system mailer is not configured properly or like you're not running a prod
release.
Could you try the following in IEx? (execute /opt/app/bin/keila remote
in your Keila container):
Application.get_env(:keila, Keila.Mailer)
|> IO.inspect()
|> Keyword.fetch!(:from_email)
|> IO.inspect()
Are you using the Keila Docker image and are you sure you’ve correctly set
MAILER_SMTP_FROM_EMAIL
? That the mailer is usingkeila@localhost
sounds like either the system mailer is not configured properly or like you're not running aprod
release.Could you try the following in IEx? (execute
/opt/app/bin/keila remote
in your Keila container):Application.get_env(:keila, Keila.Mailer) |> IO.inspect() |> Keyword.fetch!(:from_email) |> IO.inspect()
This is what it currently looks like
Did you set the env variable after starting Keila? It will only be picked up when you launch it.
Did you set the env variable after starting Keila? It will only be picked up when you launch it.
I don't know the inner workings of Nomad, but I've tried replacing the docker entrypoint with a simple print of the environment variable, and it displays correctly. For that matter, it connects correctly to the database and reads other settings set the same way.
For reference, this is what the .env template looks like:
URL_HOST=my.host
URL_SCHEMA=https
USER_CONTENT_DIR=/local/data
MAILER_TYPE=smtp
MAILER_SMTP_HOST=my.mail
MAILER_SMTP_PORT=1234
{{ with secret "path/to/secret" }}
MAILER_SMTP_USER="{{ .Data.metadata.custom_metadata.mail }}"
MAILER_SMTP_FROM_EMAIL="{{ .Data.metadata.custom_metadata.mail }}"
MAILER_SMTP_PASSWORD="{{ .Data.data.password }}"
{{end}}
MAILER_ENABLE_SSL=true
{{ with secret "path/to/secret" }}
SECRET_KEY_BASE="{{ .Data.data.secret_key_base }}"
KEILA_USER={{ .Data.metadata.custom_metadata.keila_user }}
{{end}}
MAILER_ENABLE_TLS=true
{{ with secret "database/creds/${VLT_KEILA_ROLE}" }}
DB_URL=postgres://{{ .Data.username }}:{{ .Data.password }}@my_host:5432/${DB_NAME}
{{ end }}
It looks like none of your env variables were available to Keila when it started. In your screenshot of the console, you can see that the only configuration item was from_email
which is set in the default config when there is no other config. It's missing all the other properties, including the mailer hostname, user, and password. But also, Keila should throw an error when you try to launch without a mailer configured.
Could you restart the container and take a closer look at the logs when Keila starts?
And after restarting it's still not working?
And after restarting it's still not working?
The above log was from a fresh restart.
Could you try this as well?
Application.get_env(:keila, Keila.Auth.Emails)
Could you try this as well?
Application.get_env(:keila, Keila.Auth.Emails)
Censored domains, passwords, etc.
Could you try the new release I’ve just published, 0.14.5?
New build appears to have resolved the issue
Yay :partying_face: Thanks for reporting this and helping me debug!
Receiving the below error whenever I try to create an account
Upon closer inspection it appears that Keila is ignoring the
MAILER_SMTP_FROM_EMAIL
environment variable, instead trying to set it to keila@localhost.