Changed ietf/utils/mail.py to use unicode strings, and changed a call in ietf/reviv/utils.py to use unicode for mail Subject, to fix a server 500 issue.
- Legacy-Id: 16007
This commit is contained in:
parent
17824652cb
commit
8a669909bc
|
@ -1,3 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright The IETF Trust 2016-2019, All Rights Reserved
|
||||
from __future__ import unicode_literals, print_function
|
||||
|
||||
|
||||
import datetime, re, itertools
|
||||
from collections import defaultdict, namedtuple
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ def send_smtp(msg, bcc=None):
|
|||
raise SMTPSomeRefusedRecipients(message="%d addresses were refused"%len(unhandled),original_msg=msg,refusals=unhandled)
|
||||
except Exception as e:
|
||||
# need to improve log message
|
||||
log("Exception while trying to send email from '%s' to %s subject '%s'" % (frm, to, msg.get('Subject', '[no subject]')))
|
||||
log(u"Exception while trying to send email from '%s' to %s subject '%s'" % (frm, to, msg.get('Subject', '[no subject]')))
|
||||
if isinstance(e, smtplib.SMTPException):
|
||||
e.original_msg=msg
|
||||
raise
|
||||
|
@ -128,7 +128,7 @@ def send_smtp(msg, bcc=None):
|
|||
server.quit()
|
||||
except smtplib.SMTPServerDisconnected:
|
||||
pass
|
||||
log("sent email from '%s' to %s id %s subject '%s'" % (frm, to, msg.get('Message-ID', ''), msg.get('Subject', '[no subject]')))
|
||||
log(u"sent email from '%s' to %s id %s subject '%s'" % (frm, to, msg.get('Message-ID', ''), msg.get('Subject', '[no subject]')))
|
||||
|
||||
def copy_email(msg, to, toUser=False, originalBcc=None):
|
||||
'''
|
||||
|
|
Loading…
Reference in a new issue