Table of Contents

Method Create

Namespace
MailFathom.Domain.Transport
Assembly
MailFathom.Domain.dll

Create(IEnumerable<MailAuthenticationMechanism>, bool, bool)

Creates an authentication policy from configured mechanisms and opt-ins.

public static MailAuthenticationPolicy Create(IEnumerable<MailAuthenticationMechanism> permittedMechanisms, bool allowInsecureConnection, bool allowClearTextAuthenticationOverUnencryptedConnection)

Parameters

permittedMechanisms IEnumerable<MailAuthenticationMechanism>

The permitted mechanisms.

allowInsecureConnection bool

Whether a connection mode that can stay unencrypted is accepted.

allowClearTextAuthenticationOverUnencryptedConnection bool

Whether clear-text credentials on an unencrypted channel are accepted.

Returns

MailAuthenticationPolicy

A policy whose mechanism list is deduplicated and keeps first-occurrence order.

Exceptions

ArgumentNullException

Thrown when permittedMechanisms is null.

ArgumentException

Thrown when a value is the unspecified struct default or when no mechanism remains after normalization.