feat(notifications): allow SMTP without authentication#4844
Open
hbilal9 wants to merge 1 commit into
Open
Conversation
Some SMTP relays (e.g. Google SMTP Relay with IP allowlisting) do not use username/password authentication. Make both fields optional in the email notification form and API schema, and only pass auth to nodemailer when credentials are provided. Closes Dokploy#4842
AminDhouib
added a commit
to DevinoSolutions/dokploy-community
that referenced
this pull request
Jul 18, 2026
Drop NOT NULL on the email table's username/password columns so the "SMTP without authentication" feature can persist genuinely empty credentials, and add migration 0192 (idempotent ALTER ... DROP NOT NULL, additive-relaxing) in the next free journal slot after 0191. Upstream Dokploy#4844 kept the columns NOT NULL and coerced the form to ""; this fork makes the schema match the relaxed intent so credential-less SMTP relays are represented as NULL rather than empty strings. Loading an existing email notification coerces the now-nullable username/password to undefined for the form.
AminDhouib
added a commit
to DevinoSolutions/dokploy-community
that referenced
this pull request
Jul 18, 2026
port: feat(notifications): allow SMTP without authentication (upstream Dokploy#4844)
Author
|
Hi @Siumauricio, gentle bump on this one when you have a moment. It closes #4842 (unauthenticated SMTP relays like Google SMTP Relay). The change is small — username/password are made optional and auth is only passed to nodemailer when credentials are provided, so existing authenticated setups are unaffected and no DB migration is needed. Since this is my first PR here, the CI checks are waiting on a workflow-run approval — happy to make any changes you'd like. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #4842
Some SMTP relays — e.g. Google SMTP Relay configured with IP allowlisting — do not use username/password authentication. Dokploy currently force-requires both fields when configuring an email notification, which makes those relays unusable.
This PR makes SMTP credentials optional:
handle-notifications.tsx:usernameandpasswordare now optional in the email form schema, with a hint that they can be left blank when the server doesn't require authentication. Empty values are sent as""so no DB migration is needed (columns stayNOT NULL).packages/server/src/db/schema/notification.ts: dropped.min(1)fromusername/passwordinapiCreateEmail(inherited byapiUpdateEmailandapiTestEmailConnection).packages/server/src/utils/notifications/utils.ts:sendEmailNotificationonly passesauthtonodemailer.createTransportwhen both credentials are non-empty; nodemailer treats a missingauthkey as unauthenticated SMTP. This covers both real notifications and the Test Connection button, which routes through the same function.Behavior
auth, so unauthenticated relays work.Testing
pnpm --filter=@dokploy/server typecheckandpnpm --filter=dokploy typecheckpass.biome checkclean on the touched files (one pre-existing formatting drift elsewhere inhandle-notifications.tsxleft untouched).