From b962d6a2c1bd4460a430fa7b4b6be75b28f37ece Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Sun, 7 Jun 2020 00:08:49 +0200 Subject: [PATCH] encrypt sent email if contact has PGP enabled --- email_handler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/email_handler.py b/email_handler.py index f9868635..d2487630 100644 --- a/email_handler.py +++ b/email_handler.py @@ -605,6 +605,11 @@ def handle_reply(envelope, smtp: SMTP, msg: Message, rcpt_to: str) -> (bool, str if custom_domain.dkim_verified: add_dkim_signature(msg, alias_domain) + # create PGP email if needed + if contact.pgp_finger_print and user.is_premium(): + LOG.d("Encrypt message for contact %s", contact) + msg = prepare_pgp_message(msg, contact.pgp_finger_print) + smtp.sendmail( alias.email, contact.website_email,