Destination channel-specific rewrites

Destination channel-specific rewrites, $C, $Q
It is possible to have rewrite rules whose application is dependent upon the channel to which a message is being enqueued. This is useful when there are two names for some host, one known to one group of hosts  and one known to another. By using different channels to send mail to each group, addresses can be rewritten to refer to the host under the  name known to each group.

Destination channel-specific rewriting is associated with the channel to which a message is being enqueued and the channel options    and    on that channel. If   is specified on the destination channel, no  channel-specific rewrite checking is done. If  is  specified on the destination channel, channel-specific rule checks are  enforced. is the default.

Destination channel-specific rewriting is not associated with the channel a given address matches. It depends only on the message&#x27;s envelope To address. When a message is enqueued, its envelope To address is first rewritten to determine to which channel the message  will be enqueued. During the rewriting of the envelope To address any   and   control sequences  are ignored.  Once the envelope To  address is rewritten and the destination channel determined, then the    and    control sequences are honored as other addresses associated  with the message are rewritten.

Destination channel-specific rewrite checking is triggered by the presence of a   or    control sequence in the template part of a rule. The characters following the  or ,  up until either an at sign,  , percent sign,  ,  or subsequent  ,  ,  ,  ,  , or  , are interpreted  as a channel name.

 causes the rule to fail if the channel   is not the destination.   causes the rule to fail if the channel   is the destination.

Multiple  and   clauses may be specified. If any one of multiple    clauses matches, the rule will succeed. If any of multiple   clauses matches, the rule will fail.

For example, suppose the local host&#x27;s TCP/IP channel used to  communicate with the Internet is the   channel. Then, to prevent "raw" user@host.bitnet style addresses from appearing  on messages queued to that channel, a rewrite rule of the form .BITNET      $U$%$H$D@interbit.cren.net$Qtcp_local might be used. This will, in messages destined to the   channel, transform addresses of the form user@host.bitnet to  user%host.bitnet@interbit.cren.net.

See also:
 * rules Option
 * Typical TCPIP channels and servers
 * Rewrite rule template substitutions and control sequences