Skip to content

验证 SMTP

POST/web/v1/notification/email/validate/smtpWEB

通过尝试连接和认证来验证 SMTP 邮件服务器配置。

鉴权

需要有效的 JWT token 和 Turnstile 验证。网关校验:enableJwtToken=trueenableTurnstile=true

请求参数

查询参数

NameTypeRequiredInDescription
requestIdstringYesquery用于幂等性/追踪的唯一请求 ID

请求体

EmailValidationRequest

NameTypeRequiredInDescription
channelHoststringYesbody通知渠道主机/访问端点
configobjectYesbody要验证的邮箱渠道配置
config.smtpHoststringYesbodySMTP 服务器主机名
config.smtpPortintegerYesbodySMTP 服务器端口(1-65535)
config.senderEmailstringYesbody发件人邮箱地址
config.senderNamestringYesbody发件人显示名称
config.usernamestringYesbodySMTP 认证用户名
config.passwordstringYesbodySMTP 认证密码
config.useSslbooleanNobody是否使用 SSL(默认值:true)
config.useStartTlsbooleanNobody是否使用 STARTTLS(默认值:false)
config.connectionTimeoutintegerNobody连接超时时间(毫秒,默认值:10000)
config.readTimeoutintegerNobody读取超时时间(毫秒,默认值:30000)

成功响应

成功200
{
  "code": "2000",
  "message": "SUCCESS",
  "data": {
    "valid": true,
    "results": {
      "SMTP": {
        "success": true,
        "serverHost": "smtp.example.com",
        "serverPort": 587,
        "connectionTimeMs": 245,
        "errorCode": null,
        "errorMessage": null
      }
    }
  }
}

错误响应

错误码描述
4000校验错误(缺少必填配置字段)
4010未授权(无效或缺少 JWT token)
4030Turnstile 验证失败

说明

  • 此接口仅测试 SMTP 连接。如需测试 IMAP 连接,请使用 IMAP 验证接口。
  • requestId 查询参数可用于幂等性和请求追踪。
  • 验证成功不会创建或修改任何渠道。

内部文档