Changing the current tag value

From Messaging Server Technical Reference Wiki
Jump to: navigation, search


Changing the current tag value, $T

The $T control sequence is used to change the current rewrite rule tag. The rewrite rule tag is prepended to all rewrite rule patterns before they are looked up in the configuration file/rewrite group and domain database. Text following the $T, up until either an at sign, percent sign, $N, $M, $Q, $C, $T, or $?, is taken to be the new tag.

Tags are useful in handling special addressing forms where the entire nature of an address is changed when a certain component is encountered. For example, suppose that the special host name internet, when found in a source route, should be removed from the address and the resulting address forcibly matched against the channel whose official_host_nameTCP-DAEMON. This could be implemented with rules like the following (localhost is assumed to be the official name of the local host):


internet              $S$U@localhost$Ttcp-force| 
tcp-force|.           $U%$H@TCP-DAEMON 

The first rule will match the special host name internet if it appears in the source route. It forcibly matches internet against the local channel, which insures that it will be removed from the address. A rewrite tag is then set. Rewriting proceeds, but no regular rule will match because of the tag. Finally, the default rule is tried with the tag, and the second rule of this set fires, forcibly matching the address against the channel with official_host_name of TCP-DAEMON, regardless of any other criteria.


See also: