Skip to content

feat(email): 邮件服务只留自定义 SMTP,Brevo 下线 - #109

Merged
fxbin merged 3 commits into
mainfrom
issue-108-remove-brevo
Oct 11, 2026
Merged

fxbin merged 3 commits into
mainfrom
issue-108-remove-brevo

Conversation

@fxbin

@fxbin fxbin commented Oct 11, 2026

Copy link
Copy Markdown
Owner

What & why

自定义 SMTP(企业邮箱/自建)已足够覆盖事务邮件(注册验证码)需求,Brevo 的第三方 API 与账号审核流程不再保留。本 PR 移除 Brevo provider:删 brevo_provider.py 与 factory 双分支,settings API 删 api_key 相关字段,前端邮件面板固定为 SMTP 单表单,README 双语同步。

存量 brevo 配置显式降级,不留兼容路径:GET 归一展示为未配置、发送侧 factory 记 warning 后按未配置处理(验证码请求报「邮件服务未配置」),管理员重配 SMTP 后恢复;PUT 传 brevo 得到带指引的 400。

Fixes #108

Area

  • backend
  • frontend
  • docs

Verification

  • python -m pytest <relevant> -q passes
    • 新增 tests/test_email_smtp_only.py 5/5:brevo 400(含错误文案)、SMTP 必填校验、往返脱敏 + 密码留空保留、存量 brevo 配置 GET 归一 + factory 降级、SMTP 工厂闭环
    • 邻近回归 test_email_verification_cleanup / test_admin_api_permissions 全过
    • 后端全量 make test-backend(一次性 PG,端口 5439):exit 0,无 FAILED
  • npx tsc --noEmit passes
  • npm run test:coverage passes(含覆盖率门禁)
  • ruff check + format / check_agent_docs.py / check_layering.py 全过

Verifier verdict

行为变更切片;CI 六项为机器 Verifier(自 #106 起 security-scan 已恢复可判绿),全量后端 + 前端双门禁本地已过。存量配置降级行为有专项断言(显式 warning + None,不静默)。

Checklist

  • Commits follow Conventional Commits
  • Branch named issue-108-remove-brevo;正文 Fixes #108
  • No local-only files staged
  • New source connector? N/A
  • Docs updated(README × 2)

Notes for reviewer

  • 升级影响:此前用 Brevo 收验证码的部署,升级后邮件不可用(后台会显示未配置 + 后端日志 warning),需管理员在后台重配 SMTP——这是有意为之的显式降级,见 issue 讨论。
  • DB 里的 email_provider_config JSON 未做迁移:存量行留着无害(读取路径忽略非 smtp 并告警),重新保存时整体覆盖。

fxbin added 3 commits October 11, 2026 20:34
删 brevo_provider 与 factory 双分支;存量 brevo 配置在读取与
发送两侧都显式降级(warning + 按未配置处理),不做静默兼容。
settings API 删 api_key 相关字段,PUT 传 brevo 明确 400 提示改配
SMTP。
删 provider 下拉、Brevo 指引与 API Key 输入;类型同步删
api_key / supported_providers 字段。
@fxbin
fxbin merged commit a058162 into main Oct 11, 2026
6 checks passed
@fxbin
fxbin deleted the issue-108-remove-brevo branch October 11, 2026 13:08
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.

邮件服务移除 Brevo,仅保留自定义 SMTP

1 participant