更新邮件服务和SMTP配置功能
This commit is contained in:
@@ -530,6 +530,23 @@ def set_primary_smtp_config(config_id: int) -> bool:
|
||||
return cursor.rowcount > 0
|
||||
|
||||
|
||||
def clear_primary_smtp_config() -> bool:
|
||||
"""取消主SMTP配置(清空所有 is_primary 标记)"""
|
||||
with db_pool.get_db() as conn:
|
||||
cursor = conn.cursor()
|
||||
cursor.execute(
|
||||
"""
|
||||
UPDATE smtp_configs
|
||||
SET is_primary = 0,
|
||||
updated_at = ?
|
||||
WHERE is_primary = 1
|
||||
""",
|
||||
(get_beijing_now_str(),),
|
||||
)
|
||||
conn.commit()
|
||||
return True
|
||||
|
||||
|
||||
def _get_available_smtp_config(failover: bool = True) -> Optional[Dict[str, Any]]:
|
||||
"""
|
||||
获取可用的SMTP配置
|
||||
|
||||
Reference in New Issue
Block a user