diff --git a/ietf/group/views.py b/ietf/group/views.py index 071f74cb8..75a563299 100644 --- a/ietf/group/views.py +++ b/ietf/group/views.py @@ -1586,7 +1586,7 @@ def email_open_review_assignments(request, acronym, group_type=None): if request.method == "POST" and request.POST.get("action") == "email": form = EmailOpenAssignmentsForm(request.POST) if form.is_valid(): - send_mail_text(request, form.cleaned_data["to"], form.cleaned_data["frm"], form.cleaned_data["subject"], form.cleaned_data["body"],cc=form.cleaned_data["cc"],extra={"Reply-to":", ".join(form.cleaned_data["reply_to"])}) + send_mail_text(request, form.cleaned_data["to"], form.cleaned_data["frm"], form.cleaned_data["subject"], form.cleaned_data["body"],cc=form.cleaned_data["cc"],extra={"Reply-To":", ".join(form.cleaned_data["reply_to"])}) return HttpResponseRedirect(back_url) else: (to,cc) = gather_address_lists('review_assignments_summarized',group=group) diff --git a/ietf/message/utils.py b/ietf/message/utils.py index b956e8ee5..c843f1584 100644 --- a/ietf/message/utils.py +++ b/ietf/message/utils.py @@ -14,7 +14,7 @@ def infer_message(s): m.to = parsed.get("To", "").decode("utf-8") m.cc = parsed.get("Cc", "").decode("utf-8") m.bcc = parsed.get("Bcc", "").decode("utf-8") - m.reply_to = parsed.get("Reply-to", "").decode("utf-8") + m.reply_to = parsed.get("Reply-To", "").decode("utf-8") m.body = parsed.get_payload().decode("utf-8") return m diff --git a/ietf/submit/mail.py b/ietf/submit/mail.py index 505459566..181f39349 100644 --- a/ietf/submit/mail.py +++ b/ietf/submit/mail.py @@ -105,6 +105,8 @@ def announce_to_lists(request, submission): m.subject = 'I-D Action: %s-%s.txt' % (submission.name, submission.rev) m.frm = settings.IDSUBMIT_ANNOUNCE_FROM_EMAIL (m.to, m.cc) = gather_address_lists('sub_announced',submission=submission) + if m.cc: + m.reply_to = m.cc m.body = render_to_string('submit/announce_to_lists.txt', dict(submission=submission, settings=settings)) diff --git a/ietf/submit/tests.py b/ietf/submit/tests.py index 9470e3d86..b509c7b6d 100644 --- a/ietf/submit/tests.py +++ b/ietf/submit/tests.py @@ -1501,8 +1501,8 @@ Thank you outmsg = outbox[0] self.assertTrue(to in outmsg['To']) - reply_to = outmsg['Reply-to'] - self.assertIsNotNone(reply_to, "Expected Reply-to") + reply_to = outmsg['Reply-To'] + self.assertIsNotNone(reply_to, "Expected Reply-To") # Build a reply diff --git a/ietf/utils/mail.py b/ietf/utils/mail.py index 9e01ab835..83f5cb07f 100644 --- a/ietf/utils/mail.py +++ b/ietf/utils/mail.py @@ -206,6 +206,11 @@ def condition_message(to, frm, subject, msg, cc, extra): cc = ", ".join([isinstance(addr, tuple) and formataddr(addr) or addr for addr in cc if addr]) if frm: msg['From'] = frm + if extra and 'Reply-To' in extra: + reply_to = extra['Reply-To'] + if isinstance(reply_to, list) or isinstance(reply_to, tuple): + reply_to = ", ".join([isinstance(addr, tuple) and formataddr(addr) or addr for addr in reply_to if addr]) + extra['Reply-To'] = reply_to # The following is a hack to avoid an issue with how the email module (as of version 4.0.3) # breaks lines when encoding header fields with anything other than the us-ascii codec. @@ -265,7 +270,7 @@ def send_mail_mime(request, to, frm, subject, msg, cc=None, extra=None, toUser=F if test_mode or debugging or settings.SERVER_MODE == 'production': try: - send_smtp(msg,bcc) + send_smtp(msg, bcc) except smtplib.SMTPException as e: log_smtp_exception(e) build_warning_message(request, e) @@ -339,7 +344,7 @@ def send_mail_message(request, message, extra={}): e = extra.copy() if message.reply_to: - e['Reply-to'] = message.reply_to + e['Reply-To'] = message.reply_to if message.msgid: e['Message-ID'] = message.msgid