DKIM 密钥
DKIM Key 用于对指定域名发出的邮件进行数字签名。DKIM 让接收方能够验证邮件真实性,从而提升送达率。
Schema
interface DkimKey {
id: string; // "dkm_..." - Unique identifier
domain_id: string; // Associated domain
selector: string; // DNS selector (e.g., "default")
is_active: boolean; // Currently signing emails
dns_record_name: string; // Full DNS record name
dns_record_value: string; // Public key for DNS
created_at: string;
updated_at: string;
}
属性
| 属性 | 类型 | 说明 |
|---|---|---|
id | string | 带 dkm_ 前缀的 KSUID |
domain_id | string | 该密钥所属域名 ID |
selector | string | DKIM selector 前缀 |
is_active | boolean | 是否用于签名 |
dns_record_name | string | DNS TXT 记录名称 |
dns_record_value | string | DNS 中存储的公钥值 |
created_at | string | 创建时间戳 |
updated_at | string | 最后更新时间戳 |
DNS 配置
为 DKIM 添加 TXT 记录:
| Record Type | Name | Value |
|---|---|---|
| TXT | {selector}._domainkey.example.com | v=DKIM1; k=rsa; p={public_key} |
密钥轮换
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Create │────▶│ Activate │────▶│ Deactivate │
│ New Key │ │ New Key │ │ Old Key │
└─────────────┘ └─────────────┘ └─────────────┘
每个域名同一时间只能有一把激活密钥。
示例
{
"id": "dkm_2kHfPZcN9xW4mE8RtY7vB",
"domain_id": "hst_1jGePYbM8wV3lD7QsX6uA",
"selector": "default",
"is_active": true,
"dns_record_name": "default._domainkey.example.com",
"dns_record_value": "v=DKIM1; k=rsa; p=MIGfMA0GCS...",
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-01-15T10:30:00Z"
}