Forward-Rule mit smtp_override → Mail geht nur zum alten Provider, keine DMS-Delivery
Forward-Rule ohne smtp_override → normaler Forward + DMS-Delivery (bestehendes Verhalten) Keine Rule → nur DMS-Delivery (bestehendes Verhalten)
This commit is contained in:
@@ -184,6 +184,7 @@ class MessageProcessor:
|
||||
continue
|
||||
|
||||
# Process rules (OOO, Forwarding) - not for bounces or already forwarded
|
||||
skip_local_delivery = False # NEU
|
||||
if not is_bounce and not skip_rules:
|
||||
def metrics_callback(action_type: str, dom: str):
|
||||
"""Callback for metrics from rules processor"""
|
||||
@@ -193,7 +194,7 @@ class MessageProcessor:
|
||||
elif action_type == 'forward':
|
||||
self.metrics.increment_forward(dom)
|
||||
|
||||
self.rules_processor.process_rules_for_recipient(
|
||||
skip_local_delivery = self.rules_processor.process_rules_for_recipient(
|
||||
recipient,
|
||||
parsed,
|
||||
domain,
|
||||
@@ -202,25 +203,27 @@ class MessageProcessor:
|
||||
)
|
||||
|
||||
# SMTP Delivery
|
||||
success, error, is_perm = self.delivery.send_to_recipient(
|
||||
from_addr_final,
|
||||
recipient,
|
||||
raw_bytes,
|
||||
worker_name
|
||||
)
|
||||
|
||||
if success:
|
||||
successful.append(recipient)
|
||||
if self.metrics:
|
||||
self.metrics.increment_processed(domain, 'success')
|
||||
elif is_perm:
|
||||
failed_permanent.append(recipient)
|
||||
if self.metrics:
|
||||
self.metrics.increment_processed(domain, 'permanent_failure')
|
||||
if skip_local_delivery: # NEU
|
||||
log(f" ⏭ Skipping local delivery for {recipient} (legacy forward active)",
|
||||
'INFO', worker_name)
|
||||
successful.append(recipient) # Zählt als "handled"
|
||||
else:
|
||||
failed_temporary.append(recipient)
|
||||
if self.metrics:
|
||||
self.metrics.increment_processed(domain, 'temporary_failure')
|
||||
success, error, is_perm = self.delivery.send_to_recipient(
|
||||
from_addr_final, recipient, raw_bytes, worker_name
|
||||
)
|
||||
|
||||
if success:
|
||||
successful.append(recipient)
|
||||
if self.metrics:
|
||||
self.metrics.increment_processed(domain, 'success')
|
||||
elif is_perm:
|
||||
failed_permanent.append(recipient)
|
||||
if self.metrics:
|
||||
self.metrics.increment_processed(domain, 'permanent_failure')
|
||||
else:
|
||||
failed_temporary.append(recipient)
|
||||
if self.metrics:
|
||||
self.metrics.increment_processed(domain, 'temporary_failure')
|
||||
|
||||
# 8. RESULT & CLEANUP
|
||||
total_handled = len(successful) + len(failed_permanent) + len(blocked_recipients)
|
||||
|
||||
Reference in New Issue
Block a user