Interactions Between Hook Providers and the MAPI Spooler
The interactions between hook providers and the MAPI spooler are fairly simple:
-
The MAPI spooler receives an inbound or outbound message from a message store or transport provider.
-
The MAPI spooler calls the hook provider's InboundMsgHook or OutboundMsgHook method, whichever is appropriate.
-
The hook provider processes the message, optionally returning a different destination folder for the message or returning values that cause the MAPI spooler to delete the message.
-
The MAPI spooler calls any other hook providers — assuming that HOOK_CANCEL was not returned in step 3 — then delivers the message to its final destination or deletes it as appropriate.