Platform SDK: SMTP Server Events

ISmtpInCommandContext Interface

[This is preliminary documentation and subject to change.]

The ISmtpInCommandContext interface defines methods used by protocol event sinks to gather information about the protocol command that triggered the event and then set status and response information for the command.

IID
5F15C533-E90E-11D1-8852-00C04FA35B86
Extends
IUnknown
Local

Remarks

The protocol event source passes an object reference of type ISmtpInCommandContext to event sinks when a protocol event occurs. Event sinks use this object to gather information about the protocol command that triggered the event. The sink can then set response and status information once processing within the sink has completed.

The methods on the interface can be broken down into two groups: those used to gather information (query) about the protocol command, and those used to set status and response information for the command. The following tables list each of these methods along with a brief description of each.

Query (Gather) Methods

Method Description
QueryCommand The complete command that triggered the event. For example, "EHLO <domain>", "RCPT TO: <user@domain.tld>", "DATA <message data>" and so on.
QueryCommandSize The size of the command string in bytes (char)
QueryCommandKeyword The command keyword string. For example,

"EHLO"

"RCPT"

"DATA"

"MAIL".

QueryCommandKeywordSize The size of the command keyword string in bytes (char).
QueryNativeResponse The current native response string.
QueryNativeResponseSize The size of the current native response string.
QueryResponse The current response string.
QueryResponseSize The size of the current response string.
QueryCommandStatus The current command status.
QuerySmtpStatusCode The current SMTP status code for the command.
QueryProtocolErrorFlag Current additional error flags for the command.

Set Methods

Method Description
SetResponse Sets the response to the specified string.
AppendResponse Appends the specified string to the current response.
SetNativeResponse Set the native command response to the specified string.
AppendNativeResponse Appends the specified string to the native response.
SetCommandStatus Sets the status for the command.
SetSmtpStatusCode Sets the SMTP status code for the command.
SetProtocolErrorFlag Sets the protocol error flag for the command.
NotifyAsyncCompletion Callback into inbound protocol event source for notification that asynchronous event processing has completed.
SetCallback