Platform SDK: SMTP Server Events |
[This is preliminary documentation and subject to change.]
The MailMsg COM class represents a message as it proceeds through the SMTP service. The information within the MailMsg object is persisted to some physical location such as the file system using objects and file handles provided by the installed store driver object. The MailMsg COM class is integral to the SMTP service and does not need to be implemented. Transport and protocol event sinks use references to a MailMsg object to access information about the message and the message contents as it proceeds through the service to its final destination.
The store driver provides a separate object that exposes the IMailMsgPropertyStream interface and is used to persist the transport envelope properties for each message. These properties are stored only for the duration of the message's transit through the SMTP service.
The store driver provides an FIO_CONTEXT (file handle) structure reference for persisting the message content through standard file I/O functions such as ReadFile and WriteFile. Within this structure is a standard HANDLE reference that can be used to perform read and write operations manually.
The FIO_CONTEXT structure is part of the FCACHDLL.DLL library provided as part of the Microsoft SMTP Service for Windows 2000. This function library is designed to help manage asynchronous file I/O. Management of FIO_CONTEXT structures can be performed using supplied functions from this library, such as AssociateFile, ReleaseContext, FIOReadFile, and FIOWriteFile. Use of this structure is required by many of the stock read-write functions defined for interfaces used with the MailMsg object. In all cases, file handles are created using the FILE_FLAG_OVERLAPPED flag to allow for asynchronous I/O operations.
FIO_CONTEXT, AssociateFile, ReleaseContext, FIOReadFile, FIOWriteFile