User Tools

Site Tools


reference:spamrules_statement_addbag

Spam Filter Rules: AddBag

Statement AddBag
Version 2.2.1+
Purpose Adds a value into a 'bag' containing a collection of values, creating the bag if necessary

The AddBag statement requires a type, bag name and value, in the format

AddBag <type> <bag name> <value>
  • <type> may be either 'unique' or 'multi'
  • If <type> is 'unique', then 'value' will only be added to 'bag' if it does not already exist there
  • If <type> is 'multi', then 'value' will always be added to 'bag'

Example

The following example demonstrates the 'unique' method of adding a value to a bag

${myvalue} = "a"
AddBag unique bag1 ${myvalue}
AddBag unique bag1 "b"
AddBag unique bag1 "a"
# 'bag1' bag contains the values "a" and "b"

The following example demonstrates the 'multi' method of adding a value to a bag

${myvalue} = "a"
AddBag multi bag2 ${myvalue}
AddBag multi bag2 "b"
AddBag multi bag2 "a"
# 'bag2' bag contains the values "a", "b" and "a"
reference/spamrules_statement_addbag.txt · Last modified: 2018/11/14 10:45 by 127.0.0.1