Host location-specific rewrites

Host location-specific rewrites, $A, $P, $S, $X
Circumstances occasionally require rewriting that&#x27;s sensitive to the location where a host name appears in an address. Host names can appear in several different contexts in an address: in a source route, to the right of the at sign, to the right of a percent sign in the local-part, or to the left of an exclamation point in the local-part. Under normal circumstances a host name should be handled in the same way regardless of where it appears. Situations can arise, however, which may necessitate specialized handling.

Four control sequences are used to control matching on the basis of the host&#x27;s location in the address. specifies that the rule may match a host extracted from a source route,  specifies that the rule may match a host found to the right of the at sign,   specifies that the rule may match a host found to the right of a percent sign, and   specifies that the rule may match a host found to the left of an exclamation point. The rule will fail if the host is from a location other than one specified.

These sequences can be combined in a single rewrite rule. For example, if   and    are specified the rule will match hosts specified in either a source route or to the right of the at sign. Specifying none of these sequences is equivalent to specifying all of them; the rule can match regardless of location.

See also:
 * Rewrite rule template substitutions and control sequences