验证 IMAP
POST
/web/v1/notification/email/validate/imapWEB通过尝试连接和认证来验证 IMAP 邮件服务器配置。
鉴权
需要有效的 JWT token 和 Turnstile 验证。Gateway 校验:enableJwtToken=true, enableTurnstile=true。
请求参数
查询参数
| Name | Type | Required | In | Description |
|---|---|---|---|---|
requestId | string | Yes | query | 用于幂等性/跟踪的唯一请求 ID |
请求体
EmailValidationRequest:
| Name | Type | Required | In | Description |
|---|---|---|---|---|
channelHost | string | Yes | body | 通知渠道主机/接入端点 |
config | object | Yes | body | 要验证的邮箱渠道配置 |
config.username | string | Yes | body | IMAP 认证用户名 |
config.password | string | Yes | body | IMAP 认证密码 |
config.imapHost | string | Yes | body | IMAP 服务器主机名 |
config.imapPort | integer | Yes | body | IMAP 服务器端口(1-65535) |
config.useSsl | boolean | No | body | 使用 SSL(默认:true) |
config.connectionTimeout | integer | No | body | 连接超时时间(毫秒,默认:10000) |
config.readTimeout | integer | No | body | 读取超时时间(毫秒,默认:30000) |
成功响应
成功200
{
"code": "2000",
"message": "SUCCESS",
"data": {
"valid": true,
"results": {
"IMAP": {
"success": true,
"serverHost": "imap.example.com",
"serverPort": 993,
"connectionTimeMs": 312,
"errorCode": null,
"errorMessage": null
}
}
}
}错误响应
| 错误码 | 描述 |
|---|---|
4000 | 校验错误(缺少必填配置字段) |
4010 | 未授权(JWT token 无效或缺失) |
4030 | Turnstile 验证失败 |
说明
- 此接口仅测试 IMAP 连接。如需测试 SMTP 连通性,请使用 SMTP 验证接口。
requestId查询参数可用于幂等性和请求跟踪。- 验证成功不会创建或修改任何渠道。