use sendmail instead of send_message in reply phase to avoid unicode problem

This commit is contained in:
Son NK 2019-12-12 21:11:01 +01:00
parent 572ce1de57
commit b0f4ab8a6d

View file

@ -237,12 +237,13 @@ class MailHandler:
envelope.rcpt_options, envelope.rcpt_options,
) )
smtp.send_message( msg_raw = msg.as_string().encode()
msg, smtp.sendmail(
from_addr=alias, alias,
to_addrs=[forward_email.website_email], forward_email.website_email,
mail_options=envelope.mail_options, msg_raw,
rcpt_options=envelope.rcpt_options, envelope.mail_options,
envelope.rcpt_options,
) )
ForwardEmailLog.create(forward_id=forward_email.id, is_reply=True) ForwardEmailLog.create(forward_id=forward_email.id, is_reply=True)