Adding a Header

Adding a new header to all messages can be useful for tracking purposes. This filter adds an “X-Seen-By” header to all messages.

# attr NAME=add a header
# Adds an 'X-Seen-By' header to all messages.
pmx_add_header "X-Seen-By" "%%HOSTNAME%%";


  • The pmx_add_header action adds an “X-Seen-By” header to the message. The value of the header is the hostname of the PureMessage machine (for example The %%HOSTNAME%% template variable is called. For a list of supported template variables, see the pmx-policy manpage.

Where does this filter go?

The “add a header” 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 header” filter at this point ensures that:

  • The “add a header” filter always executes. (A stop command from another filter will not prevent it from executing.)
  • Subsequent spam and virus filters will always execute. (The “add a header” filter does not contain a stop command that would otherwise end the policy script before spam and virus filters execute.)