feat(smtp): TLS-политика на SMTP-аккаунт - #60
Merged
Conversation
Each SMTP account can now set its own TLS policy instead of relying only on the global SMTP_TLS_REJECT_UNAUTHORIZED: - requireTls → force STARTTLS (fail if the relay won't upgrade) - rejectUnauthorized (nullable) → verify the relay cert; null inherits the global default - minTlsVersion → pin a floor (TLSv1.2 / TLSv1.3) - schema: three columns on smtp_accounts + migration 0019 - mailer: extract pure buildTransportOptions(account, globalReject) that maps the policy onto nodemailer (requireTLS + tls.rejectUnauthorized + tls.minVersion); createTransporter delegates to it - loader/repository/validators/DTO/serialize thread the fields through - ResourceTable: add a reusable `select` field type - UI: SMTP accounts form (require-STARTTLS checkbox, verification + min-version selects) + a TLS-policy column + en/ru i18n - MCP: create_/update_smtp_account gain the TLS fields - tests: buildTransportOptions unit (inherit/override/requireTLS/minVersion/ auth) + smtp-accounts integration (policy persisted + defaults) Closes #20 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Что это
Каждый исходящий SMTP-аккаунт может задать собственную TLS-политику вместо опоры только на глобальный
SMTP_TLS_REJECT_UNAUTHORIZED(закрывает #20). Последний пункт «Extending our edge».requireTls— форсировать STARTTLS (падать, если релей не апгрейдит соединение).rejectUnauthorized(nullable) — проверять сертификат релея;null= наследовать глобальный дефолт.minTlsVersion— минимальная версия (TLSv1.2/TLSv1.3).Surfaces: REST API + dashboard + MCP.
Изменения
smtp_accounts+ миграция0019.buildTransportOptions(account, globalReject)— мапит политику на nodemailer (requireTLS+tls.rejectUnauthorized+tls.minVersion);createTransporterделегирует ему.ResourceTable: добавлен переиспользуемый тип поляselect.create_/update_smtp_accountполучили TLS-поля.buildTransportOptions+ интеграционный (политика сохраняется + дефолты при пропуске).Проверки
typecheck·lint·format:check·vitest(534 ✓) ·ui typecheck/build·mcp typecheck/build— всё зелёное. Паритет ключей en/ru проверен.Заметка
Маппинг политики на nodemailer покрыт unit-тестами (чистая функция); фактическое TLS-поведение с реальным релеем — deploy-verified. Обратная совместимость: пропуск полей → безопасные дефолты.
Closes #20
🤖 Generated with Claude Code