only premium user can encrypt emails with PGP

This commit is contained in:
Son NK 2020-03-19 19:19:04 +01:00
parent a529943dc4
commit 8ce9d56e84
1 changed files with 2 additions and 1 deletions

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)