summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/mx/mail_receiver.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/leap/mx/mail_receiver.py b/src/leap/mx/mail_receiver.py
index 7856594..77909b0 100644
--- a/src/leap/mx/mail_receiver.py
+++ b/src/leap/mx/mail_receiver.py
@@ -392,15 +392,16 @@ class MailReceiver(Service):
:param reason: Brief explanation about why it's being bounced
:type reason: str
"""
- to = orig_msg.get("From")
+ orig_from = orig_msg.get("From")
+ orig_to = orig_msg.get("To")
msg = MIMEMultipart()
msg['From'] = self._bounce_from
- msg['To'] = to
+ msg['To'] = orig_from
msg['Date'] = formatdate(localtime=True)
msg['Subject'] = self._bounce_subject
- decoded_to = " ".join([x[0] for x in decode_header(to)])
+ decoded_to = " ".join([x[0] for x in decode_header(orig_to)])
text = BOUNCE_TEMPLATE.format(decoded_to,
reason,
orig_msg.as_string())