fix: use original email From header for reply address instead of AI output
- send_summary now accepts original_sender (raw From header) - Context stores original_sender separately from AI-generated sender - _do_send_reply tries original_sender first, then AI sender fallback
This commit is contained in:
@@ -31,6 +31,7 @@ def ai_process(cfg: Config, acct_idx: int, mail: Email) -> Optional[dict]:
|
||||
"text": text,
|
||||
"data": summary,
|
||||
"original_body": mail.body,
|
||||
"original_sender": mail.sender,
|
||||
"acct_idx": acct_idx,
|
||||
"uid": mail.uid,
|
||||
}
|
||||
@@ -40,6 +41,7 @@ def tg_send_and_mark(cfg: Config, info: dict):
|
||||
acct = cfg.email_accounts[info["acct_idx"]]
|
||||
send_summary(cfg.telegram, cfg.telegram.chat_id,
|
||||
info["text"], info["data"],
|
||||
info["original_body"], info["acct_idx"])
|
||||
info["original_body"], info["acct_idx"],
|
||||
original_sender=info.get("original_sender", ""))
|
||||
mark_as_seen(acct, [info["uid"]])
|
||||
logger.info(f" 已发送并标记已读")
|
||||
|
||||
Reference in New Issue
Block a user