fix
This commit is contained in:
parent
2e3df96ca3
commit
1babc68655
|
|
@ -516,6 +516,13 @@ def process_message(message_body: dict, receive_count: int) -> bool:
|
||||||
log(f"⚠ Parsing/Logic Error: {e}. Sending original.", 'WARNING')
|
log(f"⚠ Parsing/Logic Error: {e}. Sending original.", 'WARNING')
|
||||||
from_addr_final = from_addr
|
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)
|
# 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
|
if rules_table and not is_ses_bounce_or_autoreply(parsed): # Vermeide Loops bei Bounces/Auto-Replies
|
||||||
for recipient in recipients:
|
for recipient in recipients:
|
||||||
|
|
@ -529,7 +536,6 @@ def process_message(message_body: dict, receive_count: int) -> bool:
|
||||||
sender = parsed.get('From') # Original-Sender
|
sender = parsed.get('From') # Original-Sender
|
||||||
|
|
||||||
reply_subject = f"Out of Office: {subject}"
|
reply_subject = f"Out of Office: {subject}"
|
||||||
original_body = str(parsed.get_payload(decode=True)) # Original für Quote
|
|
||||||
|
|
||||||
if content_type == 'html':
|
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>"}}
|
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>"}}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue