Platform SDK: SMTP Server Events |
[This is preliminary documentation and subject to change.]
Store driver objects are used to provide backing storage for each MailMsg object's content and transport envelope properties. Store driver objects must expose two mandatory interfaces:
Interface | Description |
---|---|
IMailMsgStoreDriver | A generic interface used by the SMTP and NNTP services to allocate and manage backing storage for MailMsg objects. |
ISMTPStoreDriver | Used by the SMTP service to initialize and manage store driver objects, and request local delivery of messages with recipients in the local domain. |
The transport envelope properties are persisted using a store driver-supplied MailMsgPropertyStream object exposing the IMailMsgPropertyStream interface. This interface defines methods used to read and write properties in serialized format to and from some persisted storage location, normally the file system. Each store driver implementation must supply an object exposing the IMailMsgPropertyStream interface. Instances of this object are never created directly by the SMTP service, but are instead created as part of the normal operation of the store driver object during calls to IMailMsgStoreDriver::AllocMessage, ReOpen, ReAllocMessage, and EnumerateAndSubmitMessages.
The MailMsg content is persisted as a stream using a PFIO_CONTEXT file I/O context. This context is comprised principally of an I/O HANDLE opened with the CreateFile (or similar I/O function) with the FILE_FLAG_OVERLAPPED flag and further associated with an FIO_CONTEXT structure using the AssociateFile function exposed by the fcachdll.dll library. You can think of each PFIO_CONTEXT structure essentially as a file I/O HANDLE value ready for asynchronous I/O operations. Each call to AssociateFile increments the reference count on the FIO_CONTEXT structure. Use the ReleaseContext function to decrement the reference count.
Each store driver implementation must provide an object exposing the IMailMsgEnumMessages interface for the purpose of enumerating all undelivered messages within the store. A reference to this object must be returned to callers invoking the IMailMsgStoreDriver::EnumMessages method, and is normally used to internally enumerate these messages when the SMTP service calls the ISMTPStoreDriver::EnumerateAndSubmitMessages method on the store driver object.
IMailMsgStoreDriver, ISMTPStoreDriver, IMailMsgPropertyStream, IMailMsgEnumMessages, AssociateFile,ReleaseContext