SmtpSession.Properties Property

When overridden in a derived class, the Properties property gets or sets an indexer for custom session properties.

Namespace:  Microsoft.Exchange.Data.Transport.Smtp
Assembly:  Microsoft.Exchange.Data.Transport (in Microsoft.Exchange.Data.Transport.dll)

Syntax

'Declaration
Public MustOverride Property Properties As IDictionary(Of String, Object)
    Get
    Friend Set
'Usage
Dim instance As SmtpSession
Dim value As IDictionary(Of String, Object)

value = instance.Properties
public abstract IDictionary<string, Object> Properties { get; internal set; }

Property Value

Type: System.Collections.Generic.IDictionary<String, Object>
When overridden in a derived class, the Properties property returns a dictionary object.

Remarks

The indexer provides access to the session properties by using a string for the key for each property.

The Connection Filtering agent that ships with Microsoft Exchange Server 2007 uses the named properties that are listed in the following table.

Property Name

Description

Microsoft.Exchange.IsOnAllowList

The Boolean value of this property is set to true if the IP address of the server that is sending the message is on the list of servers that are allowed to send messages to this server. If the server is not on the allow list, the value is set to false.

Microsoft.Exchange.IsOnDenyList

The Boolean value of this property is set to true if the IP address of the server that is sending the message is on the list of servers that are not allowed to send messages to this server. If the IP address is not on the deny list, the value is set to false.

Microsoft.Exchange.IsOnBlockList

The Boolean value of this property is set to true if the IP address of the server that is sending the message is on a block list from a block list provider. If the IP address is not on a block list, the value of this property is set to false.

Microsoft.Exchange.IsOnSafeList

The Boolean value of this property is set to true if the IP address of the server that is sending the message is on an allow list from an allow list provider. If the IP address is not on an allow list, the value of this property is set to false.

Microsoft.Exchange.IsOnBlockListErrorMessage

The string value of this property is set to the error message that is returned from the block list provider when the IP address of the server that is sending the message is on the block list of the block list provider.

Microsoft.Exchange.IsOnBlockListProvider

The string value of this property is set to the name of the provider that blocked the connection.

Examples

The following code example shows how to get the value of the Microsoft.Exchange.IsOnBlockListErrorMessage property.

string errorMessage = null;
if (smtpSession.Properties.ContainsKey("Microsoft.Exchange.IsOnBlockListErrorMessage"))
{
errorMessage = smtpSession.Properties["Microsoft.Exchange.IsOnBlockListErrorMessage"] as string;
}