8.6.4. XML format of per-recipient rules

This Section details the format of pgprules.xml, which is a XML file generated by Enigmail and containing the per-recipient rules. This is intended as a technical reference for developers only; normal users should never edit the XML file manually, and can skip this Section.

The pgprules.xml file has the following structure:

<pgpRuleList>
<pgpRule email='{alice@example.com}' keyId='0x1234ABCD' sign='1' encrypt='1' pgpMime='1'/>
<pgpRule email='{bob@ {user@domain' keyId='0xCDEF6789' sign='2' encrypt='1' pgpMime='0'/>
<pgpRule email='{mailinglist@domain.org} ' keyId='0x11111111 0x22222222 0x33333333' sign='2' encrypt='2' pgpMime='0'/>
...
</pgpRuleList>

Each <pgpRule .../> line is a per-recipient rule stating how Enigmail should enable or disable encryption, signing and PGP/MIME and which key to use.
The file is processed sequentially; if a rule contains a key ID attribute with some value, the rule is applied, but the address that matched will not be rechecked in any following rule. The attributes are defined as follows.

email defines the recipient address(es) to match. Multiple email addresses are separated by spaces. The matching is done on substrings, with curly brackets ({}) defining substring boundaries:

keyId is the list of key IDs to use for the recipient. The key ID is specified in the 8-byte format (e.g. 0x1234ABCD) or in the 16-byte format (e.g. 0x1234567890ABCDEF). Multiple keys are separated by spaces. If a dot (.) is the only value in the field, Enigmail does not use a specific key ID and finds the correct key using the email address. Any further rule for this recipient will be ignored.

sign specifies message signing, encrypt specifies message encryption, and
pgpMime specifies PGP/MIME use. All these attributes must have one of the
following values:

  • 0 – Disables the action even if it was enabled in the Message Composition window. This is equivalent to the Never option in the GUI.
  • 1 – Uses the setting specified in the Message Composition window. This is equivalent to the Yes, if selected in Message Composition option in the GUI.
  • 2 – Enables the action even if it was not enabled in the Message Composition window. This is equivalent to the Always option in the GUI.

When a message is sent to multiple recipients, and multiple rules are applied, the value 0 overrides the value 2: if one of the rules disables the action, the action will not be applied for the message, regardless of any other rule with value 2.