Documentation ¶
Index ¶
- Variables
- func AccountAdd(ctx context.Context, account, address string) (rerr error)
- func AccountRemove(ctx context.Context, account string) (rerr error)
- func AccountSave(ctx context.Context, account string, xmodify func(acc *config.Account)) (rerr error)
- func AddressAdd(ctx context.Context, address, account string) (rerr error)
- func AddressRemove(ctx context.Context, address string) (rerr error)
- func AliasAdd(ctx context.Context, addr smtp.Address, alias config.Alias) error
- func AliasAddressesAdd(ctx context.Context, addr smtp.Address, addresses []string) error
- func AliasAddressesRemove(ctx context.Context, addr smtp.Address, addresses []string) error
- func AliasRemove(ctx context.Context, addr smtp.Address) error
- func AliasUpdate(ctx context.Context, addr smtp.Address, alias config.Alias) error
- func ConfigSave(ctx context.Context, xmodify func(config *config.Dynamic)) (rerr error)
- func DKIMAdd(ctx context.Context, domain, selector dns.Domain, algorithm, hash string, ...) (rerr error)
- func DKIMRemove(ctx context.Context, domain, selector dns.Domain) (rerr error)
- func DomainAdd(ctx context.Context, domain dns.Domain, accountName string, ...) (rerr error)
- func DomainRecords(domConf config.Domain, domain dns.Domain, hasDNSSEC bool, ...) ([]string, error)
- func DomainRemove(ctx context.Context, domain dns.Domain) (rerr error)
- func DomainSave(ctx context.Context, domainName string, ...) (rerr error)
- func MakeAccountConfig(addr smtp.Address) config.Account
- func MakeDKIMEd25519Key(selector, domain dns.Domain) ([]byte, error)
- func MakeDKIMRSAKey(selector, domain dns.Domain) ([]byte, error)
- func MakeDomainConfig(ctx context.Context, domain, hostname dns.Domain, accountName string, ...) (config.Domain, []string, error)
- type ClientConfig
- type ClientConfigs
- type ClientConfigsEntry
- type ProtocolConfig
- type TLSMode
Constants ¶
This section is empty.
Variables ¶
var ErrRequest = errors.New("bad request")
Functions ¶
func AccountAdd ¶
AccountAdd adds an account and an initial address and reloads the configuration.
The new account does not have a password, so cannot yet log in. Email can be delivered.
Catchall addresses are not supported for AccountAdd. Add separately with AddressAdd.
func AccountRemove ¶
AccountRemove removes an account and reloads the configuration.
func AccountSave ¶
func AccountSave(ctx context.Context, account string, xmodify func(acc *config.Account)) (rerr error)
AccountSave updates the configuration of an account. Function xmodify is called with a shallow copy of the current configuration of the account. It must not change referencing fields (e.g. existing slice/map/pointer), they may still be in use, and the change may be rolled back. Referencing values must be copied and replaced by the modify. The function may raise a panic for error handling.
func AddressAdd ¶
AddressAdd adds an email address to an account and reloads the configuration. If address starts with an @ it is treated as a catchall address for the domain.
func AddressRemove ¶
AddressRemove removes an email address and reloads the configuration. Address can be a catchall address for the domain of the form "@<domain>".
If the address is member of an alias, remove it from from the alias, unless it is the last member.
func AliasAddressesAdd ¶
func AliasAddressesRemove ¶
func AliasUpdate ¶
func ConfigSave ¶
ConfigSave calls xmodify with a shallow copy of the dynamic config. xmodify can modify the config, but must clone all referencing data it changes. xmodify may employ panic-based error handling. After xmodify returns, the modified config is verified, saved and takes effect.
func DKIMAdd ¶
func DKIMAdd(ctx context.Context, domain, selector dns.Domain, algorithm, hash string, headerRelaxed, bodyRelaxed, seal bool, headers []string, lifetime time.Duration) (rerr error)
DKIMAdd adds a DKIM selector for a domain, generating a key and writing it to disk.
func DKIMRemove ¶
DKIMRemove removes the selector from the domain, moving the key file out of the way.
func DomainAdd ¶
func DomainAdd(ctx context.Context, domain dns.Domain, accountName string, localpart smtp.Localpart) (rerr error)
DomainAdd adds the domain to the domains config, rewriting domains.conf and marking it loaded.
accountName is used for DMARC/TLS report and potentially for the postmaster address. If the account does not exist, it is created with localpart. Localpart must be set only if the account does not yet exist.
func DomainRecords ¶
func DomainRecords(domConf config.Domain, domain dns.Domain, hasDNSSEC bool, certIssuerDomainName, acmeAccountURI string) ([]string, error)
DomainRecords returns text lines describing DNS records required for configuring a domain.
If certIssuerDomainName is set, CAA records to limit TLS certificate issuance to that caID will be suggested. If acmeAccountURI is also set, CAA records also restricting issuance to that account ID will be suggested.
func DomainRemove ¶
DomainRemove removes domain from the config, rewriting domains.conf.
No accounts are removed, also not when they still reference this domain.
func DomainSave ¶
func DomainSave(ctx context.Context, domainName string, xmodify func(config *config.Domain) error) (rerr error)
DomainSave calls xmodify with a shallow copy of the domain config. xmodify can modify the config, but must clone all referencing data it changes. xmodify may employ panic-based error handling. After xmodify returns, the modified config is verified, saved and takes effect.
func MakeAccountConfig ¶
MakeAccountConfig returns a new account configuration for an email address.
func MakeDKIMEd25519Key ¶
MakeDKIMEd25519Key returns a PEM buffer containing an ed25519 key for use with DKIM. selector and domain can be empty. If not, they are used in the note.
func MakeDKIMRSAKey ¶
MakeDKIMRSAKey returns a PEM buffer containing an rsa key for use with DKIM. selector and domain can be empty. If not, they are used in the note.
Types ¶
type ClientConfig ¶
type ClientConfig struct { IMAP ProtocolConfig Submission ProtocolConfig }
func ClientConfigDomain ¶
func ClientConfigDomain(d dns.Domain) (rconfig ClientConfig, rerr error)
ClientConfigDomain returns a single IMAP and Submission client configuration for a domain.
type ClientConfigs ¶
type ClientConfigs struct {
Entries []ClientConfigsEntry
}
ClientConfigs holds the client configuration for IMAP/Submission for a domain.
func ClientConfigsDomain ¶
func ClientConfigsDomain(d dns.Domain) (ClientConfigs, error)
ClientConfigsDomain returns the client configs for IMAP/Submission for a domain.