feat(mail): 添加收件箱功能,自动获得验证码

This commit is contained in:
cnlimiter
2026-03-20 12:54:39 +08:00
parent 87ff48cdaf
commit b1a8d02353
16 changed files with 186 additions and 44 deletions

View File

@@ -33,7 +33,7 @@ class EmailServiceType(str, Enum):
"""邮箱服务类型"""
TEMPMAIL = "tempmail"
OUTLOOK = "outlook"
CUSTOM_DOMAIN = "custom_domain"
MOE_MAIL = "moe_mail"
TEMP_MAIL = "temp_mail"
DUCK_MAIL = "duck_mail"
FREEMAIL = "freemail"
@@ -109,7 +109,7 @@ EMAIL_SERVICE_DEFAULTS = {
"smtp_port": 587,
"timeout": 30,
},
"custom_domain": {
"moe_mail": {
"base_url": "", # 需要用户配置
"api_key_header": "X-API-Key",
"timeout": 30,

View File

@@ -22,7 +22,7 @@ class SettingCategory(str, Enum):
REGISTRATION = "registration"
EMAIL = "email"
TEMPMAIL = "tempmail"
CUSTOM_DOMAIN = "custom_domain"
CUSTOM_DOMAIN = "moe_mail"
SECURITY = "security"
CPA = "cpa"
@@ -252,7 +252,7 @@ SETTING_DEFINITIONS: Dict[str, SettingDefinition] = {
# 邮箱服务配置
"email_service_priority": SettingDefinition(
db_key="email.service_priority",
default_value={"tempmail": 0, "outlook": 1, "custom_domain": 2},
default_value={"tempmail": 0, "outlook": 1, "moe_mail": 2},
category=SettingCategory.EMAIL,
description="邮箱服务优先级"
),
@@ -665,7 +665,7 @@ class Settings(BaseModel):
registration_sleep_max: int = 30
# 邮箱服务配置
email_service_priority: Dict[str, int] = {"tempmail": 0, "outlook": 1, "custom_domain": 2}
email_service_priority: Dict[str, int] = {"tempmail": 0, "outlook": 1, "moe_mail": 2}
# Tempmail.lol 配置
tempmail_base_url: str = "https://api.tempmail.lol/v2"