-
Notifications
You must be signed in to change notification settings - Fork 24
Hello :), me again
is it possible to make following settings optional?
#SMTP_USER=smtp_user@example.cpm
#SMTP_PASSWORD=Password123
The main problem is that:
- we are putting our personal email info in plain text file
- we need to create dedicated email account just for app to auth to our mail system(postfix in my case)
Can you add a mechanism which will override these settings or somehow mask it (with hash or similar) so we can add our email account info sefely?
Thank you in advance.
All reactions
Replies: 2 comments 3 replies
Hello @krish-kant,
I pulled latest beta version (1.3.0-canary.8) and tried to reconfigure SMTP settings using relay method but it doesn't work. Are you still working on this or maybe I'm doing something wrong on my side? I've tried following "versions" of SMTP settings but it doesnt work.
OPTIONAL: Email Notifications (SMTP)
SMTP_HOST=localhost
SMTP_PORT=25
SMTP_USER=
SMTP_PASSWORD=
SMTP_FROM_EMAIL=notifications-supercheck@mydomain.com
SMTP_SECURE=false
OPTIONAL: Email Notifications (SMTP)
SMTP_HOST=smtp.mydomain.com
SMTP_PORT=587
SMTP_USER=
SMTP_PASSWORD=
SMTP_FROM_EMAIL=notifications-supercheck@mydomain.com
SMTP_SECURE=false
I also added docker networks to mynetworks list inside VMs postifx config (/etc/postifix/main.cf) but it doesn't helps.
In docker logs I'm getting:
"Failed to resend invitation email to user@mydomain.com: SMTP authentication is partially configured (set both SMTP_USER and SMTP_PASSWORD, or leave both unset)"
All reactions
@ijonjic11 For a trusted internal Postfix relay without authentication please try these settings
SMTP_HOST=<reachable postfix host from container>
SMTP_PORT=25
SMTP_SECURE=false
SMTP_FROM_EMAIL=notifications-supercheck@mydomain.com
# Leave both auth fields empty/unset
SMTP_USER=
SMTP_PASSWORD=
Try these steps:
-
Verify runtime values: Run this command to check what the app container actually sees:
docker compose exec app env | grep -E '^SMTP_(HOST|PORT|USER|PASSWORD|SECURE|FROM_EMAIL)='
-
Clear auth values: If one auth variable shows a value unexpectedly, ensure both
SMTP_USERandSMTP_PASSWORDare completely empty/unset in your.envfile. -
Restart containers: After making changes, restart the containers:
docker compose down && docker compose up -d -
Test connectivity: You can also test SMTP connectivity from the container:
docker compose exec app telnet $SMTP_HOST $SMTP_PORT
All reactions
Hello,
yeah all looks good now, the main problem was that when you set SMTP_USER and SMTP_PASSWORD to blank, app pull default values from docker compose file:
Command: docker compose exec app env | grep -E '^SMTP_(HOST|PORT|USER|PASSWORD|SECURE|FROM_EMAIL)='
SMTP_FROM_EMAIL=supercheck-dev-notify@mydomain.hr
SMTP_PORT=25
SMTP_SECURE=false
SMTP_HOST=smtp.mydomain.hr
SMTP_USER=resend
SMTP_PASSWORD=your-smtp-password-change-this-in-production
Change in docker compose file:
FROM
SMTP_USER: ${SMTP_USER:-resend}
SMTP_PASSWORD: ${SMTP_PASSWORD:-your-smtp-password-change-this-in-production}
TO
SMTP_USER: ${SMTP_USER:-}
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
Command (after changes): docker compose exec app env | grep -E '^SMTP_(HOST|PORT|USER|PASSWORD|SECURE|FROM_EMAIL)='
SMTP_FROM_EMAIL=supercheck-dev-notify@mydomain.hr
SMTP_PORT=25
SMTP_SECURE=false
SMTP_HOST=smtp.mydomain.hr
SMTP_USER=
SMTP_PASSWORD=
It would be good that you do these changes also,so we dont need to edit docker compose files just to delete these default values.
Thank you for the help and hint :).
All reactions
-
👍 1
@ijonjic11 Thanks, docker compose files are updated now, also new release tag v1.3.1 is available now.
All reactions
-
👍 1