Format of the field definition section

The field definition section is the first section in any SMTP rules data set. It defines any applicable alias fields, and it is introduced by the following heading:
Field Definition Section
This section allows similar fields to be grouped under an alias or common name. This name, or alias, is used to represent the field list. You can define an arbitrary number of aliases representing a set of field lists.

An alias name can be any alphanumeric sequence of characters that is not a predefined keyword within the SMTP rules (see the following form). However, the alias name DefaultFields is treated specially by the SMTP configuration interpreter. If DefaultFields is defined, and if a rule is written that does not specify an associated field alias, the rules interpreter assumes that DefaultFields is the associated field alias.

The alias definition within this section is of the following form:
alias_name = alias_definition; optional comment
where alias_name is the name of the alias and alias_definition is an expression describing which fields are to be grouped under this alias. This expression can be as simple as a single field name. For example:
MyAlias = 'To';
The aliases can be a list or set of field names. The field names To, From, Cc, and Bcc, in the following example are part of a set of field names referenced by the alias MyAlias.
MyAlias = 'To' 'From' 'Cc' 'Bcc' ; -- first list of fields
You can combine field names and previously defined aliases to create a new alias. In the following example, the set of field names defined as MyAlias and the field names in the new alias YourAlias are combined to form a third set. The new alias TheirAlias is the union of both aliases and contains the fields of MyAlias and YourAlias.
MyAlias    = 'To' 'From' 'Cc' 'Bcc';
YourAlias  = 'Errors-To' 'Warnings-To';
TheirAlias =  MyAlias YourAlias;
In the previous example, TheirAlias is an alias that represents the following fields:
TheirAlias:  'To' 'From' 'Cc' 'Bcc' 'Errors-To' 'Warnings-To'
You can perform the following operations on set members of the alias to create a subset of the initial alias:

Union and difference operations

Certain field names can be added to or omitted from a new alias of field names by using a minus sign to omit set members and an optional plus sign to include another field name. In the mathematics of sets, when you add together 2 or more sets, they form a union. When set members are omitted, the remaining set is created by the difference operation. In the following example HerAlias and HisAlias are defined. The alias HisAlias is created from the union of TheirAlias, HerAlias, and the omission of Warning-To and Bcc from the sets:
HerAlias   = 'Reply-To' 'Sender';
HisAlias   = TheirAlias - 'Warnings-To' - 'Bcc' + HerAlias;
In the previous example, HisAlias is an alias that represents the following fields:
HisAlias:  'To' 'From' 'Cc' 'Errors-To' 'Reply-To' 'Sender'

Intersection operations

A field definition can include an intersection operation. When the intersection operation is applied to two field expressions, the resulting set contains the fields common to both. In the following example, MyAlias and YourAlias are defined. The alias OurAlias is created from the intersection of MyAlias and YourAlias. The asterisk (*) is the intersection operator.
MyAlias    = 'Bcc' 'Cc' 'From' 'Reply-To';
YourAlias  = 'Resent-From' 'Cc' 'Sender' 'To' 'Bcc';
OurAlias   = MyAlias * YourAlias; -- the intersection
In the previous example, OurAlias represents the following fields:
OurAlias:  'Bcc' 'Cc'
In the following complex example TheirAlias is created from the intersection of YourAlias with the sum of MyAlias plus Resent-From:
TheirAlias = (MyAlias + 'Resent-From') * YourAlias;
In the previous example, TheirAlias represents the following fields:
TheirAlias: 'Bcc' 'Cc' 'Resent-From'
The parentheses within the definition of TheirAlias perform the same functions as in algebra. Field expressions are evaluated from left to right, but the intersection operation has greater priority than union and difference operations. If parentheses were not used in the definition of TheirAlias, the result would be:
TheirAlias: 'Bcc' 'Cc' 'From' 'Reply-To' 'Resent-From'