From 47e24dbca948344013c6a0c6a04d8cc80e457642 Mon Sep 17 00:00:00 2001 From: VMIS Developer Date: Mon, 16 Mar 2026 07:11:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20schedule=5Faccount=20realm=20=E6=94=B9?= =?UTF-8?q?=E7=94=A8=20tenant.code=EF=BC=8Cmail=20=E9=80=A3=E7=B7=9A?= =?UTF-8?q?=E6=94=B9=E7=94=A8=20mailserver=20+=20starttls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - realm: 移除 tenant.keycloak_realm fallback,直接用 tenant.code (與 Keycloak realm 一致) - IMAP: 10.1.0.254:143/none → mailserver:143/starttls - SMTP: 10.1.0.254:587/none → mailserver:587/starttls Co-Authored-By: Claude Opus 4.6 --- backend/app/services/scheduler/schedule_account.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/app/services/scheduler/schedule_account.py b/backend/app/services/scheduler/schedule_account.py index f32d581..21306de 100644 --- a/backend/app/services/scheduler/schedule_account.py +++ b/backend/app/services/scheduler/schedule_account.py @@ -29,7 +29,7 @@ def run_account_check(schedule_log_id: int, db: Session): for account in accounts: tenant = account.tenant - realm = tenant.keycloak_realm or tenant.code + realm = tenant.code result = AccountScheduleResult( schedule_log_id=schedule_log_id, account_id=account.id, @@ -149,8 +149,8 @@ def run_account_check(schedule_log_id: int, db: Session): f"docker exec -u www-data {nc_container} " f"php /var/www/html/occ mail:account:create " f"'{account.sso_account}' '{display}' '{email}' " - f"10.1.0.254 143 none '{email}' '{account.default_password}' " - f"10.1.0.254 587 none '{email}' '{account.default_password}' 2>&1" + f"mailserver 143 starttls '{email}' '{account.default_password}' " + f"mailserver 587 starttls '{email}' '{account.default_password}' 2>&1" ) out_text = _ssh_run(create_cmd) logger.info(f"NC mail:account:create [{account.sso_account}]: {out_text}")