config

package
v0.9.10 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BotAdminRoom      = "adminroom"
	BotUsers          = "users"
	BotCatchAll       = "catch-all"
	BotDKIMSignature  = "dkim.pub"
	BotDKIMPrivateKey = "dkim.pem"
	BotQueueBatch     = "queue:batch"
	BotQueueRetries   = "queue:retries"
	BotBanlistEnabled = "banlist:enabled"
	BotGreylist       = "greylist"
)

bot options keys

View Source
const (
	RoomActive        = ".active"
	RoomOwner         = "owner"
	RoomMailbox       = "mailbox"
	RoomDomain        = "domain"
	RoomNoSend        = "nosend"
	RoomNoCC          = "nocc"
	RoomNoSender      = "nosender"
	RoomNoRecipient   = "norecipient"
	RoomNoSubject     = "nosubject"
	RoomNoHTML        = "nohtml"
	RoomNoThreads     = "nothreads"
	RoomNoFiles       = "nofiles"
	RoomPassword      = "password"
	RoomSpamcheckDKIM = "spamcheck:dkim"
	RoomSpamcheckSMTP = "spamcheck:smtp"
	RoomSpamcheckSPF  = "spamcheck:spf"
	RoomSpamcheckMX   = "spamcheck:mx"
	RoomSpamlist      = "spamlist"
)

option keys

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot map[string]string

Bot map

func (Bot) AdminRoom

func (s Bot) AdminRoom() id.RoomID

AdminRoom option

func (Bot) BanlistEnabled

func (s Bot) BanlistEnabled() bool

BanlistEnabled option

func (Bot) CatchAll

func (s Bot) CatchAll() string

CatchAll option

func (Bot) DKIMPrivateKey

func (s Bot) DKIMPrivateKey() string

DKIMPrivateKey keep it secret

func (Bot) DKIMSignature

func (s Bot) DKIMSignature() string

DKIMSignature (DNS TXT record)

func (Bot) Get

func (s Bot) Get(key string) string

Get option

func (Bot) Greylist

func (s Bot) Greylist() int

Greylist option (duration in minutes)

func (Bot) QueueBatch

func (s Bot) QueueBatch() int

QueueBatch option

func (Bot) QueueRetries

func (s Bot) QueueRetries() int

QueueRetries option

func (Bot) Set

func (s Bot) Set(key, value string)

Set option

func (Bot) Users

func (s Bot) Users() []string

Users option

type List

type List map[string]string

List config

func (List) Add

func (l List) Add(addr net.Addr)

Add an addr to ban- or greylist

func (List) Get

func (l List) Get(addr net.Addr) (time.Time, bool)

Get when addr was added in ban- or greylist

func (List) Has

func (l List) Has(addr net.Addr) bool

Has addr in ban- or greylist

func (List) Remove

func (l List) Remove(addr net.Addr)

Remove an addr from ban- or greylist

func (List) Slice

func (l List) Slice() []string

Slice returns slice of ban- or greylist items

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager of configs

func New

func New(lp *linkpearl.Linkpearl, log *logger.Logger) *Manager

New config manager

func (*Manager) GetBanlist

func (m *Manager) GetBanlist() List

GetBanlist config

func (*Manager) GetBot

func (m *Manager) GetBot() Bot

GetBot config

func (*Manager) GetGreylist

func (m *Manager) GetGreylist() List

GetGreylist config

func (*Manager) GetRoom

func (m *Manager) GetRoom(roomID id.RoomID) (Room, error)

GetRoom config

func (*Manager) SetBanlist

func (m *Manager) SetBanlist(cfg List) error

SetBanlist config

func (*Manager) SetBot

func (m *Manager) SetBot(cfg Bot) error

SetBot config

func (*Manager) SetGreylist

func (m *Manager) SetGreylist(cfg List) error

SetGreylist config

func (*Manager) SetRoom

func (m *Manager) SetRoom(roomID id.RoomID, cfg Room) error

SetRoom config

type Room

type Room map[string]string

func (Room) Active

func (s Room) Active() bool

func (Room) ContentOptions

func (s Room) ContentOptions() *email.ContentOptions

ContentOptions converts room display settings to content options

func (Room) Domain

func (s Room) Domain() string

func (Room) Get

func (s Room) Get(key string) string

Get option

func (Room) Mailbox

func (s Room) Mailbox() string

func (Room) MigrateSpamlistSettings

func (s Room) MigrateSpamlistSettings()

func (Room) NoCC

func (s Room) NoCC() bool

func (Room) NoFiles

func (s Room) NoFiles() bool

func (Room) NoHTML

func (s Room) NoHTML() bool

func (Room) NoRecipient

func (s Room) NoRecipient() bool

func (Room) NoSend

func (s Room) NoSend() bool

func (Room) NoSender

func (s Room) NoSender() bool

func (Room) NoSubject

func (s Room) NoSubject() bool

func (Room) NoThreads

func (s Room) NoThreads() bool

func (Room) Owner

func (s Room) Owner() string

func (Room) Password

func (s Room) Password() string

func (Room) Set

func (s Room) Set(key, value string)

Set option

func (Room) SpamcheckDKIM

func (s Room) SpamcheckDKIM() bool

func (Room) SpamcheckMX

func (s Room) SpamcheckMX() bool

func (Room) SpamcheckSMTP

func (s Room) SpamcheckSMTP() bool

func (Room) SpamcheckSPF

func (s Room) SpamcheckSPF() bool

func (Room) Spamlist

func (s Room) Spamlist() []string

Jump to

Keyboard shortcuts

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