Skip to main content

Handle Signed and Encrypted Mail in Zimbra: S/MIME and PGP

Signed and encrypted mail is the one kind of message a mail server must not touch. A signature added to a signed message breaks the sender's digital signature, and the recipient sees a warning instead of a trusted message. The text of an encrypted message cannot be read, let alone changed. MSH Zimbra Rules knows this and leaves such messages alone. This article shows what that means for your signatures and disclaimers, and adds two rules that are worth having once people start encrypting: a notice for readers who cannot open an encrypted message in the web client, and a check on encrypted mail that leaves the company.

What MSH Zimbra Rules does on its own​

MessageSignatures and disclaimersPolicy rules
Signed (S/MIME or PGP)Not added, the signature stays validRun; actions that change the content, such as removing attachments, are skipped
Encrypted (S/MIME or PGP)Not addedRun on what can be seen: sender, recipients, subject, size
OrdinaryAdded as usualRun as usual

The Message type condition recognizes signed and encrypted messages by their structure: S/MIME and PGP/MIME containers, and inline PGP messages whose text starts with -----BEGIN PGP MESSAGE-----. A DKIM signature added by the sending server does not count as signed.

You can see this in the Rules tester. On the Details tab of a Custom... test message, Protection turns the message into a signed or encrypted one. For a signed message from one of your users to an outside address, the signature and disclaimer rules match as usual, and then step aside:

The trace of a signed test message: Action Add Signature, Cannot add signature to signed message, twice, then Action Add Disclaimer, Cannot add disclaimer to signed message
Step 1 of 1

Cannot add signature to signed message. The message goes out exactly as it was signed.

Disclaimers and signed mail

If your company needs a legal disclaimer on every external message, the server cannot add it to signed mail without breaking the signature. Ask users who sign their mail to put the disclaimer into the signature of their own mail client, so that it is signed along with the message.

Rule 1 - Tell readers that a message is encrypted​

Unless S/MIME or PGP is set up for the user in the web client, the Zimbra web client cannot show an encrypted message. Users typically see an empty message or an attachment such as smime.p7m, and wonder what is wrong. A banner and a sender tag explain it.

Open Rules > Policy Rules, add a group Encrypted mail and in it a rule Encrypted mail from outside:

  • Conditions (all): Message > Type, Encrypted; and Message > Direction, Incoming.
  • Actions: Zimlets > Add message banner with Level Info, Icon lock, Badge Encrypted and a text such as This message is encrypted, so the web client cannot show its content. Open it in a mail client that holds your certificate or key, such as Outlook or Thunderbird. Then Zimlets > Add sender tag with the same level, icon and badge.

The banner and the tag travel in a header of the message, which the Message Notices zimlets read. The encrypted content is not touched. See Add message banner and Add sender tag.

An encrypted test message from partner@example.com after processing: the blue tag ENCRYPTED with a lock before the sender, Protection Encrypted (S/MIME), and an info banner saying that the message is encrypted and where to open it

The General tab of the new policy rule Encrypted mail from outside
Step 1 of 8

In the group Encrypted mail, add the rule Encrypted mail from outside.

Rule 2 - Keep encrypted mail to the outside to those who may send it​

Encryption protects a message from everyone, your own data protection rules included. A rule that stops card numbers, such as the one in Stop Card Numbers from Leaving Zimbra by Email, cannot read an encrypted message. If encrypted mail to the outside should be the exception, allow it only for the people who need it.

In the same group add a rule Encrypted mail to outside:

  • Conditions (all): Message > Type, Encrypted; and Message > Direction, Outgoing.
  • Exceptions: Sender > Sender, In Group, the group that may send encrypted mail, here Management.
  • Actions: Message > Block, Custom, 550, 5.7.1, and a reason such as Rejected: encrypted mail to outside recipients needs approval. Ask the IT team.
The General tab of the new policy rule Encrypted mail to outside
Step 1 of 5

Add a second rule, Encrypted mail to outside.

The block only needs what is visible from the outside of the message: who sends it, to whom, and that it is encrypted. That is why it works where content rules cannot.

Test it in the Rules tester​

Use Protection Encrypted (S/MIME) on the Details tab of a Custom... test message, and send three of them:

  1. From an outside address to one of your users: the banner and the tag are added.
  2. From a user outside the allowed group to an outside address: refused.
  3. From a member of the allowed group to an outside address: delivered.
The encrypted test message from partner@example.com after processing, with the ENCRYPTED tag before the sender and the info banner
Step 1 of 3

Incoming and encrypted: the tag before the sender and the banner.

Good to know​

  • Signed then encrypted looks encrypted. Mail clients usually sign a message and then encrypt it, so from the outside it is Encrypted only. Its signature becomes visible after decryption.
  • Attachments are not the message. A .p7m file or a signed message attached to an ordinary message does not make the message signed or encrypted. Password-protected archives are a different matter, see the Attachments > Encrypted condition in Block Risky Attachments in Zimbra.
  • Signed mail and the DKIM check. A message signed by its sender can still fail a DKIM check of the sending server and the other way round. They are independent, see DKIM verification.

Want to try it on your own server? Start a free trial.