User Tools

Site Tools


reference:spamrules_statement_addheader

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
reference:spamrules_statement_addheader [2011/08/23 14:47] – created simonreference:spamrules_statement_addheader [2018/11/14 10:45] (current) – external edit 127.0.0.1
Line 2: Line 2:
 ^Statement  |AddHeader | ^Statement  |AddHeader |
 ^Version  |2.1.7+ | ^Version  |2.1.7+ |
-^Purpose  |Allows you to add or replace the specified header line to the message headers |+^Purpose  |Allows you to addreplace or remove the specified header line in the message headers |
  
-The **AddHeader** statement requires the full text of the header in one continuous string, in the format +The **AddHeader** statement requires the full header line in one continuous string, in the format 
-  AddHeader "<header to add>"+  AddHeader "<full header line>"
  
-=====Example===== +  * If the header line is present: 
-Changing the subject+    * 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
 <code> <code>
 AddHeader "subject: VPOP3SPAM ${Subject}" AddHeader "subject: VPOP3SPAM ${Subject}"
 +</code>
 +
 +Removing a header line, by not setting a value
 +<code>
 +AddHeader "X-MyHeader:"
 +</code>
 +
 +Changing the value of a header, or inserting it if it does not already exist
 +<code>
 +AddHeader "X-MyHeader: The new value of the header named X-MyHeader"
 </code> </code>
reference/spamrules_statement_addheader.1314107233.txt.gz · Last modified: 2018/11/14 10:44 (external edit)