This commit is contained in:
Andreas Knuth 2025-12-17 14:38:57 -06:00
parent 2e3df96ca3
commit 1babc68655
1 changed files with 7 additions and 1 deletions

View File

@ -516,6 +516,13 @@ def process_message(message_body: dict, receive_count: int) -> bool:
log(f"⚠ Parsing/Logic Error: {e}. Sending original.", 'WARNING')
from_addr_final = from_addr
# Neu: Original-Body extrahieren (für OOO und Forward)
try:
original_body = str(parsed.get_payload(decode=True))
except Exception as e:
log(f"⚠ Error extracting original body: {e}. Using empty body.", 'WARNING')
original_body = ""
# 5. OOO & FORWARD LOGIC (neu, vor SMTP-Versand)
if rules_table and not is_ses_bounce_or_autoreply(parsed): # Vermeide Loops bei Bounces/Auto-Replies
for recipient in recipients:
@ -529,7 +536,6 @@ def process_message(message_body: dict, receive_count: int) -> bool:
sender = parsed.get('From') # Original-Sender
reply_subject = f"Out of Office: {subject}"
original_body = str(parsed.get_payload(decode=True)) # Original für Quote
if content_type == 'html':
reply_body = {'Html': {'Data': f"<p>{ooo_msg}</p><br><blockquote>Original Message:<br>Subject: {parsed.get('Subject')}<br>From: {sender}<br><br>{original_body}</blockquote>"}}