Skip to content

Email auth not required - #3890

Open
shlokmestry wants to merge 3 commits into
bluewave-labs:developfrom
shlokmestry:email-auth-not-required
Open

Email auth not required#3890
shlokmestry wants to merge 3 commits into
bluewave-labs:developfrom
shlokmestry:email-auth-not-required

Conversation

@shlokmestry

Copy link
Copy Markdown

Describe your changes

The email settings form required an SMTP password before a test email could be sent or the "Send Test Email" button enabled, even though the backend already treats systemEmailPassword as optional. Providers like Google Workspace that use IP allowlisting instead of SMTP auth have no password to enter, so the form blocked a valid configuration.

  • Removed the password requirement from the pre-flight check in handleSendTestEmail and from the "Send Test Email" button's disabled condition — only host, port, and address remain required.
  • Fixed a regression this introduced: when a password is already saved server-side, the (hidden) password field defaults to "", so the test-email request would silently send an empty password and could break a working authenticated config. systemEmailPassword is now only included in the payload when the user actually enters one, matching the existing pattern used for the other optional email fields.

Write your issue number after "Fixes "

Fixes #3866

  • (Do not skip this or your PR will be closed) I deployed the application locally.
  • (Do not skip this or your PR will be closed) I have performed a self-reviewing and testing of my code.
  • I have included the issue # in the PR.
  • I have added i18n support to visible strings (instead of <div>Add</div>, use): n/a — no new UI strings added
  • I have not included any files that are not related to my pull request, including package-lock and package-json if dependencies have not changed
  • I didn't use any hardcoded values (otherwise it will not scale, and will make it difficult to maintain consistency across the application).
  • I made sure font sizes, color choices etc are all referenced from the theme. I don't have any hardcoded dimensions.
  • My PR is granular and targeted to one specific feature.
  • I ran npm run format in server and client directories, which automatically formats your code.
  • I took a screenshot or a video and attached to this PR if there is a UI change.****

claude added 2 commits August 26, 2026 19:56
Google Workspace and other providers that use IP allowlisting instead
of SMTP auth don't need a password, but the settings form blocked
sending a test email or enabling the send button unless one was
entered. Backend already treats systemEmailPassword as optional.

Fixes bluewave-labs#3866

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013JWcKM6uh6S9VnVmTEpNNi
…email

The test-email button no longer requires a password, but the form's
systemEmailPassword default is always "" when a password is already
saved (the backend never echoes it back, only an emailPasswordSet
flag). Sending it unconditionally meant clicking "Send Test Email"
without re-entering credentials silently posted an empty password,
overriding a working authenticated config for that test. Only include
systemEmailPassword in the test-email payload when the user actually
typed one, matching the existing conditional pattern for the other
optional email fields.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013JWcKM6uh6S9VnVmTEpNNi

@sanmaxdev sanmaxdev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: this removes the client-side password requirement, but EmailService still always passes an auth object with user: systemEmailUser || systemEmailAddress and the optional password. Nodemailer treats that shape as LOGIN even when the password is absent, so an IP-allowlisted relay still attempts SMTP authentication.

Please omit auth from the transport configuration when no credentials are configured, and add a unit test for the no-auth transport shape in emailService.test.ts.

nodemailer treats the presence of an `auth` object as a request for
LOGIN authentication, even when `pass` is empty/undefined, so relays
that use IP allowlisting instead of SMTP auth (e.g. Google Workspace)
would still have authentication attempted against them and fail. Only
attach `auth` to the transport config when systemEmailPassword is
actually set, and add unit tests covering both the no-auth and
with-auth transport shapes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013JWcKM6uh6S9VnVmTEpNNi
@shlokmestry

Copy link
Copy Markdown
Author

@sanmaxdev Thanks for the catch - fixed in 46a822d. auth is now only attached to the nodemailer transport config when systemEmailPassword is actually set, so an IP-allowlisted relay (no password configured) no longer triggers LOGIN auth. Also added unit tests covering both the no-auth and with-auth transport shapes in emailService.test.ts. Ready for another look.

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

Successfully merging this pull request may close these issues.

Email auth required but should not be

3 participants