Previous | Contents | Index |
Substitutions are used to substitute into the rewritten address a character string the value of which is determined by the particular substitution sequence used. For instance in the template
$U@example.com |
$U
is a substitution sequence. It causes the username portion of the
address being rewritten to be substituted into the output of the
template. Thus, if jdoe@vax1.example.com was being rewritten by this
template, the resulting output would be jdoe@example.com, the $U
substituting in the username portion, jdoe, of the original address.
Special control sequences may also appear in rewrite rule templates. These sequences impose additional conditions to the applicability of a given rewrite rule: not only must the pattern portion of the rewrite rule match the host/domain specification being examined, but other aspects of the address being rewritten must meet conditions set by the control sequence or sequences. For instance, the $E control sequence requires that the address being rewritten be an envelope address while the $F sequence requires that it be a forward pointing address. Thus, the rewrite rule
example.com $U@example.com$E$F |
example.com $U%example.com@directory-daemon example.com $U@example.com$Ndirectory |
A summary of template substitutions and control sequences is presented in Table 2-3.
Substitution sequence | Section | Substitutes |
---|---|---|
$D | 2.2.6.2 | Portion of domain specification that matched |
$H | 2.2.6.2 | Unmatched portion of host/domain specification; left of dot in pattern |
$L | 2.2.6.2 | Unmatched portion of domain literal; right of dot in pattern literal |
$U | 2.2.6.1 | Username from original address |
$0U | 2.2.6.1 | Local part (username) from original address, minus any subaddress |
$1U | 2.2.6.1 | Subaddress, if any, from local part (username) of original address |
$$ | 2.2.6.3 | Inserts a dollar sign (literal) |
$% | 2.2.6.3 | Inserts a percent sign (literal) |
$@ | 2.2.6.3 | Inserts an at sign (literal) |
$\ | 2.2.5.4 | Force substituted material to lowercase |
$^ | 2.2.5.4 | Force substituted material to uppercase |
$_ | 2.2.5.4 | Use original case |
$W | 2.2.6.9 | Substitutes in a random, unique string |
$]...[ | 2.2.6.4 | LDAP search URL lookup |
$( text) | 2.2.6.5 | General database substitution; rule fails if lookup fails |
${...} | 2.2.6.6 | Apply specified mapping to supplied string |
$[...] | 2.2.6.7 | Invoke customer supplied routine; substitute in result |
$&n | 2.2.6.8 | nth part of unmatched (or wildcarded) host as counting from left to right starting from 0 |
$! n | 2.2.6.8 | nth part of unmatched (wildcarded) host as counted from right to left starting from 0 |
$* n | 2.2.6.8 | nth part of matching pattern as counting from left to right starting from 0 |
$# n | 2.2.6.8 | nth part of matching pattern as counted from right to left starting from 0 |
$ nD | 2.2.6.2 | Portion of domain specification that matched, preserving from the nth leftmost part starting from 0 |
$ nH | 2.2.6.2 | Portion of host/domain specification that didn't match, preserving from the nth leftmost part starting from 0 |
Control sequence | Section | Effect on rewrite rule |
$E | 2.2.6.12 | Apply only to envelope addresses |
$B | 2.2.6.12 | Apply only to header/body addresses |
$F | 2.2.6.12 | Apply only to forward-directed ( e.g., To:) addresses |
$R | 2.2.6.12 | Apply only to backwards-directed ( e.g., From:) addresses |
$M channel | 2.2.6.10 | Apply only if channel channel is rewriting the address |
$N channel | 2.2.6.10 | Fail if channel channel is rewriting the address |
$Q channel | 2.2.6.11 | Apply if sending to channel channel |
$C channel | 2.2.6.11 | Fail if sending to channel channel |
$S | 2.2.6.13 | Apply if host is from a source route |
$A | 2.2.6.13 | Apply if host is to the right of the at sign |
$P | 2.2.6.13 | Apply if host is to the right of a percent sign |
$X | 2.2.6.13 | Apply if host is to the left of an exclamation point |
$T newtag | 2.2.6.14 | Set the rewrite rule tag to newtag |
$ n? errmsg | 2.2.6.15 | If rewriting fails return errmsg instead of the default error message |
Previous | Next | Contents | Index |