Class MailAccountConnectionMaterial
- Namespace
- MailFathom.Infrastructure.Mail
- Assembly
- MailFathom.Infrastructure.dll
Everything one account's connection attempt resolved from its configured references.
public sealed record MailAccountConnectionMaterial : IDisposable, IEquatable<MailAccountConnectionMaterial>
- Inheritance
-
MailAccountConnectionMaterial
- Implements
- Inherited Members
Remarks
The instance is owned by the operation that resolved it — one connection attempt, or one startup validation pass — and must be disposed when that operation ends, which bounds the window in which a process dump could contain the password to an operation rather than to process uptime. Because every operation resolves its own instance, publishing a new configuration snapshot never erases material an in-flight operation is still reading, and a credential or anchor rotated behind an unchanged reference is picked up by the next connection.
It is named material rather than secrets because only one of its members is one. A trust anchor is a public certificate that may be logged by subject and thumbprint; it travels here because it shares the password's per-operation ownership and disposal rule, not its confidentiality.
The password is optional because the mechanism decides whether one exists, not the record: an account whose policy
permits only XOAUTH2 or OAUTHBEARER authenticates with an access token obtained separately, and has
no password to resolve. Which of the two an account needs is settled by startup validation rather than discovered
at the point of authentication, so a null here is a configured shape and never a missing value.
Constructors
- MailAccountConnectionMaterial(ResolvedSecret?, X509Certificate2?)
Everything one account's connection attempt resolved from its configured references.
Properties
- Password
The mailbox password or app password, or null when the account's authentication policy permits only token-bearing mechanisms and it therefore configures none.
- TrustedCertificateAuthority
The deployment-provisioned authority the server certificate must chain to, or null when the account validates against the system trust store alone.
Methods
- Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.