# 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: Global options. # "global": { # Option: socket # Type: String # Notes: The socket used to communicate with the MTA. # # Examples: # unix:/path/to/socket a named pipe # inet:8899 listen on ANY interface # inet:8899@localhost listen on a specific interface # inet6:8899 listen on ANY interface # inet6:8899@[2001:db8:1234::1] listen on a specific interface # Value: [ SOCKET ] "socket": "inet:8898@127.0.0.1", # Option: local_addrs # Type: List # Notes: 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: Enable or disable logging of rules and modifications. # Value: [ true | false ] # "log": true }, # Section: rules # Notes: Rules and related modifications. # "rules": [ { # Option: name # Type: String # Notes: Name of the rule. # Value: [ NAME ] # "name": "myrule", # Section: conditions # Notes: Optional conditions to process the rule. # If multiple conditions are set, they all # have to be true to process the rule. # "conditions": { # Option: local # Type: Bool # Notes: Condition wheter the senders host address is listed in local_addrs. # Value: [ true | false ] # "local": false, # Option: hosts # Type: String # Notes: Condition wheter the senders host address is listed in this list. # Value: [ LIST ] # "hosts": [ "127.0.0.1" ], # Option: envfrom # Type: String # Notes: Condition wheter the envelop-from address matches this regular expression. # Value: [ REGEX ] # "envfrom": "^(?!.+@mycompany\\.com).+$" }, # Section: modifications # Notes: Modifications of the rule. # "modifications": [ { # Option: name # Type: String # Notes: Name of the modification. # Value: [ NAME ] # "name": "add_test_header", # Option: type # Type: String # Notes: Type of the modification. # Value: [ add_header | del_header | mod_header ] # "type": "add_header", # Option: header # Type: String # Notes: Name of the header. # Value: [ NAME ] # "header": "X-Test-Header", # Option: value # Type: String # Notes: Value of the header. # Value: [ VALUE ] # "value": "true" }, { "name": "modify_subject", "type": "mod_header", # Option: header # Type: String # Notes: Regular expression to match against header lines (e.g. Subject: Test-Subject). # Value: [ REGEX ] # "header": "^Subject:", # Option: search # Type: String # Notes: Regular expression to match against the headers value. # Values: [ VALUE ] # "search": "(?P.*)", # Option: value # Type: String # Notes: New value of the header. # Values: [ VALUE ] "value": "[EXTERNAL] \\g" }, { "name": "delete_received_header", "type": "del_header", # Option: header # Type: String # Notes: Regular expression to match against header lines (e.g. Subject: Test-Subject). # Value: [ REGEX ] # "header": "^Received:" } ] } ] }