TCP/IP Configuration and Management Manual

Configuring the NonStop TCP/IP Subsystem
TCP/IP Configuration and Management Manual427132-004
3-46
Simple Mail Transfer Protocol (SMTP)
Rule for rewriting—R
The core of address parsing is the rewriting rules, which you specify in lines starting
with R. These rules are ordered production systems. Each rule has a left-hand side
and a right-hand side. When an address is to be rewritten, the address parser scans
through the rule sets comparing the left-hand side against the specified address. When
a rule matches, the address is replaced by the right-hand side of the rule. The syntax
of an R line is as follows:
RLHS space RHS space COMMENTS
In the syntax, space denotes one or more spaces that separate the left-hand side
from the right-hand side and the comments. If a space has to be embedded in the
rules, precede it with a backslash (\) character. Any backslash character found in the
input stream is ignored and the next character is taken literally (as part of the current
token being scanned).
SMTP includes several sets of rewriting rules. Some are used internally and must have
specific semantics. Others do not have specific semantics and can be referred to by
the mailer definitions or by other rewriting sets.
The left-hand side of rewriting rules contains a pattern. Normal words are simply
matched directly. Metasyntax is introduced by using a dollar sign ($).
The metasymbols are:
If any of these metasymbols match, they are assigned to the symbol $n for
replacement on the right-hand side, where n is the index in the left-hand side. The first
piece is numbered 1. For example, if the following left-hand side:
$+:$+
is applied to the input:
UCBARPA:eric
the rule will match, and the values passed to the right-hand side are:
$1 UCBARPA
$2 eric
When the left-hand side of a rewriting rule matches, the input is deleted and replaced
by the right-hand side. Tokens are copied for rewriting directly from the right-hand side
unless they begin with a dollar sign.
$* Match zero or more tokens
$+ Match one or more tokens
$- Match exactly one token
$=x Match any token in class x
$~x Match any token not in class x