diff --git a/email-worker/worker.py b/email-worker/worker.py index 79e9282..a1c8fc3 100644 --- a/email-worker/worker.py +++ b/email-worker/worker.py @@ -149,8 +149,16 @@ class MessageProcessor: raw_bytes = parsed.as_bytes() except Exception as e: - log(f"⚠ Parsing/Logic Error: {e}. Sending original.", 'WARNING', worker_name) - traceback.print_exc() + # --- VERBESSERTES ERROR LOGGING --- + error_msg = f"⚠ Parsing/Logic Error: {e}. Sending original." + log(error_msg, 'WARNING', worker_name) + + # Den vollen Traceback ins Log schreiben (als ERROR markiert) + tb_str = traceback.format_exc() + log(f"Full Traceback:\n{tb_str}", 'ERROR', worker_name) + # ---------------------------------- + + # Fallback: Wir versuchen trotzdem, die Original-Mail zuzustellen from_addr_final = from_addr is_bounce = False skip_rules = False