Platform SDK: MAPI

Developing a Hook Provider or Preprocessor

MAPI defines two types of extensions that it uses to allow custom code to be inserted into the message transmission and reception processes—hook providers and preprocessors. A hook provider, also called a spooler hook, can be called after an outbound message reaches the transport providers and before an inbound message is delivered to the default folder for its message class. Preprocessors operate on outbound messages only and are called before and after transport providers handle the message.

Since hook providers and preprocessors act during the message sending and receiving processes, you should familiarize yourself with the roles that other MAPI components play in these processes. Specifically, you should read Sending Messages with MAPI, Service Provider Basics, Developing a Transport Provider, and Developing a Message Store Provider. You do not need to learn the material in these sections in any great detail in order to implement a hook provider or preprocessor, but you should have a basic understanding of the way these components interact to send and receive messages.

There are several things to consider when choosing whether to use a hook provider or a preprocessor to implement your custom code:

For an overview of the process of creating hook providers and preprocessors, see Using Message Filtering to Manage Messages.