Filter Criteria for "Encryption"
Closed, ResolvedPublic

Description

To make it easier to filter for only encrypted mails it would be nice to have a direct Filter for encryption status.

I would imagine something like
Encryption - is - encrypted
Encryption - is not - encrypted

Bonus:
Encryption - is - PGP Encrypted
Encryption - is - S/MIME Encrypted

It could be done with current criteria but this is not really user friendly. I imagine a detection to be:
If Content-Type is multipart/encrypted < mail is encrypted (RFC 3156)
or
The text of the first mime part (either in text/plain or text/html) starts with:
-----BEGIN PGP MESSAGE-----

The usecase for this is to reencrypt only encrypted mails to a different key or to encrypt only unencrypted mails (without recrypting already encrypted mails)

Another Usecase I can think of is to reencrypt S/MIME Mails to OpenPGP but this is not contracted so please only add this if it's not too much effort (<1d).

This is what we currently have implemented through the regular filter setup.

You would simply enable the filter for all incoming messages and the filter decides whether it needs to encrypt or re-encrypt. Performance-wise there's would be no gain in introducing a Match rules like "Is encrypted" or "Is not encrypted". Also I don't think it would be faster or easier, as just selecting "Apply to all" is certainly easier than having to create two filters with If is encrypted then re-encrypt and If is not encrypted then encrypt logic.

Or is there something I'm missing?

The main use case that is currently not fulfilled afaik (or only if you filter on headers / mail content) would be:

  • Only re-encrypt incoming encrypted mails (Leaving unencrypted mails untouched)

I see, it wasn't clear to me from the description that this is a scenario too. In that case the match rule makes sense.

confirmed in a test.

Set up a filter and run the filter directly from the filter-settings window and it works.

Confirmed. I created a filter to play a beep on every encrypted (tested for non encrypted messages, too) message. When run directly from the filter settings it does the correct thing.

knauss moved this task from Backlog to Done on the KDE PIM board.Apr 21 2018, 4:59 PM