From 0c4e48c906fe5f8f1f2108de357a7c89fd07cdd2 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Wed, 10 Jun 2020 12:17:04 +0200 Subject: [PATCH] remove bounced_email param from send_email_with_rate_control --- app/email_utils.py | 1 - email_handler.py | 6 ------ 2 files changed, 7 deletions(-) diff --git a/app/email_utils.py b/app/email_utils.py index 4e4938a9..52f436bc 100644 --- a/app/email_utils.py +++ b/app/email_utils.py @@ -228,7 +228,6 @@ def send_email_with_rate_control( subject, plaintext, html=None, - bounced_email: Optional[Message] = None, max_alert_24h=MAX_ALERT_24H, ) -> bool: """Same as send_email with rate control over alert_type. diff --git a/email_handler.py b/email_handler.py index 29e09ed9..f7a61fc8 100644 --- a/email_handler.py +++ b/email_handler.py @@ -836,7 +836,6 @@ def handle_bounce(contact: Contact, alias: Alias, msg: Message, user: User): send_email_with_rate_control( user, ALERT_BOUNCE_EMAIL, - # use user mail here as only user is authenticated to see the refused email user.email, f"Email from {contact.website_email} to {address} cannot be delivered to your inbox", render( @@ -857,8 +856,6 @@ def handle_bounce(contact: Contact, alias: Alias, msg: Message, user: User): refused_email_url=refused_email_url, mailbox_email=mailbox.email, ), - # cannot include bounce email as it can contain spammy text - # bounced_email=msg, ) # disable the alias the second time email is bounced elif nb_bounced >= 2: @@ -876,7 +873,6 @@ def handle_bounce(contact: Contact, alias: Alias, msg: Message, user: User): send_email_with_rate_control( user, ALERT_BOUNCE_EMAIL, - # use user mail here as only user is authenticated to see the refused email user.email, f"Alias {address} has been disabled due to second undelivered email from {contact.website_email}", render( @@ -895,8 +891,6 @@ def handle_bounce(contact: Contact, alias: Alias, msg: Message, user: User): refused_email_url=refused_email_url, mailbox_email=mailbox.email, ), - # cannot include bounce email as it can contain spammy text - # bounced_email=msg, )