From 24bb961b19a23424aafa689b0bb29dcf4f55e9d8 Mon Sep 17 00:00:00 2001 From: Son NK Date: Thu, 19 Mar 2020 19:19:04 +0100 Subject: [PATCH] only premium user can encrypt emails with PGP --- email_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/email_handler.py b/email_handler.py index 822f6fc9..b15ade4e 100644 --- a/email_handler.py +++ b/email_handler.py @@ -307,9 +307,10 @@ def handle_forward(envelope, smtp: SMTP, msg: Message, rcpt_to: str) -> str: mailbox = alias.mailbox mailbox_email = mailbox.email + user = alias.user # create PGP email if needed - if mailbox.pgp_finger_print: + if mailbox.pgp_finger_print and user.is_premium(): LOG.d("Encrypt message using mailbox %s", mailbox) msg = prepare_pgp_message(msg, mailbox.pgp_finger_print)