Table of Contents

Class MailAuthenticationPolicy

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

Defines which SASL mechanisms a mail account may authenticate with and which weakenings are permitted.

public sealed record MailAuthenticationPolicy : IEquatable<MailAuthenticationPolicy>
Inheritance
MailAuthenticationPolicy
Implements
Inherited Members

Remarks

The permitted set is an allow-list and is deliberately unordered: a transport adapter must remove every other mechanism from the server's advertised set before authenticating, must not widen the set again when authentication fails, and is free to pick the strongest survivor. Honoring a configured order would let a careless list put a weaker mechanism ahead of a stronger one that both sides support. The list keeps its configured order only so diagnostics and equality stay deterministic.

Properties

AllowClearTextAuthenticationOverUnencryptedConnection

Gets whether the operator accepted sending a reusable password over an unencrypted channel.

AllowInsecureConnection

Gets whether the operator accepted a connection mode that can leave the channel unencrypted.

PermitsAccessTokenAuthentication

Gets whether any permitted mechanism authenticates with an access token.

PermitsClearTextCredentials

Gets whether any permitted mechanism sends the password in clear text.

PermitsPasswordAuthentication

Gets whether any permitted mechanism authenticates with a password.

PermittedMechanisms

Gets the permitted mechanisms in configured order, without duplicates.

Methods

Create(IEnumerable<MailAuthenticationMechanism>, bool, bool)

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

NormalizeMechanisms(IEnumerable<MailAuthenticationMechanism>)

Removes duplicates while keeping the configured order.