Skip to content

feat(settings): add auth and tls to the email sender - #122

Merged
github-actions[bot] merged 1 commit into
developfrom
1236-smtp-anonymous-tls
Oct 13, 2026
Merged

github-actions[bot] merged 1 commit into
developfrom
1236-smtp-anonymous-tls

Conversation

@lizzy-liang-bigstack

@lizzy-liang-bigstack lizzy-liang-bigstack commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

feature

Which issue(s) this PR fixes?

Part of bigstack-oss/cubecos#1239 (and the story bigstack-oss/cubecos#1236)

What this PR does?

Let the email sender describe an anonymous relay and an explicit TLS policy. Today EmailSenderResponse requires username, and no sender schema has a notion of authentication or transport encryption, so a site whose internal relay accepts anonymous submission and/or has no TLS cannot be represented.

  • New EmailSenderTls enum: none / opportunistic / mandatory. The names and values match bigstack-dependency-go/pkg/email/v2, which CMP already uses, so COS and CMP share one vocabulary.
  • EmailSenderResponse, EmailSenderPostRequest and EmailSenderPatchRequest each gain auth (boolean) and tls (EmailSenderTls). The response requires both.
  • username is no longer required in EmailSenderResponse.
  • Unset values on a request:
    • tls unset → mandatory, matching the v2 helper, so an old client never silently downgrades.
    • auth unset on POST → true if a username is given; on PATCH → the current value is kept.
  • The tls description states the alert-path limit: alert mail is sent by Kapacitor 1.5.7, which always upgrades to STARTTLS when the relay advertises it, so for alert mail the policy only decides whether the relay certificate is verified (mandatory) or not (none, opportunistic).
  • POST and PATCH gain an anonymousRelay example (auth: false, tls: none); the existing examples show auth: true, tls: mandatory.

Related PRs (same branch name 1236-smtp-anonymous-tls): bigstack-oss/cube-cos-api#682, bigstack-oss/cube-cos-ui#892 and bigstack-oss/cubecos#1810 — this spec lands first, and both consumers point their cube-cos-openapi submodule at it.

Test results (optional)

🤖 Generated with Claude Code

EmailSenderResponse, EmailSenderPostRequest and EmailSenderPatchRequest
carry auth (boolean) and tls (EmailSenderTls: none | opportunistic |
mandatory), the field names and values of bigstack-dependency-go
pkg/email/v2. username is no longer required in the response, so an
anonymous relay is representable. The POST and PATCH examples add an
anonymous relay without TLS.

An unset tls on a request means mandatory; an unset auth on POST means
"a username was given", and on PATCH keeps the current value. The tls
description records that alert mail, sent by Kapacitor, always upgrades
to STARTTLS when offered and only uses the policy for certificate
verification.

Part of bigstack-oss/cubecos#1236 and bigstack-oss/cubecos#1239.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lizzy Liang <lizzy.liang@bigstack.co>

@raven-pan raven-pan 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.

LGTM

@raven-pan

Copy link
Copy Markdown
Contributor

The backend code will be reviewed by @arasHi87.
So may need his opinion before merge. Thanks!

@traviswu-bigstack traviswu-bigstack added the done Merge the pull request label Oct 13, 2026
@github-actions
github-actions Bot merged commit a6e964b into develop Oct 13, 2026
4 checks passed
@Eandalf-Bigstack
Eandalf-Bigstack deleted the 1236-smtp-anonymous-tls branch October 13, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

done Merge the pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants