Rewrite host domain and IP literal substitutions

Rewrite host/domain and IP literal substitutions, $D, $H, $nD, $nH, $L
Any occurrences of $H are replaced with the portion of the host/domain specification that was not matched by the rule. Any occurrences of $D are replaced by the portion of the host/domain specification that was  matched by the rewrite rule. $nH and $nD are variants that preserve the normal $H or $D portion from the nth  leftmost part starting counting from 0. Or another way of putting it is that $nH and $nD omit the leftmost n parts  (starting counting from 1) of what would normally be a $H or $D,  substitution, respectively. In particular, $0H is equivalent to $H and $0D is equivalent to $D.

For example, suppose the address jdoe@host.domain.com matches the rewrite rule host.domain.com   $U%$1D@TCP-DAEMON Then the result of the rewrite rule will be jdoe@domain.com with TCP-DAEMON used as the outgoing channel. Here where $D would have substituted in the entire domain that matched, host.domain.com, the $1D  instead substitutes in the portions of the match starting from part 1  (part 1 being domain), so substitutes in domain.com.

$L substitutes the portion of a domain literal that was not matched by the rewrite rule.

See also:
 * Rewrite rule template substitutions and control sequences