sendmail
This commit is contained in:
parent
24b05aa210
commit
0d0391b6ee
|
|
@ -229,12 +229,9 @@ def retry_domain_emails(domain):
|
|||
if not recipients:
|
||||
raise ValueError(f"Keine Empfänger in E-Mail {key} gefunden")
|
||||
|
||||
# An SMTP weiterleiten
|
||||
# An SMTP weiterleiten - verwende sendmail()
|
||||
with smtplib.SMTP(SMTP_HOST, SMTP_PORT) as smtp:
|
||||
smtp.mail(from_addr)
|
||||
for recipient in recipients:
|
||||
smtp.rcpt(recipient)
|
||||
smtp.data(email_content)
|
||||
smtp.sendmail(from_addr, recipients, email_content)
|
||||
|
||||
# Als verarbeitet markieren
|
||||
mark_email_as_processed(bucket_name, key)
|
||||
|
|
@ -332,12 +329,9 @@ def process_email(domain):
|
|||
|
||||
logger.info(f"[{request_id}] From: {from_addr}, Recipients: {recipients}")
|
||||
|
||||
# An Postfix weiterleiten - für jeden Empfänger einzeln
|
||||
# An Postfix weiterleiten - verwende sendmail() statt manueller SMTP-Befehle
|
||||
with smtplib.SMTP(SMTP_HOST, SMTP_PORT) as smtp:
|
||||
smtp.mail(from_addr)
|
||||
for recipient in recipients:
|
||||
smtp.rcpt(recipient)
|
||||
smtp.data(email_content)
|
||||
smtp.sendmail(from_addr, recipients, email_content)
|
||||
|
||||
logger.info(f"[{request_id}] Email forwarded to Postfix for {domain} - {len(recipients)} recipients")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue