Page 43 - Mercury Manual.book
P. 43

Policies  38
                                                                                  Understanding how policies work



                                    whereas if you leave it unchecked, Mercury will execute the policy task after the global fil-
                                    tering rules have been applied to the message. It is up to you to decide what order is most
                                    suitable for your site.

                 This option is only availa-  This task modifies the raw data of the jobs it examines  If your policy task needs to be able to
                 ble in Mercury v4.01b
                 and later.         modify the messages it processes (for instance, by removing attachments or adding com-
                                    ments to the message body), then you must check this control. This tells Mercury that it
                                    should copy the temporary file it creates to pass to policies back into the job when policy
                                    processing has finished. Only one copy of the job is made for all policy tasks, and if a policy
                                    task modifies the message, the modified version will be supplied to the next policy in the task
                                    list, even if that policy does not have this control checked.  If no active policy task has this
                                    control checked, the temporary copy of the job is simply deleted when all policy processing
                                    is complete. It is your responsibility to ensure that the modifications made by your policy are
                                    reasonable and that the message is still in a legal format afterwards. Checking this control in
                                    any active policy will increase the time it takes to handle policy processing.

                                    Actions Mercury can take when a policy exception occurs
                                    When a policy exception occurs (that is, your policy task indicates to Mercury that it has trig-
                                    gered) there are four actions Mercury can take:

                                    •  Delete the message with no further action

                                    •  Forward the message to another address  enter the address to which the message should
                                       be forwarded in the "parameter" field. Mercury will attach the suspect message to a new
                                       message addressed to the address you supply, and will include any result text provided
                                       by your policy task in the body of the message.

                If your policy is an anti-viral   •  Return the message as undeliverable  Mercury will return the message to the person who
                policy, be cautious about   sent it. You can specify a template file in the parameter field - Mercury will use this tem-
                using this option: most vi-
                rus-generated messages   plate file to construct the body of the delivery failure message: you can use the ~R substi-
                have forged or invalid re-  tution in the template file to include the result text provided by your policy task in the
                turn addresses.
                                       body of the message.

                                    •  Save to a file and notify a user  In the parameter field, enter a directory where the file
                                       containing the message should be placed, then a comma, then the address of the person
                                       who should receive notification of the exception. So, for example, if you wanted to save
                                       messages that caused exceptions in C:\BADMAIL and to send a notification message to
                                       foo@bar.com, you would type C:\BADMAIL,foo@bar.com in the parameter field.
                                       Once the copy has been saved and the notification sent, the message is deleted from the
                                       queue.

                                    Commandline substitutions
                                    When you create a Mercury policy, one of the things you must provide is a commandline: this
                                    is the command that Mercury asks the Windows operating system to execute to test your pol-
                                    icy conditions: it consists of the name of a program, and any optional parameters that program
                                    needs to run. You can imbed certain special characters in the commandline you enter in the
                                    Mercury policy editor - when Mercury runs your command, it will replace the special char-
                                    acters with the proper values they represent. This process is called command substitution.

                                    You can use the following special characters in your policy commandlines:


                                           ~X      Replaced by the name of the file containing the data to test
   38   39   40   41   42   43   44   45   46   47   48