Repository navigation
Conversation
Split notification mail from system mail: the Email notification channel now sends through each user's own `notification_configs.email_config` SMTP account instead of the global `sendEmail()` settings. - email.ts: extract the SMTP send path into a reusable `sendSmtpMail(config, options)`; `sendViaSMTP` (system mail) now delegates to it, unchanged behavior. Export `SMTPConfig` / `EmailOptions` / `isValidEmail`. - email-notify.ts: read `smtp_host` / `smtp_port` / `smtp_username` / `smtp_password` / `smtp_from`, send via `sendSmtpMail`; empty `smtp_host` returns "Email channel SMTP not configured" with no system-mail fallback; sender is `smtp_from || smtp_username`; port 465 = implicit TLS, otherwise STARTTLS (same logic as before). - test/email-notify.test.ts: cover config validation, field mapping and SMTP error relay.
Contributor
Author
Contributor
Author
|
按用户拍板(ONE-25 评论「用 135」),本 PR 关闭、不再合并。 同一范围的实现保留在 #135(ONE-25,分支 (上一条自动关闭评论因 shell 展开了反引号导致文案残缺,以此条为准。)ONE-21 单由 Mike 按重复单收口。 |
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.
变更
Email 通知渠道改为使用每用户自配 SMTP(
notification_configs.email_config),不再复用全局系统邮件的sendEmail()。worker/src/services/email.ts:把 SMTP 发送逻辑抽成可复用函数sendSmtpMail(config: SMTPConfig, options: EmailOptions);系统邮件sendViaSMTP改为调用它,行为不变。导出SMTPConfig/EmailOptions/isValidEmail。worker/src/services/notify/email-notify.ts:读取smtp_host/smtp_port/smtp_username/smtp_password/smtp_from,用sendSmtpMail发送;smtp_host为空时返回Email channel SMTP not configured,不回落系统邮件;发件人取smtp_from || smtp_username;端口 465 = 隐式 TLS,其余 STARTTLS(沿用原逻辑)。worker/test/email-notify.test.ts:新增 8 条单测(配置校验、字段映射、SMTP 错误透传)。系统/安全邮件路径(
routes/auth.ts、services/twofa.ts、routes/admin.ts)未改动。自测
pnpm typecheck通过(webtsc -b+ workertsc --noEmit)pnpm test通过:7 个测试文件 / 62 条测试(其中本单新增 8 条)