presets

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package presets holds per-provider connection defaults: host, port, TLS mode, folder-name fallbacks for servers without SPECIAL-USE, and known quirks.

Index

Constants

View Source
const (
	TLSImplicit = "implicit"
	TLSStartTLS = "starttls"
)

TLS modes, as stored in accounts.tls_mode.

Variables

This section is empty.

Functions

This section is empty.

Types

type Preset

type Preset struct {
	Name    string // stored in accounts.preset
	Label   string
	Host    string // empty for generic: the user supplies it
	Port    int
	TLSMode string
	// Folders maps a special-use role to folder names to look for, most likely first,
	// when the server does not report the role itself. Matching ignores case.
	Folders map[string][]string
	HelpURL string // where the user creates an app password
	// PasteLabel is what the provider calls the secret the user pastes into the wizard.
	PasteLabel string
	// LocalPartLogin: the server may want the part before "@" as the username.
	LocalPartLogin bool
	// Domains are the domains one account's address is known by, lowercase: the same name
	// before "@" receives mail at each of them. Empty = not known, and only a username that
	// is a full address says what the account's address is.
	Domains []string
}

Preset is one provider's defaults.

func All

func All() []Preset

All returns every preset, generic last.

func Get

func Get(name string) (Preset, bool)

Get looks a preset up by name.

func (Preset) FillRoles

func (p Preset) FillRoles(folders []mail.Folder)

FillRoles assigns preset roles to folders for every role the server did not report, picking the best-ranked name when several match.

func (Preset) Usernames

func (p Preset) Usernames(username string) []string

Usernames returns the usernames to try at login, in order.

Jump to

Keyboard shortcuts

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