Table of Contents

Method FindViolations

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

FindViolations(MailConnectionSecurity, IReadOnlyList<MailAuthenticationMechanism>?, bool, bool, MailServerCertificateTrust, string?)

Finds every transport security rule the supplied combination violates.

public static IReadOnlyList<MailTransportSecurityViolation> FindViolations(MailConnectionSecurity connectionSecurity, IReadOnlyList<MailAuthenticationMechanism>? permittedMechanisms, bool allowInsecureConnection, bool allowClearTextAuthenticationOverUnencryptedConnection, MailServerCertificateTrust certificateTrust, string? trustedCertificateAuthorityReference)

Parameters

connectionSecurity MailConnectionSecurity

The connection encryption mode.

permittedMechanisms IReadOnlyList<MailAuthenticationMechanism>

The permitted SASL 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.

certificateTrust MailServerCertificateTrust

The certificate authorities that validate the server certificate.

trustedCertificateAuthorityReference string

The reference to additional trust anchor material, or null.

Returns

IReadOnlyList<MailTransportSecurityViolation>

The violated rules, empty when the combination is safe.

Remarks

A configuration boundary calls this before building the policy so it can report every unsafe setting of an account at once instead of failing on the first one. The evaluation is total: an undefined enum value, which configuration can produce by binding a raw number, is reported as a violation instead of falling through the rules it cannot be evaluated against.