BugFixes
This commit is contained in:
parent
c2288d22dc
commit
e756c5f91d
14
worker.py
14
worker.py
|
|
@ -9,6 +9,7 @@ import signal
|
|||
from email.parser import BytesParser
|
||||
from email.policy import SMTP as SMTPPolicy
|
||||
from datetime import datetime
|
||||
from botocore.exceptions import ClientError # Neu: Korrekter Import für SES-Exceptions
|
||||
|
||||
# AWS Configuration
|
||||
AWS_REGION = 'us-east-2'
|
||||
|
|
@ -566,13 +567,16 @@ def process_message(message_body: dict, receive_count: int) -> bool:
|
|||
)
|
||||
log(f"✓ Forwarded to {forward_to} from {recipient} (original: {original_from})")
|
||||
|
||||
except boto3.exceptions.ClientError as e:
|
||||
if 'MessageRejected' in str(e):
|
||||
log(f"⚠ SES rejected: {e}. Check verification.", 'ERROR')
|
||||
except ClientError as e: # Fix: Korrekter Exception-Typ
|
||||
error_code = e.response['Error']['Code']
|
||||
if error_code == 'MessageRejected':
|
||||
log(f"⚠ SES rejected send for {recipient}: {e}. Check verification or quotas.", 'ERROR')
|
||||
elif error_code == 'AccessDenied':
|
||||
log(f"⚠ SES AccessDenied for {recipient}: {e}. Check IAM policy.", 'ERROR')
|
||||
else:
|
||||
log(f"⚠ Rules error for {recipient}: {e}", 'WARNING')
|
||||
log(f"⚠ SES error for {recipient}: {e}", 'ERROR')
|
||||
except Exception as e:
|
||||
log(f"⚠ General error: {e}", 'WARNING')
|
||||
log(f"⚠ General error for {recipient}: {e}", 'WARNING')
|
||||
|
||||
# 6. SMTP VERSAND (Loop über Recipients)
|
||||
log(f"📤 Sending to {len(recipients)} recipient(s)...")
|
||||
|
|
|
|||
Loading…
Reference in New Issue