Adding a Recipient

Occasionally, a site may require certain messages to be automatically sent to a known address. For example, all messages containing the keyword "bug" might be sent to an bug tracking system. This policy adds a new recipient to a message (bugs@example.com) when the "Subject" header has the string "bug" in it, the recipient is "old-bugs@example.com", or the header "X-Bug-Id" exists.

# attr NAME=add a recipient
# Adds a "bugs@example.com" recipient to the envelope.
if anyof (header :matches "Subject" "*bug*",
         envelope "to" "old-bugs@example.com",
         header :matches "X-Bug-Id" "*") {
    pmx_add_recipient "bugs@example.com";
}

Description:

Where does this filter go?

The "add a recipient" filter should be placed before the filter in "Policy Script 1: Scan and Deliver Internal Messages" and directly after the pmx_test_mark action. Positioning the "add a recipient" filter at this point ensures that: