Auto-sync: 2026-03-05 06:30:01
This commit is contained in:
@@ -218,6 +218,14 @@ def process_message(mail, uid, account, api_key, api_url, gemini_key, line_token
|
||||
"""メッセージを1通処理。戻り値: 'skipped' / 'not_important' / 'notified'"""
|
||||
account_code = account["account_code"]
|
||||
forwarding_map = account.get("forwarding_map", {})
|
||||
recipient_map = {
|
||||
"akira@keinafarm.com": "xserver1",
|
||||
"service@keinafarm.com": "xserver2",
|
||||
"midori@keinafarm.com": "xserver3",
|
||||
"kouseiren@keinafarm.com": "xserver4",
|
||||
"post@keinafarm.com": "xserver5",
|
||||
"sales@keinafarm.com": "xserver6",
|
||||
}
|
||||
|
||||
# メール取得
|
||||
_, data = mail.uid("FETCH", str(uid), "(RFC822)")
|
||||
@@ -246,15 +254,15 @@ def process_message(mail, uid, account, api_key, api_url, gemini_key, line_token
|
||||
|
||||
body_preview = extract_body_preview(msg, max_chars=500)
|
||||
|
||||
# 転送検出: To:ヘッダーのドメインが forwarding_map に存在する場合は account_code を上書き
|
||||
if forwarding_map:
|
||||
# 宛先補正: To:ヘッダーから account_code を補正(転送/重複受信時の誤判定防止)
|
||||
to_raw = msg.get("To", "")
|
||||
if to_raw:
|
||||
to_addr = extract_email_address(to_raw)
|
||||
to_domain = to_addr.split("@")[-1] if "@" in to_addr else ""
|
||||
if to_domain in forwarding_map:
|
||||
account_code = forwarding_map[to_domain]
|
||||
print(f" [転送検出] To:{to_addr} → account: {account_code}")
|
||||
mapped = forwarding_map.get(to_addr) or forwarding_map.get(to_domain) or recipient_map.get(to_addr)
|
||||
if mapped:
|
||||
account_code = mapped
|
||||
print(f" [宛先補正] To:{to_addr} → account: {account_code}")
|
||||
|
||||
print(f" From: {sender_email_addr}, Subject: {subject[:50]}")
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ locks:
|
||||
f/dev/konnnichiha__flow+a.py: 932c967ebcf32abf2e923458c22d63973933b9b4451d0495846b2b720ff25d6d
|
||||
f/dev/textout__flow+__flow_hash: 869322134a2ea15f54c3b35adf533a495b407d946ddd0b0e9c20d77316479c8b
|
||||
f/dev/textout__flow+a.py: c4062ee04d2177a398ab3eb23dee0536088d183e8cf22f1d890b05a1bd6e518c
|
||||
f/mail/mail_filter__flow+__flow_hash: 4516bf2bfc8cc000d414382910f9ccc23fb884b2555d9931d6e9c8285af8a70a
|
||||
f/mail/mail_filter__flow+メール取得・判定・通知.py: 471993f8f161566c835aa74456403fc899d5c232a149b71604b72ff5f0483f4e
|
||||
f/mail/mail_filter__flow+__flow_hash: 5790f99e6189a6ed1acabf57f9e6777fb1dc8a334facc1d1b1d26a08be8558a0
|
||||
f/mail/mail_filter__flow+メール取得・判定・通知.py: b105f1a8414e7ee395f0e3ec1b9515766b4cb630d1fe5205b0493170a727237e
|
||||
f/shiraou/shiraou_notification__flow+__flow_hash: 94825ff4362b6e4b6d165f8e17a51ebf8e5ef4da3e0ec1407a94b614ecab19dd
|
||||
f/shiraou/shiraou_notification__flow+変更確認・line通知.py: ac80896991cce8132cfbf34d5dae20d3c09de5bc74a55c500e4c8705dd6a9d88
|
||||
f/weather/weather_sync__flow+__flow_hash: 8af44676b2a175c1cc105028682f18e4bfbf7bf9de2722263a7d85c13c825f08
|
||||
|
||||
Reference in New Issue
Block a user