Generally (but not always), a channel is associated with two programs: master and slave. The slave program accepts messages from another system and adds them to a channel’s message queue. The master program transfers messages from the channel to another system.
For example, an SMTP channel has a master program that transmits messages and a slave program that receives messages. These are, respectively, the SMTP client and server.
The master channel program is typically responsible for outgoing connections where the MTA has initiated the operation. The master channel program:
Runs in response to a local request for processing.
Dequeues the message from the channel message queue.
If the destination format is not the same format as the queued message, performs conversion of addresses, headers, and content, as necessary.
Initiates network transport of the message.
The slave channel program typically accepts incoming connections where the MTA is responding to an external request. The slave channel program:
Runs in response to an external event or upon local demand.
Enqueues a message to a channel. The target channel is determined by passing envelope addresses through a rewrite rule.
For example, Figure 8–3 shows two channel programs, Channel 1 and Channel 2. The slave program in Channel 1 receives a message from a remote system. It looks at the address, applies rewrite rules as necessary, then based on the rewritten address enqueues the message to the appropriate channel message queue.
The master program dequeues the message from the queue and initiates network transport of the message. Note that the master program can only dequeue messages from its own channel queue.
Although a typical channel has both a master and a slave program, it is possible for a channel to contain only a slave program or a master program. For example, the ims-ms channel supplied with Messaging Server contains only a master program because this channel is responsible only for dequeuing messages to the local message store, as shown in Figure 8–4.