Example: Add Corporate Information to Outbound Messages

About this task

It is common for corporate email messages to carry standard tag lines that are appended to outgoing messages. The following rule automatically adds specified information to messages sent to external addresses, but not to messages exchanged within a company. (Note that this example assumes you are using the default PureMessage Policy configuration.)

To add corporate information to outbound messages using the PureMessage Manager:

Follow these steps

  1. First, create a list containing the email addresses for all internal mail system users:
    1. click New beside Lists on the Policy tab sidebar. The Add List/Map page is displayed.
    2. From the Type drop-down list, select List.
    3. In the ID text box, enter Local.
    4. In the Name text box, enter Local Users.
    5. In the Description text box, enter Company email addresses.
    6. From the Match Type list, select Exact.
    7. Click Save. You are prompted to add items to the list. Click here to display the Edit List page.
    8. Enter the desired email addresses in the Add Items text box, be sure that each entry appears on a separate line.
    9. Click Add. The email addresses are included under List Items.
  2. Next, create a policy that appends a tag line inviting feedback from all external mail recipients:
    1. Click Create beside Backups on the Policy tab sidebar. A backup of the current policy is created; a backup entry with the current date and time are displayed in the Backups section of the sidebar.
    2. On the Policy tab, click the Mail from internal hosts rule.
    3. Click add rule (beside Execute actions and rules). This creates a new rule at the bottom of the Internal Hosts section of the PureMessage Policy.
      1. Configure the Test:
        1. Change the (New Rule) text to Add message inviting feedback.
        2. From the Tests drop-down list, select Recipient's address. Select Is a not member of as the operator and Local Users from the available lists.
      2. Configure the Action:
        1. Click add action. This creates the action configuration template.
        2. In the new Execute actions and rules drop-down list, select Add Banner.
        3. Click the Arguments button to the right of the actions drop-down list.
        4. Select the Append banner to message body check box.
        5. In the Data_type text box, select Filename.
        6. Using a text editor, create and save a file containing the following:
          At Acme, we are always looking for ways to serve you better.
          We encourage you to send any questions or comments to
          "feedback@acme.com" or call our customer service department at
          1-800-000-0000.
        7. In the File or string text box, enter the path to the file created in the previous step. Click OK.

        8. In the second rules drop-down list, select Stop processing.
      3. Click Save

      4. Click the Commit link to update the live policy script. PureMessage displays a message advising that the milter is running with a stale configuration. Do not restart the milter (so you can test the changes without making them live).
    4. Test New Policy: Because the milter has not been restarted, it is still using the original policy. Therefore, the new policy can be tested without making it "live".
      1. Click Test Current Policy link on the Policy tab sidebar.
      2. In the Envelope from text box, type a sender's email address.
      3. In the Envelope to text box, type an email address that is not included in your Local Users list.
      4. Click Test. The test runs, and the test results are displayed. In the Details window, notice there are POLICY RULE HIT entries for Mail from internal hosts and Add message inviting feedback, and that there is a POLICY ACTION entry indicating that a banner has been added.
    5. If satisfied with the new policy, click Restart now to restart the milter and make the new policy live. To restore the original policy, click the backup link, and select OK.

What to do next

Policy Script

To add corporate information to outbound messages by editing the policy script:

if pmx_virus {
    # attr NAME=Allow unscannable messages to pass through
    if pmx_virus_cantscan {
        keep;
        stop;
    }
    reject "One or more viruses were detected in the message.";
    stop;
}
# attr NAME=Add message inviting feedback
elsif not address :all :memberof :comparator "i;ascii-casemap" ["to",
                                                                "cc",
                                                                "bcc"]
                                                               ["Local"]
{
    pmx_add_banner :body :file "/opt/pmx6/home/banner.txt";
    stop;
}

See the Policy Script Tutorial for more information about modifying the policy script from the command line.