# This is an example /etc/pymodmilter.conf file. # Copy it into place before use. # # The file is in JSON format. # # The global option 'log' can be overriden per rule or per modification. # { # Section: global # Notes: Set default options. # "global": { # Option: local_addrs # Type: List # Notes: Set a list of local hosts and networks. # Value: [ LIST ] # "local_addrs": ["127.0.0.0/8", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"], # Option: log # Type: Bool # Notes: Set if processing of rules and modifications is logged. # Value: [ true | false ] # "log": true }, # Section: rules # Notes: Set rules and related modifications. # "rules": [ { # Option: name # Type: String # Notes: Set the name of the rule. # Value: [ NAME ] # "name": "MyRule", # Section: conditions # Notes: Optionally set conditions to run the rule. # If multiple conditions are specified, they all # have to be true to run the rule. # "conditions": { # Option: local # Type: Bool # Notes: Set a condition on the senders host address. # Set to true to execute the rule only for emails originating # from addresses defined in local_addrs and vice versa. # Value: [ true | false ] # "local": false, # Option: hosts # Type: String # Notes: Set a condition on the senders host address. # The rule will only be executed if the list contains the # senders host address. # Value: [ LIST ] # "hosts": [ "127.0.0.1" ], # Option: envfrom # Type: String # Notes: Set a regular expression to match against the envelope-from address. # Value: [ REGEX ] # "envfrom": "^(?!.+@mycompany\\.com).+$" }, # Section: modifications # Notes: Set modifications for the rule. # "modifications": [ { # Option: name # Type: String # Notes: Set the name of the modification. # Value: [ NAME ] # "name": "AddHeader", # Option: type # Type: String # Notes: Set the modification type. # Value: [ add_header | del_header | mod_header ] # "type": "add_header", # Option: header # Type: String # Notes: Set the name of the new header. # Value: [ NAME ] # "header": "X-Test-Header", # Option: value # Type: String # Notes: Set the value of the new header. # Value: [ VALUE ] # "value": "true" }, { "name": "ModifyHeader", "type": "mod_header", # Option: header # Type: String # Notes: Set a regular expression to match against header lines (e.g. Subject: Test-Subject). # Value: [ REGEX ] # "header": "^Subject:", # Option: search # Type: String # Notes: Set a regular expression to match against the headers value. # Values: [ VALUE ] # "search": "(?P.*)", # Option: value # Type: String # Notes: Set the value of the header. # Values: [ VALUE ] "value": "[EXTERNAL] \\g" }, { "name": "DeleteHeader", "type": "del_header", # Option: header # Type: String # Notes: Set a regular expression to match against header lines (e.g. Subject: Test-Subject). # Value: [ REGEX ] # "header": "^Received:" } ] } ] }