Table of Contents

Struct MailProviderPreset

Namespace
MailFathom.Common.MailboxOAuth
Assembly
MailFathom.Common.dll

A mail provider's published OAuth endpoints and the scope its IMAP access needs.

public readonly record struct MailProviderPreset : IEquatable<MailProviderPreset>
Implements
Inherited Members

Remarks

The value is a closed enumeration rather than a C# enum because each member carries the four addresses and the scope string that make it usable, and because its name is what an operator types on the command line. A numeric member would name none of that.

A preset saves an operator from transcribing four URLs correctly, and it is not a provider integration: nothing here reaches the running service, which authenticates over IMAP against whatever host its account configures. Anything not covered by a preset is supplied endpoint by endpoint instead.

Properties

All

Gets every supported preset.

AuthorizationEndpoint

Gets the authorization endpoint a person signs in at.

DeviceAuthorizationEndpoint

Gets the device authorization endpoint, or null when the provider's device flow cannot issue mail scopes.

Google

Gets the preset for Google accounts, which reach IMAP through the restricted https://mail.google.com/ scope.

IsSpecified

Gets whether this value names a preset rather than the unusable struct default.

Microsoft

Gets the preset for Microsoft work, school, and personal accounts against Exchange Online.

PresetName

Gets the name an operator types to select this preset.

RequiresClientSecret

Gets whether the provider rejects an authorization-code exchange that carries no client secret.

Scope

Gets the space-delimited scope an IMAP mailbox needs at this provider.

TokenEndpoint

Gets the token endpoint codes and refresh tokens are exchanged at.

Methods

ToString()

Returns the fully qualified type name of this instance.

TryParsePresetName(string?, out MailProviderPreset)

Parses an operator-supplied preset name, ignoring case and surrounding whitespace.