Source channel-specific rewrites

Source channel-specific rewrites, $M, $N, $1M, $1N
It is possible to have rewrite rules that act only in conjunction with specific source channels. This can be useful when a hostname has a different meaning when it appears in a message arriving on one channel and another when it appears in a message arriving on a different channel -- such name "collisions" used to arise in Bitnet days. Source channel-specific rewrite rules can also be useful when it is desired to achieve different routing for messages coming in on different channels:a perhaps routing through a spam/virus scanner box for messages from some "untrusted" source.

Source channel-specific rewriting is associated with the channel that is operating and the channel options    and. If  is specified on the  channel associated with an MTA component that is doing the rewriting,  no channel-specific rewrite checking is done. If  is  specified on the channel, channel-specific rule checks are enforced. is the default.

Source channel-specific rewriting is not associated with the channel a given address matches. It depends only on the MTA component doing the rewriting and that component&#x27;s channel table entry.

Source channel-specific rewrite checking is triggered by the presence of a    or   control sequence in the template  part of a rewrite 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 currently doing the rewriting.   causes the rule to fail if the channel   is doing the rewriting.

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.

The  control sequence causes the rule to fail if a  non-"internal" channel is currently doing the rewriting; that is, the rule will succeed only if an "internal" channel is doing the rewriting. The  control sequence causes the rule to fail if an "internal" channel is currently doing the rewriting; that is, the rule will succeed only if a non-"internal" channel is doing the rewriting. ("Internal" here means internal-to-the-MTA: a reprocess, process, or conversion channel type of channel;  it does not mean  a   type of channel.)

aAlternatively, and often more conveniently, source-specific routing can be achieved via the  mapping table.

See also:
 * rules Option
 * CONVERSIONS mapping table
 * Rewrite rule template substitutions and control sequences