providers

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package providers holds what Frostmail knows about mail providers: their servers, the sign-in kinds they accept, and the quirks the sync engine honors (docs/design/accounts.md, Provider profiles). Code asks the profile, never the host name.

Index

Constants

View Source
const GoogleTasksURL = "https://tasks.googleapis.com/tasks/v1/"

GoogleTasksURL is the Google Tasks API's base URL.

View Source
const GraphURL = "https://graph.microsoft.com/v1.0/"

GraphURL is Microsoft Graph's base URL (ADR-0039).

Variables

This section is empty.

Functions

This section is empty.

Types

type DAV

type DAV struct {
	// Graph is a provider whose contacts and calendars are reached over
	// Microsoft Graph (GraphURL) instead of CardDAV and CalDAV (ADR-0039).
	Graph bool
	// Contacts and Calendar are where CardDAV and CalDAV discovery start;
	// "" when the provider has none (or for generic accounts, which
	// discover from the address's domain).
	Contacts string
	Calendar string
	// Tasks is "google" for the Google Tasks API, "none" when the provider
	// has no tasks Frostmail can reach, and "" for task lists over CalDAV.
	Tasks string
	// NoTasks says why Tasks is "none", for Settings to show.
	NoTasks string
	// Schedules is a CalDAV server that tells an organizer of the user's
	// answer itself when a copy its scheduling delivered changes (RFC
	// 6638), so maild mails no iTIP reply of its own (ADR-0022).
	Schedules bool
	// SchedulesCopies is a server that also tells the organizer about a
	// copy a client creates from an emailed invitation: Google does
	// (verified 2026-10-09), iCloud does not.
	SchedulesCopies bool
	// SchedulesOrganizer is a server that tells invitees about every
	// organizer copy a client writes (invitations, updates and
	// cancellations) and cannot be kept quiet: SCHEDULE-AGENT=CLIENT and
	// NONE are ignored. Google and iCloud do (verified 2026-10-14,
	// tools/schedprobe). Only these calendars take invitees (ADR-0035).
	SchedulesOrganizer bool
	// ServesDeleted is a server whose sync-collection calls some objects
	// deleted, from no token as well, that its listing, a multiget and a
	// GET still serve: Google's, for a single occurrence whose series is
	// gone (found on the user's account, 2026-10-14). Sync asks for every
	// object a sync calls deleted and keeps what the server sends.
	ServesDeleted bool
	// Trusted are the domains, with their subdomains, that discovery may
	// send credentials to besides the one it started at: a principal or
	// home set on another host.
	Trusted []string
}

DAV is a provider's contacts, calendar and tasks endpoints (ADR-0017).

type Profile

type Profile struct {
	Kind api.AccountKind
	IMAP Server
	SMTP Server
	// Auth lists the sign-in kinds the provider accepts, preferred first.
	Auth []api.AuthKind
	// OAuth names the OAuth provider for oauth2 sign-in ("" for none).
	OAuth string
	// Domains are the address domains that belong to the provider.
	Domains []string
	Quirks  Quirks
	// DAV is where the provider keeps contacts, calendars and tasks.
	DAV DAV
}

Profile is one provider's settings.

func ForAddress

func ForAddress(email string) (Profile, bool)

ForAddress returns the profile whose domains include the address's domain; ok is false for other addresses.

func ForKind

func ForKind(kind api.AccountKind) Profile

ForKind returns the profile of an account kind; generic IMAP accounts (and kinds without a profile yet) get a profile with no servers and no quirks.

func (Profile) TrustsHost

func (p Profile) TrustsHost(host string) bool

TrustsHost reports whether host (without a port) is one of the profile's DAV domains or a subdomain of one.

type Quirks

type Quirks struct {
	// Gmail selects the Gmail sync path (ADR-0012).
	Gmail bool
	// SavesSent: the server files sent mail itself, so maild does not append
	// a Sent copy.
	SavesSent bool
	// NoQResync: QRESYNC is not used even when advertised.
	NoQResync bool
	// SilentEnable: ENABLE gets no ENABLED reply; CONDSTORE counts as
	// enabled when advertised.
	SilentEnable bool
	// MaxConnections caps the account's simultaneous connections (0: the
	// engine's default).
	MaxConnections int
	// OriginalMessageID names the header in which the server's own Sent
	// copy keeps a sent message's Message-ID, when SMTP submission gives the
	// message a new one (Outlook.com's X-Microsoft-Original-Message-ID,
	// found 2026-10-16). "" for servers that keep the Message-ID.
	OriginalMessageID string
	// NoKeywords: the server keeps only system flags, $Forwarded and
	// $MDNSent, and answers OK to others without storing them. Keywords and
	// Mail.app's color bits stay local: maild sends none, and flags read
	// from the server leave them as they are.
	NoKeywords bool
}

Quirks are a provider's deviations the sync engine works around.

type Server

type Server struct {
	Host string
	Port int
	TLS  api.TLSMode
}

Server is one server's connection settings without the user name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL