Create a rule that causes PureMessage to perform different actions, depending on the recipient of the message. When such a rule is applied, PureMessage splits a message addressed to multiple recipients into copies and operates on the copies independently. This makes it possible to specify different actions for the individual recipients of messages addressed to multiple recipients.
Per-recipient rules are created using Envelope from and Envelope to tests. In this example, you will create a rule that adds a banner to messages addressed to the customer service representatives of company "XYZ".
To Run Per-Recipient Tests using the PureMessage Manager:
Policy Script
To run per-recipient tests by manually editing the policy script:
# attr NAME=Mail from external hosts else { pmx_add_header "X-PMX-Version" "%%PMX_VERSION%%"; pmx_mark "Size" "%%MESSAGE_SIZE%%"; # attr NAME=Clean mail containing viruses if pmx_virus { pmx_file "Virus"; pmx_virus_clean "cantclean.tmpl"; pmx_replace_header "Subject" "[PMX:VIRUS] %%SUBJECT%%"; pmx_replace_header "X-PerlMx-Virus-Detected" "%%VIRUS_IDS%%"; } # attr NAME=Add banner for selected recipients only if envelope :comparator "i;ascii-casemap" :all :is ["to"] ["kurt@service.xyz.com", "kris@service.xyz.com", "dave@service.xyz.com"] { pmx_add_banner :body :data "ATTENTION"; keep; } }
See the Policy Script Tutorial for more information about modifying the policy script from the command line.