only premium user can encrypt emails with PGP

This commit is contained in:
Son NK 2020-03-19 19:19:04 +01:00 committed by Son NK
parent 66a285e9fd
commit 24bb961b19

View file

@ -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)