|
|
@@ -502,6 +502,7 @@ def normalize_message(message_id, raw_bytes, mailbox):
|
|
|
},
|
|
|
"toRecipients": recipient_items,
|
|
|
"recipientAddresses": recipient_addresses,
|
|
|
+ "bodyText": body,
|
|
|
"bodyPreview": body[:500],
|
|
|
"receivedDateTime": to_iso_string(timestamp_ms),
|
|
|
"receivedTimestamp": timestamp_ms,
|
|
|
@@ -859,17 +860,18 @@ def select_latest_code(messages, sender_filters, subject_filters, exclude_codes,
|
|
|
sender = str(message.get("from", {}).get("emailAddress", {}).get("address", "")).lower()
|
|
|
subject = str(message.get("subject", ""))
|
|
|
preview = str(message.get("bodyPreview", ""))
|
|
|
+ body_text = str(message.get("bodyText", ""))
|
|
|
recipient_addresses = [
|
|
|
str(item or "").strip().lower()
|
|
|
for item in message.get("recipientAddresses", [])
|
|
|
if str(item or "").strip()
|
|
|
]
|
|
|
recipient_text = " ".join(recipient_addresses)
|
|
|
- combined = " ".join([sender, subject.lower(), preview.lower(), recipient_text])
|
|
|
+ combined = " ".join([sender, subject.lower(), preview.lower(), body_text.lower(), recipient_text])
|
|
|
if normalized_target_email and recipient_addresses and normalized_target_email not in recipient_addresses:
|
|
|
return None
|
|
|
|
|
|
- code = extract_code(" ".join([subject, preview, sender]))
|
|
|
+ code = extract_code(" ".join([subject, preview, body_text, sender]))
|
|
|
if not code or code in excluded:
|
|
|
return None
|
|
|
|