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
permittedMechanismsIEnumerable<MailAuthenticationMechanism>The permitted mechanisms.
allowInsecureConnectionboolWhether a connection mode that can stay unencrypted is accepted.
allowClearTextAuthenticationOverUnencryptedConnectionboolWhether 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
permittedMechanismsis null.- ArgumentException
Thrown when a value is the unspecified struct default or when no mechanism remains after normalization.