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
connectionSecurityMailConnectionSecurityThe connection encryption mode.
permittedMechanismsIReadOnlyList<MailAuthenticationMechanism>The permitted SASL mechanisms.
allowInsecureConnectionboolWhether a connection mode that can stay unencrypted is accepted.
allowClearTextAuthenticationOverUnencryptedConnectionboolWhether clear-text credentials on an unencrypted channel are accepted.
certificateTrustMailServerCertificateTrustThe certificate authorities that validate the server certificate.
trustedCertificateAuthorityReferencestringThe 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.