Platform SDK: MAPI |
Between the MAPI subsystem and the messaging systems are the various service providers. Service providers are drivers that connect MAPI client applications to an underlying messaging system. There are several types of service providers, but not all types are common. Most messaging systems include three types of services: message store providers, address book or directory providers, and message transport providers. Other less typical service providers include messaging hook providers and profile providers. MAPI supports each type of service independently, allowing a vendor to offer one or more custom service providers. For example, a vendor might want to create an address book provider that uses a corporate telephone book directory of employees or create a message store provider that uses an existing database.
Service providers are typically written by software developers with specialized knowledge or experience with a messaging system. In many cases, this is the company or organization which promotes a specific messaging system. For instance, CompuServe supplies address, message store, and transport providers for the CompuServe Information Service. MAPI supplies two of its own service providers: a message store provider known as Personal Folders and an address book provider known as the personal address book (PAB). These providers can be used in isolation, as a client's only message store or address book provider, or in combination with other service providers.
MAPI presents client applications with a unified view of address book and transport provider information. This integrated approach saves the client application from having to map data to the appropriate provider and the user from having to negotiate among addressing schemes used by multiple address book and transport providers. Message store provider information, however, is not unified and clients that use multiple message store providers are responsible for handling them individually.
The service providers work with MAPI to create and send messages in the following way. Messages are created using a form that is appropriate for the specific type, or class, of message. Many messages are made with the standard note form that comes with the MAPI subsystem, either by the user of a client application or programmatically without user interaction. The completed message is addressed to one or more recipients — a user or group of users designated to receive the message. A recipient might or might not have an entry in a directory owned by one of the installed address book providers. Recipients that are not associated with an installed address book provider are called custom recipients or one-off addresses. A one-off address can be temporary, lasting only until the message is submitted, or more permanent if it is saved in the personal address book (PAB) or another modifiable address book.
When the client application sends the message, the message store provider checks that each recipient has a unique and valid address and that the message has all of the information necessary for transmission. If there is a question about a recipient, such as can occur when there are multiple recipients with the same name, an address book provider takes care of resolving the ambiguity. The message is then placed in the outbound queue.
If the message store is tightly coupled to a transport provider that can handle all of the recipients and there is no required preprocessing, the message goes directly to the transport provider without intervention from the MAPI spooler. Otherwise the MAPI spooler performs preprocessing if necessary and attempts to route the message to a transport provider based on the address type of the recipient. If the appropriate transport provider is available, the MAPI spooler transfers the message and the transport provider delivers it. If the transport provider is not available, the MAPI spooler either holds on to the message until the transport provider becomes available or sends it using another appropriate transport provider.