Sun Java System Messaging Server 6 2005Q4 Administration Reference

Rewrite Rule Patterns and Tags

Most rewrite rule patterns consist either of a specific host name that will match only that host or of a subdomain pattern that will match any host/domain in the entire subdomain.

For example, the following rewrite rule pattern contains a specific host name that will match the specified host only:

host.siroe.com

The next rewrite rule pattern contains a subdomain pattern that will match any host or domain in the entire subdomain:

.siroe.com

This pattern will not, however, match the exact host name siroe.com; to match the exact host name siroe.com, a separate siroe.com pattern would be needed.

The MTA attempts to rewrite host/domain names starting from the specific host name and then incrementally generalizing the name to make it less specific. This means that a more specific rewrite rule pattern will be preferentially used over more general rewrite rule patterns. For example, assume the following rewrite rule patterns are present in the configuration file:

hosta.subnet.siroe.com
.subnet.siroe.com
.siroe.com

Based on the rewrite rule patterns, an address of jdoe@hosta.subnet.siroe.com will match the hosta.subnet.siroe.com rewrite rule pattern; an address of jdoe@hostb.subnet.siroe.com will match the .subnet.siroe.com rewrite rule pattern; and an address of jdoe@hostc.siroe.com will match the .siroe.com rewrite rule pattern.

In particular, the use of rewrite rules incorporating subdomain rewrite rule patterns is common for sites on the Internet. Such a site will typically have a number of rewrite rules for their own internal hosts and subnets, and then will include rewrite rules for the top-level Internet domains into their configuration from the file internet.rules (msg_svr_base/config/internet.rules).

This file is required to contain the following:

In addition to the more common sorts of host or subdomain rewrite rule patterns already discussed, rewrite rules may also make use of several special patterns, summarized in Table 4–3, and discussed in the following subsections.

Table 4–3 Summary of Special Patterns for Rewrite Rules

Pattern  

Description/Usage  

$* 

Matches any address. This rule, if specified, is tried first regardless of its position in the file. 

$% 

Percent Hack Rule. Matches any host/domain specification of the form A%B. 

$! 

Bang-style Rule. Matches any host/domain specification of the form B!A. 

[] 

IP literal match-all rule. Matches any IP domain literal. 

Matches any host/domain specification. For example, joe@[129.165.12.11]

In addition to these special patterns, Messaging Server also has the concept of tags, which may appear in rewrite rule patterns. These tags are used in situations where an address may be rewritten several times and, based upon previous rewrites, distinctions must be made in subsequent rewrites by controlling which rewrite rules match the address. For more information, see the Sun Java System Messaging Server 6 2005Q4 Administration Guide.