Method CreatePolicy
- Namespace
- MailFathom.Infrastructure.Mail
- Assembly
- MailFathom.Infrastructure.dll
CreatePolicy()
Builds the validated domain policy for this account.
public MailTransportSecurityPolicy CreatePolicy()
Returns
- MailTransportSecurityPolicy
The policy the mailbox adapter must obey.
Remarks
Startup validation rejects these settings long before this runs, so a failure here means an unsafe policy reached the runtime through some other path. It fails closed rather than connecting.
Exceptions
- MailTransportSecurityPolicyViolationException
Thrown when the configured combination is unsafe.
- ArgumentException
Thrown when no supported SASL mechanism is configured.
CreatePolicy(MailConnectionSecurity)
Builds the validated domain policy for one of this account's endpoints.
public MailTransportSecurityPolicy CreatePolicy(MailConnectionSecurity connectionSecurity)
Parameters
connectionSecurityMailConnectionSecurityThe connection security mode that endpoint is reached under.
Returns
- MailTransportSecurityPolicy
The policy the transport adapter must obey.
Remarks
An account reaches two servers and the mode is the one part of this block that belongs to an endpoint rather than to the account: reading over implicit TLS and submitting over STARTTLS is the ordinary provider shape. The mechanisms, the accepted weakenings, and the certificate authority are the account's and are judged here by the same rules whichever mode is supplied, so a clear-text mechanism refused on one endpoint is refused on both.
Exceptions
- MailTransportSecurityPolicyViolationException
Thrown when the configured combination is unsafe.
- ArgumentException
Thrown when no supported SASL mechanism is configured.