MIMEText(text, 'plain', 'utf-8') encodes the text into
base64 and adds 'Content-Transfer-Encoding: base64' header.
Signed-off-by: SATOH Fumiyasu <fumiyas@osstech.co.jp>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Nov 16 22:43:35 UTC 2020 on sn-devel-184
outer['From'] = options.email_from
outer['Date'] = email.utils.formatdate(localtime=True)
outer.preamble = 'Autobuild mails are now in MIME because we optionally attach the logs.\n'
- outer.attach(MIMEText(text, 'plain'))
+ outer.attach(MIMEText(text, 'plain', 'utf-8'))
if options.attach_logs:
with open(log_tar, 'rb') as fp:
msg = MIMEApplication(fp.read(), 'gzip', email.encoders.encode_base64)