refactor: smtp.py.remote 更名为 smtp_v2.py,恢复 .py 后缀以便工具链识别
_run.sh 同步指向新文件名;start() 新增启动时凭证明文打印(仅 stdout 不落日志库),用于排查 .env 加载问题,调试完成后需移除。
This commit is contained in:
1 parent
11993e178b
commit
53c742c26e
2 files changed
+5
-1
No files matched your search
+1
-1
@@ -2,4 +2,4 @@
|
|||||||
cd "$(dirname "$0")" || exit
|
cd "$(dirname "$0")" || exit
|
||||||
source ./venv/bin/activate
|
source ./venv/bin/activate
|
||||||
#exec ./smtp.bin
|
#exec ./smtp.bin
|
||||||
exec python3 smtp.py.remote
|
exec python3 smtp_v2.py
|
||||||
@@ -100,6 +100,10 @@ class SmtpServer:
|
|||||||
# ── 启动 / 停止 ──────────────────────────────────────────────────
|
# ── 启动 / 停止 ──────────────────────────────────────────────────
|
||||||
def start(self) -> None:
|
def start(self) -> None:
|
||||||
"""启动服务(阻塞当前线程)。"""
|
"""启动服务(阻塞当前线程)。"""
|
||||||
|
# 调试:打印加载到的凭证(明文,含密码;仅 print 不落日志库,调完请删)
|
||||||
|
print(f"[smtp] 凭证加载(.env 贡献 {_env_loaded} 项): "
|
||||||
|
f"SMTP_SERVER={SMTP_SERVER!r} SMTP_PORT={SMTP_PORT} "
|
||||||
|
f"SMTP_USER={SMTP_USER!r} __PASSWORD={SMTP_PASSWORD!r}")
|
||||||
if not all([SMTP_SERVER, SMTP_USER, SMTP_PASSWORD]):
|
if not all([SMTP_SERVER, SMTP_USER, SMTP_PASSWORD]):
|
||||||
# 只报缺失的 key 名,绝不报值
|
# 只报缺失的 key 名,绝不报值
|
||||||
missing = [k for k, v in (("SMTP_SERVER", SMTP_SERVER),
|
missing = [k for k, v in (("SMTP_SERVER", SMTP_SERVER),
|
||||||
Reference in new issue
Block a user