config

package
v0.9.20 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: GPL-3.0 Imports: 13 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"
	BotBanlistAuto         = "banlist:auto"
	BotBanlistAuth         = "banlist:auth"
	BotGreylist            = "greylist"
	BotMautrix015Migration = "mautrix015migration"
)

bot options keys

View Source
const (
	RoomActive    = ".active"
	RoomOwner     = "owner"
	RoomMailbox   = "mailbox"
	RoomDomain    = "domain"
	RoomPassword  = "password"
	RoomSignature = "signature"
	RoomAutoreply = "autoreply"
	RoomRelay     = "relay"

	RoomThreadify   = "threadify"
	RoomStripify    = "stripify"
	RoomNoCC        = "nocc"
	RoomNoFiles     = "nofiles"
	RoomNoHTML      = "nohtml"
	RoomNoInlines   = "noinlines"
	RoomNoRecipient = "norecipient"
	RoomNoReplies   = "noreplies"
	RoomNoSend      = "nosend"
	RoomNoSender    = "nosender"
	RoomNoSubject   = "nosubject"
	RoomNoThreads   = "nothreads"

	RoomSpamcheckRBL  = "spamcheck:rbl"
	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) BanlistAuth added in v0.9.16

func (s Bot) BanlistAuth() bool

BanlistAuth option

func (Bot) BanlistAuto added in v0.9.16

func (s Bot) BanlistAuto() bool

BanlistAuto 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) Mautrix015Migration added in v0.9.15

func (s Bot) Mautrix015Migration() int64

Mautrix015Migration option (timestamp)

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 *zerolog.Logger) *Manager

New config manager

func (*Manager) GetBanlist

func (m *Manager) GetBanlist(ctx context.Context) List

GetBanlist config

func (*Manager) GetBot

func (m *Manager) GetBot(ctx context.Context) Bot

GetBot config

func (*Manager) GetGreylist

func (m *Manager) GetGreylist(ctx context.Context) List

GetGreylist config

func (*Manager) GetRoom

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

GetRoom config

func (*Manager) SetBanlist

func (m *Manager) SetBanlist(ctx context.Context, cfg List) error

SetBanlist config

func (*Manager) SetBot

func (m *Manager) SetBot(ctx context.Context, cfg Bot) error

SetBot config

func (*Manager) SetGreylist

func (m *Manager) SetGreylist(ctx context.Context, cfg List) error

SetGreylist config

func (*Manager) SetRoom

func (m *Manager) SetRoom(ctx context.Context, 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) Autoreply added in v0.9.16

func (s Room) Autoreply() string

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) NoInlines added in v0.9.15

func (s Room) NoInlines() bool

func (Room) NoRecipient

func (s Room) NoRecipient() bool

func (Room) NoReplies added in v0.9.15

func (s Room) NoReplies() 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) Relay added in v0.9.19

func (s Room) Relay() *url.URL

Relay returns the SMTP Relay configuration in a manner of URL: smtp://user:pass@host:port

func (Room) Set

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

Set option

func (Room) Signature added in v0.9.16

func (s Room) Signature() string

func (Room) SpamcheckDKIM

func (s Room) SpamcheckDKIM() bool

func (Room) SpamcheckMX

func (s Room) SpamcheckMX() bool

func (Room) SpamcheckRBL added in v0.9.20

func (s Room) SpamcheckRBL() 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

func (Room) Stripify added in v0.9.18

func (s Room) Stripify() bool

func (Room) Threadify added in v0.9.17

func (s Room) Threadify() bool

Jump to

Keyboard shortcuts

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