Email Verification with Self-Hosted

(#642) Bug Needs triage self-hosting

Thread

Comment by @Gaarindor
RexSystem 1 vote originally by @Gaarindor on GitHub
I am getting a very similar error using Proton Mail as my SMTP provider and have managed to patch the container to make it work. Only a temp solution while the containers are up. Error in logs:
{"level":"error","time":"2026-06-21T00:25:56.366Z","service":"@pkgs/email/src/SmtpEmailProvider","env":"production","error":{"type":"Error","message":"401D5C8A577F0000:error:0A00010B:SSL routines:tls_validate_record_header:wrong version number:../deps/openssl/openssl/ssl/record/methods/tlsany_meth.c:77:\n","stack":"Error: 401D5C8A577F0000:error:0A00010B:SSL routines:tls_validate_record_header:wrong version number:../deps/openssl/openssl/ssl/record/methods/tlsany_meth.c:77:\n","library":"SSL routines","reason":"wrong version number","code":"ESOCKET","command":"CONN"},"msg":"SMTP send failed"}
To get it working I have set the below: .env
FLUXER_EMAIL_ENABLED=true
FLUXER_EMAIL_PROVIDER=smtp
FLUXER_EMAIL_FROM_EMAIL=support@example.com
FLUXER_EMAIL_FROM_NAME=Fluxer Support
FLUXER_EMAIL_SMTP_HOST=smtp.protonmail.ch
FLUXER_EMAIL_SMTP_PORT=587
FLUXER_EMAIL_SMTP_USERNAME=support@example.com
FLUXER_EMAIL_SMTP_PASSWORD=xxxxxxxxxxxxxxx
FLUXER_EMAIL_SMTP_SECURE=false
In the api container fluxer-api-1 I am getting issues against the SmtpEmailProvider.ts file. It seems like the boolean isn't working as expected. usr/src/app/fluxer_api/node_modules/.pnpm/@pkgs+email@file+fluxer_api+pkgs+email/node_modules/@pkgs/email/src/SmtpEmailProvider.ts In SmtpEmailProvider.ts secure: config.secure ?? true is not passing correctly for me. I patched the api container to update it to secure: config.secure !== undefined ? config.secure === "true" : true" and restarted the api container. It is now working. Replicate: api container
# Patch
docker exec fluxer-api-1 sed -i 's/secure: config.secure ?? true/secure: config.secure !== undefined ? config.secure === "true" : true/g' /usr/src/app/fluxer_api/node_modules/.pnpm/@pkgs+email@file+fluxer_api+pkgs+email/node_modules/@pkgs/email/src/SmtpEmailProvider.ts

# Verify
docker exec fluxer-api-1 grep "secure:" /usr/src/app/fluxer_api/node_modules/.pnpm/@pkgs+email@file+fluxer_api+pkgs+email/node_modules/@pkgs/email/src/SmtpEmailProvider.ts

# Restart just the API
docker compose restart api
and worker as well
docker exec fluxer-worker-1 sed -i 's/secure: config.secure ?? true/secure: config.secure !== undefined ? config.secure === "true" : true/g' /usr/src/app/fluxer_api/node_modules/.pnpm/@pkgs+email@file+fluxer_api+pkgs+email/node_modules/@pkgs/email/src/SmtpEmailProvider.ts

docker compose restart worker