Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
policies [2012-06-08 13:25] randersonpolicies [2012-07-16 14:16] – [Specifications] randerson
Line 5: Line 5:
  
 =====Priorities===== =====Priorities=====
-Priorities are processed in an ascending fashion, this means that 0 will be processed before 1 and 10 before 20.+Priorities are processed in an ascending fashion, this means that 0 will be processed before 110 before 20 etc.
  
 =====Specifications===== =====Specifications=====
-NULL or "any" 
-This will match anything. 
  
-@domain +  * Match **anything** 
-This will match all email @domain.+  * <code>NULL 
 +any</code>
  
-user@domain +  * Match all email @**domain** 
-This will match all email user@domain.+  * <code>@domain</code>
  
-+  * Match all email user@domain 
-(present in r412+ and v2.1.x)+  * <code>user@domain</code>
  
-This will match < >.+  * Match < >. 
 +  * <code>@</code> 
 +    * present in r412+ and v2.1.x
  
-a.b.c.d +  * Match a single sending server IP address 
-Matches a single sending server IP address.+  * <code>a.b.c.d</code>
  
-a.b.c.d/e +  * Match a CIDR formatted range of sending server IP addresses 
-Matches a CIDR formatted range of sending server IP addresses.+  * <code>a.b.c.d/e</code> 
 +    * Additional options for r493+ and v2.1.x 
 +    * Refer to IP address specification
  
-(Additional options for r493+ and v2.1.x)+  * Match a single //peer// server IP address. This **does not** match the IP address of the server where the email came from, this matches the IP address of the server which requested the policy 
 +  * <code>[a.b.c.d]</code> 
 +    * present in r413+ and v2.1.x
  
-Refer to IP Address Specification.+  * Match a CIDR formatted range of peer server IP addresses. This **does not** match the IP address of the server where the email came from, this matches the IP address of the server which requested the policy 
 +  * <code>[a.b.c.d/e]</code> 
 +    * present in r413+ and v2.1.x 
 +    * Additional options for r493+ and v2.1.x 
 +    * Refer to IP Address Specification.
  
-[a.b.c.d] +  * Match an IPv6 range of sending server IP addresses. Bitmask is optional. The bitmask defaults to 128 if the IPv6 address contains all octets or if the right most octet is specified. If there is no octet on the right hand side of :: , the bitmask is automatically calculated depending on how many bits are left outRefer to IP Address Specification for additional formats. 
-(present in r413+ and v2.1.x)+  *<code>a:b:c:d:e:f:g:h[/e]</code> 
 +    present in r493+ and v2.1.x
  
-Matches a single peer server IP address. This DOES NOT match the IP address of the server where the email came fromthis matches the IP address of the server which requested the policy.+  * Match an IPv6 range of peer server IP addresses. This DOES NOT match the IP address of the server where the email came fromthis matches the IP address of the server which requested the policy. The bitmask defaults to 128 if the IPv6 address contains all octets or if the right most octet is specified. If there is no octet on the right hand side of a :: , the bitmask is automatically calculated depending on how many bits are left out. Refer to IP Address Specification for additional formats 
 +  *<code>[a:b:c:d:e:f:g:h[/e]</code> 
 +    * present in r493+ and v2.1.x
  
-[a.b.c.d/e] +  * Match group which, in turn, can comprise of a list of any of the above specification types including groups. Policyd cycles through the group members recursively and looks for an item to matchMaking groups ideal for cases where  you could have any number of negative results before matching, or a large pool of matching members, depending on your set upEffectively, this is a way to accomplish a type of OR "select"
-(present in r413+ and v2.1.x)+  * <code>%group</code>
  
-Matches CIDR formatted range of peer server IP addressesThis DOES NOT match the IP address of the server where the email came from, this matches the IP address of the server which requested the policy.+  * Match SASL usernameYou can also use $* to match any SASL username and $- to match no SASL username 
 +  * <code>$sasl_username</code>
  
-(Additional options for r493+ and v2.1.x)+  * Match the reverse dns of the IP where the client is connecting from 
 +  * <code>whatever.example.com</code> 
 +    * You can use * as a wildcard match against anything except the ., for example hello.*.example.com 
 +    * Specifying example.com will only match example.com 
 +    * Specifying .example.com will match anything.example.com and fu.bar.example.com 
 +    * As a technical note, * is expanded into [a-z0-9\-_\.] and if doesn't prefix the specification it gets ^All reverse dns specifications are matched with end of line $
  
-Refer to IP Address Specification.+=====Examples===== 
 +The preconfigured default polices are defined as follows
  
-a:b:c:d:e:f:g:h[/e] +  <code>Default System Policy
-(present in r493+ and v2.1.x) +
- +
-Matches an IPv6 range of sending server IP addresses. Bitmask is optional. The bitmask defaults to 128 if the IPv6 address contains all octets or if the right most octet is specified. If there is no octet on the right hand side of a :: , the bitmask is automatically calculated depending on how many bits are left out. Refer to IP Address Specification for additional formats. +
- +
-[a:b:c:d:e:f:g:h[/e] +
-(present in r493+ and v2.1.x) +
- +
-Matches an IPv6 range of peer server IP addresses. This DOES NOT match the IP address of the server where the email came from. this matches the IP address of the server which requested the policy. The bitmask defaults to 128 if the IPv6 address contains all octets or if the right most octet is specified. If there is no octet on the right hand side of a :: , the bitmask is automatically calculated depending on how many bits are left out. Refer to IP Address Specification for additional formats. +
- +
-%group +
-Matches a group, which in turn can comprise of a list of any of the above specification types including groups. +
- +
-$sasl_username +
-This will match a SASL username. You can also use $to match any SASL username and $- to match no SASL username. +
- +
-whatever.example.com +
-This will match the reverse dns of the IP where the client is connecting from. +
- +
-- You can use * as a wildcard match against anything except the ., for example hello.*.example.com . You can use * as much as you like. +
-- Specifying example.com will only match example.com +
-- Specifying .example.com will match anything.example.com and fu.bar.example.com +
- +
-As a technical note, * is expanded into [a-z0-9\-_\.] and if . doesn't prefix the specification it gets ^. All reverse dns specifications are matched with end of line $ at the end. +
- +
-Complete Example +
- +
-The pre-configured default polices are defiend as follows... +
- +
-Default System Policy+
 Priority: 0 Priority: 0
 Source: ANY Source: ANY
-Desination: ANY +Desination: ANY</code> 
- +  * <code>Default Outbound Policy
-Default Outbound Policy+
 Priority: 10 Priority: 10
 Source: %internal_ips,%internal_domains Source: %internal_ips,%internal_domains
-Destination: !%internal_domains +Destination: !%internal_domains</code> 
- +  * <code>Default Inbound Policy
-Default Inbound Policy+
 Priority: 10 Priority: 10
 Source: !%internal_ips,!%internal_domains Source: !%internal_ips,!%internal_domains
-Destination: %internal_domains +Destination: %internal_domains</code> 
- +  * <code>Default Internal Policy
-Default Internal Policy+
 Priority: 20 Priority: 20
 Source: %internal_ips,%internal_domains Source: %internal_ips,%internal_domains
-Destination: %internal_domains +Destination: %internal_domains</code>
- +
-These groups are defined in the following manner...+
  
-internal_ips +These groups are defined in the following manner
-10.0.0.0/8+
  
-internal_domains+  * <code>internal_ips 
 +10.0.0.0/8</code> 
 +  * <code>internal_domains
 example.org example.org
 example.com example.com
-example.net+example.net</code>