Changed the header to last call messages to IETF Announce and to IANA to make replying to the announcement less likely to create an unnecessary ticket
- Legacy-Id: 5602
This commit is contained in:
parent
63cad71f5e
commit
19dcf10316
|
@ -488,7 +488,6 @@ def email_iana(request, doc, to, msg):
|
|||
|
||||
def extra_automation_headers(doc):
|
||||
extra = {}
|
||||
extra["Reply-To"] = "noreply@ietf.org"
|
||||
extra["X-IETF-Draft-string"] = doc.name
|
||||
extra["X-IETF-Draft-revision"] = doc.rev
|
||||
|
||||
|
|
|
@ -820,7 +820,7 @@ def ballot_writeupnotesREDESIGN(request, name):
|
|||
msg = generate_issue_ballot_mail(request, doc, ballot)
|
||||
send_mail_preformatted(request, msg)
|
||||
send_mail_preformatted(request, msg, extra=extra_automation_headers(doc),
|
||||
override={ "To": "IANA <drafts-eval@icann.org>" })
|
||||
override={ "To": "IANA <drafts-eval@icann.org>", "CC": None, "Bcc": None , "Reply-To": None})
|
||||
|
||||
e = DocEvent(doc=doc, by=login)
|
||||
e.by = login
|
||||
|
@ -1056,7 +1056,7 @@ def approve_ballotREDESIGN(request, name):
|
|||
|
||||
if action == "to_announcement_list":
|
||||
send_mail_preformatted(request, announcement, extra=extra_automation_headers(doc),
|
||||
override={ "To": "IANA <drafts-approval@icann.org>" })
|
||||
override={ "To": "IANA <drafts-approval@icann.org>", "CC": None, "Bcc": None, "Reply-To": None})
|
||||
|
||||
msg = infer_message(announcement)
|
||||
msg.by = login
|
||||
|
@ -1098,7 +1098,7 @@ def make_last_call(request, name):
|
|||
if form.is_valid():
|
||||
send_mail_preformatted(request, announcement)
|
||||
send_mail_preformatted(request, announcement, extra=extra_automation_headers(doc),
|
||||
override={ "To": "IANA <drafts-lastcall@icann.org>" })
|
||||
override={ "To": "IANA <drafts-lastcall@icann.org>", "CC": None, "Bcc": None, "Reply-To": None})
|
||||
|
||||
msg = infer_message(announcement)
|
||||
msg.by = login
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
{% load ietf_filters %}{% load mail_filters %}{% autoescape off %}From: The IESG <iesg-secretary@ietf.org>
|
||||
To: IETF-Announce <ietf-announce@ietf.org>{% if cc %}
|
||||
{% load ietf_filters %}{% load mail_filters %}{% autoescape off %}From: The IESG <noreply@ietf.org>
|
||||
To: IETF-Announce:; {% if cc %}
|
||||
CC: {{ cc }}{% endif %}
|
||||
Reply-To: ietf@ietf.org
|
||||
Bcc: <ietf-announce@ietf.org>
|
||||
Reply-To: IETF Discussion List <ietf@ietf.org>
|
||||
Sender: <iesg-secretary@ietf.org>
|
||||
Subject: Last Call: {{ doc.file_tag }} ({{ doc.title|clean_whitespace }}) to {{ doc|std_level_prompt }}
|
||||
|
||||
{% filter wordwrap:73 %}
|
||||
|
|
|
@ -93,7 +93,7 @@ def send_smtp(msg, bcc=None):
|
|||
server.quit()
|
||||
log("sent email from '%s' to %s subject '%s'" % (frm, to, msg.get('Subject', '[no subject]')))
|
||||
|
||||
def copy_email(msg, to, toUser=False):
|
||||
def copy_email(msg, to, toUser=False, originalBcc=None):
|
||||
'''
|
||||
Send a copy of the given email message to the given recipient.
|
||||
'''
|
||||
|
@ -111,6 +111,8 @@ def copy_email(msg, to, toUser=False):
|
|||
explanation = "The attached message was generated by an instance of the tracker\nin test mode. It is being sent to you because you, or someone acting\non your behalf, is testing the system. If you do not recognize\nthis action, please accept our apologies and do not be concerned as\nthe action is being taken in a test context."
|
||||
else:
|
||||
explanation = "The attached message would have been sent, but the tracker is in %s mode.\nIt was not sent to anybody." % settings.SERVER_MODE
|
||||
if originalBcc:
|
||||
explanation += ("\nIn addition to the destinations derived from the header below, the message would have been sent Bcc to %s" % originalBcc)
|
||||
new.attach(MIMEText(explanation + "\n\n"))
|
||||
new.attach(MIMEMessage(msg))
|
||||
# Overwrite the From: header, so that the copy from a development or
|
||||
|
@ -177,9 +179,9 @@ def send_mail_mime(request, to, frm, subject, msg, cc=None, extra=None, toUser=F
|
|||
send_smtp(msg, bcc)
|
||||
elif settings.SERVER_MODE == 'test':
|
||||
if toUser:
|
||||
copy_email(msg, to, toUser=True)
|
||||
copy_email(msg, to, toUser=True, originalBcc=bcc)
|
||||
elif request and request.COOKIES.has_key( 'testmailcc' ):
|
||||
copy_email(msg, request.COOKIES[ 'testmailcc' ])
|
||||
copy_email(msg, request.COOKIES[ 'testmailcc' ],originalBcc=bcc)
|
||||
try:
|
||||
copy_to = settings.EMAIL_COPY_TO
|
||||
except AttributeError:
|
||||
|
@ -187,7 +189,7 @@ def send_mail_mime(request, to, frm, subject, msg, cc=None, extra=None, toUser=F
|
|||
if copy_to and not test_mode: # if we're running automated tests, this copy is just annoying
|
||||
if bcc:
|
||||
msg['X-Tracker-Bcc']=bcc
|
||||
copy_email(msg, copy_to)
|
||||
copy_email(msg, copy_to,originalBcc=bcc)
|
||||
|
||||
def send_mail_preformatted(request, preformatted, extra={}, override={}):
|
||||
"""Parse preformatted string containing mail with From:, To:, ...,
|
||||
|
@ -201,14 +203,17 @@ def send_mail_preformatted(request, preformatted, extra={}, override={}):
|
|||
msg[k] = v
|
||||
|
||||
headers = copy.copy(msg)
|
||||
for key in ['To', 'From', 'Subject']:
|
||||
for key in ['To', 'From', 'Subject', 'Bcc']:
|
||||
del headers[key]
|
||||
for k, v in extra.iteritems():
|
||||
if k in headers:
|
||||
del headers[k]
|
||||
headers[k] = v
|
||||
|
||||
send_mail_text(request, msg['To'], msg["From"], msg["Subject"], msg.get_payload(), extra=headers)
|
||||
bcc = msg['Bcc']
|
||||
del msg['Bcc']
|
||||
|
||||
send_mail_text(request, msg['To'], msg["From"], msg["Subject"], msg.get_payload(), extra=headers, bcc=bcc)
|
||||
|
||||
def send_mail_message(request, message, extra={}):
|
||||
"""Send a Message object."""
|
||||
|
|
Loading…
Reference in a new issue