Rewrite Rules

To Add, Delete, or Modify A Rewrite Rule  

134  

The Admin Console enables you to add a rewrite rule to an existing or newly created channel. It also enables you to delete or modify an existing rewrite rule associated with an existing channel.

Before adding or modifying a rewrite rule for a particular channel, read the associated conceptual information. For complete conceptual information, refer to "Rewrite Rules" on page 13.

When adding or modifying a rewrite rule, you may need to configure the following elements:

Pattern
Domain template
Element to which rule applies
Address direction
Order of rewrite rules

A pattern is a string composed of ASCII text, which may include a wildcard characters that can potentially match the host/domain specification of an incoming email address. The host/domain specification is the portion that is to the right of the at (@) sign; for example, in the address john.smith@eng.acme.com, the host/domain specification of the address is eng.acme.com. The wildcard character that you can specify is an asterisk (*). An example of a pattern entry is

*.acme.com

A domain template defines how the host/domain specification of the address is rewritten. A template can be composed of one or both of the following elements:

A full static host/domain specification, for example, corp.acme.com, or a portion of a host/domain specification (a portion of the address tokens), for example, .com.
A single field substitution string that dynamically rewrites one address token of the host/domain specification represented by a wildcard character (*). The address token to be rewritten can be the portion of the address that did not match the rewrite rule pattern or the portion that matched the wildcard character. The rewriting of a host/domain specification is based on the contents of the specification itself. The template can include multiple field substitution strings.

The syntax of the field substitution string is as follows:

$&n

where n is an integer from 0 to infinity. n represents the unmatched or wildcard address token that is to be rewritten. From left to right, the leftmost address token is represented by the integer 0; the second from the left is represented by the integer 1, and so on. An example of a template entry is

$&0.$&1.com

For complete information, including a full example of the domain template, refer to "Rewriting the Host/Domain Specification" on page 15.

Element to which rule applies determines whether the rewrite rule applies to the address that appears on the envelope only, the message header only, or both.

Address direction determines whether the rewrite rule applies to a forward address (To:, CC:, and BCC: headers) or a backward address (From: or Reply-to: headers).

You can reconfigure the order of multiple rewrite rules containing the same pattern but different domain templates by moving one of the rules up or down in the Admin Console's rewrite rule display. Changing the order of these types of rewrite rules causes the channel to scan these rules in the reconfigured order when an incoming message appears. For more information on the order of rewrite rules, refer to "Matching Host/Domain Specification With A Rewrite Rule Pattern" on page 13.


 

To Add, Delete, or Modify A Rewrite Rule



AdminConsole>IMTA>Channels>double-click channel>Properties>Rewrite Rules  

  1. In the Sections list of the Channel property book (see "To Access Channels Property Book" on page 121, click Rewrite Rules.
 

FIGURE  4-22 Rewrite Rules Section

  The Rewrite Rules section is divided into two sections: a display of already existing rewrite rules in the top part of the display and various configurable fields in the bottom part of the display.
  2. If you want to delete, modify, move up, or move down an existing rule in the display, click on the rule in the top part of the display to highlight it.
  The bottom part of the display shows the existing entries for pattern and template as well as the settings for protocol and direction.
  3. Take one of the following actions with the existing rewrite rule:
  a. Delete the rule.
  Click on the Delete button.
  b. Modify the rule.
  Delete and reenter the Pattern and Template entries and use the pull-down menus to reselect the value for Rules Applies to and Address. Click the Modify button.
  c. Move the rule up or down in the list of rules.
  Click either the Move Up or Move Down button.
  4. If desired, add a new rewrite rule using the following steps:
  a. Specify a pattern.
  Enter a pattern composed of ASCII text and the wildcard character of an asterisk (*). An example of a pattern entry is
  *.acme.com
  b. Specify a template.
  Enter either a full host/domain address, for example, corp.acme.com, or a partial host/domain address set off by decimals, for example, .com.
  If you enter a partial host/domain address, you also need to specify the appropriate number of field substitution strings. The syntax of the field substitution string is as follows:
  $&n
  where n is an integer from 0 to infinity. The integer represents the address token that is to be rewritten. From left to right, the leftmost address token is represented by the integer 0; the second from the left is represented by the integer 1, and so on. For example, if an incoming address matches the following rewrite rule pattern:
  *.acme.com
  then the domain template will consist of the following:
  $&0.acme.com
  c. Specify whether you want the rewrite rule to apply to envelope only, message header only, or both using the pull-down menu.
  d. Specify whether you want the rewrite rule to apply to a forward address only, a backward address only using the pull-down menu.
  e. Click the Add button.
  5. Click the Apply button.
  You are prompted to restart the IMTA. Click Yes.



Copyright © 1999 Sun Microsystems, Inc. All Rights Reserved.