mirror of
https://github.com/simple-login/app.git
synced 2024-11-16 08:58:30 +01:00
send raw message instead of using EmailMessage object
This commit is contained in:
parent
ef888288a6
commit
1435a77130
1 changed files with 17 additions and 6 deletions
|
@ -153,13 +153,24 @@ class MailHandler:
|
||||||
envelope.rcpt_options,
|
envelope.rcpt_options,
|
||||||
)
|
)
|
||||||
|
|
||||||
smtp.send_message(
|
# smtp.send_message has UnicodeEncodeErroremail issue
|
||||||
msg,
|
# encode message raw directly instead
|
||||||
from_addr=forward_email.reply_email,
|
msg_raw = msg.as_string().encode()
|
||||||
to_addrs=[user_email], # user personal email
|
smtp.sendmail(
|
||||||
mail_options=envelope.mail_options,
|
forward_email.reply_email,
|
||||||
rcpt_options=envelope.rcpt_options,
|
user_email,
|
||||||
|
msg_raw,
|
||||||
|
envelope.mail_options,
|
||||||
|
envelope.rcpt_options,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# smtp.send_message(
|
||||||
|
# msg,
|
||||||
|
# from_addr=forward_email.reply_email,
|
||||||
|
# to_addrs=[user_email], # user personal email
|
||||||
|
# mail_options=envelope.mail_options,
|
||||||
|
# rcpt_options=envelope.rcpt_options,
|
||||||
|
# )
|
||||||
else:
|
else:
|
||||||
LOG.d("%s is disabled, do not forward", gen_email)
|
LOG.d("%s is disabled, do not forward", gen_email)
|
||||||
forward_log.blocked = True
|
forward_log.blocked = True
|
||||||
|
|
Loading…
Reference in a new issue