User Tools

Site Tools


reference:spamrules_statement_addheader

Spam Filter Rules: AddHeader

Statement AddHeader
Version 2.1.7+
Purpose Allows you to add, replace or remove the specified header line in the message headers

The AddHeader statement requires the full header line in one continuous string, in the format

AddHeader "<full header line>"
  • If the header line is present:
    • It will be replaced if an alternative value is specified.
    • It will be removed if no value is specified.
  • If the specified header is not already present, it will be inserted at the end of the headers.
  • AddHeader should not be used where the header name may appear more than once (e.g. “Received: …”).

From VPOP3 v6.20 onwards, the header modifier format has been extended:

  • If you prefix it with -, it will be added at the the start of the final headers
  • If you prefix it with +, it will be added at the end of the final headers
  • If you prefix it (after the -/+ above) with “{”<username>“}” (eg {bob}Subject: Bob's new subject ) it will only be added to the headers when placed into that user's mailbox
  • If you prefix it with #, it will remove the header if the data matches the regular expression specified in the modifier's data - eg #Bibble: ^[a-z]{5}$ - otherwise the original header will be left in place

Examples

Changing the subject header

AddHeader "subject: VPOP3SPAM ${Subject}"

Removing a header line, by not setting a value

AddHeader "X-MyHeader:"

Changing the value of a header, or inserting it if it does not already exist

AddHeader "X-MyHeader: The new value of the header named X-MyHeader"
reference/spamrules_statement_addheader.txt · Last modified: 2018/11/14 10:45 by 127.0.0.1