Switchchannel, allowswitchchannel, noswitchchannel, userswitchchannel Channel Options

Selection of alternate source channels
When an MTA server process (e.g., an SMTP server process) accepts an incoming connection from a remote system it must choose a so-called source channel with which to associate the connection. Normally this decision is based on the transport used; for example, an incoming TCP/IP  connection to an SMTP server (a Dispatcher service running the SMTP server image) is automatically associated with the    channel, while an incoming TCP/IP connection to an  LMTP server (a Dispatcher service running the LMTP server that delivers to the Message Store) is automatically associated with the    channel   - unless such automatic, default associations are overridden via the Dispatcher&#x27;s   option being set to a   value, e.g.: msconfig&#x3e; ! Do not need to set the dispatcher.service:SMTP_SPECIAL.image msconfig&#x3e; ! since the service name begins with "SMTP" msconfig&#x3e; set dispatcher.service:SMTP_SPECIAL.logfilename IMTA_LOG:tcp_special_server.log msconfig# set dispatcher.service:SMTP_SPECIAL.tcp_ports special-port msconfig# set dispatcher.service:SMTP_SPECIAL.parameter "CHANNEL=tcp_special" (Note the quoting of the value of the  option, required due to the presence of the equal sign character,  .)

In legacy configuration, this corresponds to a definition in the   file along the lines of: &#x5b;SERVICE=SMTP_SPECIAL&#x5d; IMAGE=IMTA_BIN:tcp_smtp_server LOGFILE=IMTA_LOG:tcp_special_server.log PORT=special-port PARAMETER=CHANNEL=tcp_special In the case of SMTP, however, the convention of a single incoming channel breaks down when it is desired to handle connections from different sources differently. That is, in the SMTP case, it can be useful to have the association of source channel with connections be controlled not only at the Dispatcher level, but for further distinctions (so-called source channel "switching") to be performed based on additional criteria, within the SMTP server process itself.

The  channel option provides a way   associate different incoming channels with different source IP addresses. If  is specified on the initial channel the SMTP server uses, the IP address of the connecting (originating) host will be rewritten (using envelope From style rewriting) and matched against the channel table and if it matches then the source channel will change accordingly. If no IP address match is found or if a match is found that matches the original default incoming channel, the MTA may optionally try matching using the host name found by doing a DNS reverse lookup. The source channel may change to any channel marked  or   (the default). specifies that no channel switching should be done to or from the channel.

Specification of  on anything other than a channel that a server associates with by default will have no effect. At present  only affects SMTP channels, but there are actually no other channels where   would be reasonable. In particular, internal channels like   or   never need to switch. Also, LMTP servers do not support.

Note that use of the (not-recommended)   TCP/IP-channel-specific option setting with a value of 0 effectively disables    from taking effect.

The (new in MS 6.3-0.15)   channel option, if enabled  on the current SMTP source channel, allows channel switching based on  the envelope From address. If the envelope From address after rewriting is that of a user in the LDAP directory, then a per-user LDAP attribute (the attribute named by the   MTA option), or if the user has no such attribute a per-domain LDAP attribute (the attribute named by the    MTA option) will be consulted to find the name of a channel to which to switch as the new source channel. The source channel may change to any channel marked  or   (the default).

Note that since the  plus user-or-domain LDAP attribute based switching is being done based on the envelope From (MAIL FROM) address and since such addresses are easily forged, this functionality should be used with great care. It is provided as a convenience for achieving esthetic and convenience features in the handling of messages purportedly from particular users or domains; but   does not provide the security of switching based on source IP address  or on authenticated sender information (   and even more so the   LDAP attribute). When truly secure user-based channel switching is desired, instead the use of SMTP AUTH should be enforced and  used. (As of the 8.0 release, the LDAP attribute of relevance may be named something other than, as specified via the    MTA option.)

See also the  mapping table&#x27;s  flag which provides another way to do source channel "switching" (particularly well suited for "switching" the source channel for incoming  notification messages).

See also:
 * saslswitchchannel Option
 * ldap_source_channel MTA Option
 * ldap_domain_attr_source_channel MTA Option
 * logfilename Option
 * tcp_ports Option
 * parameter Option
 * Blocking SMTP relaying
 * CHECK_SOURCE
 * FROM_ACCESS mapping table
 * ldap_auth_attr_submit_channel MTA Option
 * Notification message routing
 * Incoming channel match and switch channel options
 * Channel options