Skip to content

Commit 9720c03

Browse files
committed
Propagate all extra fields on to the final email sending function, not only the Cc and Bcc fields.
- Legacy-Id: 2765
1 parent 6958488 commit 9720c03

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

ietf/utils/mail.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ def send_mail_text(request, to, frm, subject, txt, cc=None, extra=None, toUser=N
146146
msg = MIMEText(txt.encode('utf-8'), 'plain', 'UTF-8')
147147
else:
148148
msg = MIMEText(txt)
149-
150149
send_mail_mime(request, to, frm, subject, msg, cc, extra, toUser, bcc)
151150

152151
def send_mail_mime(request, to, frm, subject, msg, cc=None, extra=None, toUser=None, bcc=None):
@@ -166,7 +165,7 @@ def send_mail_mime(request, to, frm, subject, msg, cc=None, extra=None, toUser=N
166165
msg['X-Test-IDTracker'] = (settings.SERVER_MODE == 'production') and 'no' or 'yes'
167166
msg['X-IETF-IDTracker'] = ietf.__version__
168167
if extra:
169-
for k, v in extra.iteritems():
168+
for k, v in extra.items():
170169
msg[k] = v
171170
if test_mode or settings.SERVER_MODE == 'production':
172171
send_smtp(msg, bcc)
@@ -187,7 +186,6 @@ def send_mail_preformatted(request, preformatted):
187186
"""Parse preformatted string containing mail with From:, To:, ...,
188187
and send it through the standard IETF mail interface (inserting
189188
extra headers as needed)."""
190-
191189
msg = message_from_string(preformatted.encode("utf-8"))
192190

193-
send_mail_text(request, msg['To'], msg["From"], msg["Subject"], msg.get_payload(), cc=msg["Cc"], bcc=msg["Bcc"])
191+
send_mail_text(request, msg['To'], msg["From"], msg["Subject"], msg.get_payload(), extra=msg)

0 commit comments

Comments
 (0)