Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP not working when using ENV variables #394

Open
TotalLag opened this issue Nov 22, 2024 · 2 comments
Open

SMTP not working when using ENV variables #394

TotalLag opened this issue Nov 22, 2024 · 2 comments

Comments

@TotalLag
Copy link

I'm self-hosting Docuseal using Docker Compose and following the official instructions for configuring environment variables. Here's how I'm setting up the SMTP configuration (variables are populated correctly, verified at the OS level):

      - SMTP_USERNAME=${SMTP_USER}
      - SMTP_ADDRESS=${SMTP_HOST}
      - SMTP_PORT=${SMTP_PORT}
      - SMTP_PASSWORD=${SMTP_PASSWORD}
      - SMTP_AUTHENTICATION=login
      - SMTP_FROM=${SMTP_FROM}
      - SMTP_ENABLE_STARTTLS_AUTO

Despite this setup, I’m unable to send emails. I've tried different combinations, like switching SMTP_AUTHENTICATION between login and plain, and enabling/disabling STARTTLS. However, when I omit the SMTP_ADDRESS variable to enable the email configuration via the UI and manually input the same SMTP details, it works fine.

I'm puzzled about what might be missing or misconfigured in the environment variables. Any ideas?

@omohokcoj
Copy link
Contributor

@TotalLag can you please check /jobs page to see if it contains failed email sending jobs with error messages?

@TotalLag
Copy link
Author

TotalLag commented Nov 28, 2024

@omohokcoj no changes I can observe in /jobs. It continues to show 3 processed and 0 across the board.

If I visit the /settings/email page and try to manually send using the ENV variables, I get Net::ReadTimeout with #<TCPSocket:(closed)> -- thinking this could be some escaping issue, when I set SMTP_ADDRESS="with.quotes.net" like this then I proceed to get getaddrinfo: Unrecognized service

This is what my environment looks like (I removed some variables for troubleshooting):

DATABASE_URL=postgresql://<redacted>@postgresql:5432/docuseal
SMTP_ADDRESS=smtp.<redacted>.net
HOSTNAME=<redacted>
SMTP_PORT=465
SHLVL=2
HOME=/root
COOLIFY_FQDN=<redacted>
BUNDLE_APP_CONFIG=/usr/local/bundle
BUNDLE_WITHOUT=development:test
SMTP_USERNAME=<redacted>@<redacted>.<redacted>
RUBY_DOWNLOAD_URL=https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.4.tar.xz
RUBY_VERSION=3.3.4
OPENSSL_CONF=/app/openssl_legacy.cnf
TERM=xterm
PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LANG=C.UTF-8
LD_PRELOAD=/lib/libgcompat.so.0
SMTP_FROM=<redacted>@<redacted>.<redacted>
HOST=https://<redacted>/
WORKDIR=/data/docuseal
COOLIFY_CONTAINER_NAME="<redacted>"
GEM_HOME=/usr/local/bundle
RAILS_ENV=production
COOLIFY_URL=<redacted>
RUBY_DOWNLOAD_SHA256=1caaee9a5a6befef54bab67da68ace8d985e4fb59cd17ce23c28d9ab04f4ddad
PWD=/data/docuseal
SMTP_PASSWORD=<redacted>
BUNDLE_SILENCE_ROOT_WARNING=1

The only thing I can see that's missing from the ENV that exist in the UI is an SMTP_SECURITY equivalent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants