mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[PR #5891] fix: allow empty MAILER_SMTP_USER and MAILER_SMTP_PASSWORD for unauthenticated SMTP #5398
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5398
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/5891
Author: @danielalanbates
Created: 2/20/2026
Status: 🔄 Open
Base:
main← Head:fix/issue-4586📝 Commits (1)
6b3b49cfix: allow empty MAILER_SMTP_USER and MAILER_SMTP_PASSWORD for unauthenticated SMTP📊 Changes
3 files changed (+19 additions, -18 deletions)
View changed files
📝
packages/hoppscotch-backend/src/infra-config/helper.ts(+0 -2)📝
packages/hoppscotch-backend/src/infra-config/infra-config.service.ts(+5 -4)📝
packages/hoppscotch-backend/src/mailer/helper.ts(+14 -12)📄 Description
Summary
Fixes #4586
SMTP servers on internal networks often don't require authentication. When
MAILER_USE_CUSTOM_CONFIGS=true, settingMAILER_SMTP_USER=andMAILER_SMTP_PASSWORD=to empty strings causes hoppscotch to reject the configuration as invalid and fail to start withauth/provider_not_configured_correctly.This PR makes
MAILER_SMTP_USERandMAILER_SMTP_PASSWORDoptional so that unauthenticated SMTP configurations are accepted.Changes
packages/hoppscotch-backend/src/infra-config/helper.ts: RemovedMAILER_SMTP_USERandMAILER_SMTP_PASSWORDfrom the required auth provider configuration keys, since they are not needed for unauthenticated SMTP.packages/hoppscotch-backend/src/infra-config/infra-config.service.ts:MAILER_SMTP_USERandMAILER_SMTP_PASSWORDfrom theisServiceConfigured()truthiness check, so empty values no longer cause the EMAIL provider to be considered unconfigured.MAILER_SMTP_USERandMAILER_SMTP_PASSWORDinvalidateEnvValues()that allows empty strings (previously they fell through to a case that rejected empty values).packages/hoppscotch-backend/src/mailer/helper.ts: Only includes theauthobject in the nodemailer transport options when a user or password is actually provided. When both are empty, theauthproperty is omitted entirely, which tells nodemailer to connect without authentication.Test plan
.envwithMAILER_USE_CUSTOM_CONFIGS=true,MAILER_SMTP_USER=,MAILER_SMTP_PASSWORD=and verify the app starts without errorThis PR was created with the assistance of Claude Opus 4.6 by Anthropic. Happy to make any adjustments! Reviewed and submitted by a human.
Summary by cubic
Accept empty MAILER_SMTP_USER and MAILER_SMTP_PASSWORD to support unauthenticated SMTP when MAILER_USE_CUSTOM_CONFIGS=true. This prevents startup failures and lets nodemailer connect without auth when both are empty.
Written for commit
6b3b49c850. Summary will update on new commits.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.