Documentation ¶
Index ¶
- Variables
- type Bot
- func (b *Bot) ActivateAlias(ctx context.Context, ownerID id.UserID, roomID id.RoomID, alias string) bool
- func (b *Bot) ActivateMailbox(ctx context.Context, ownerID id.UserID, roomID id.RoomID, mailbox string) bool
- func (b *Bot) AllowAuth(ctx context.Context, email, password string) (id.RoomID, bool)
- func (b *Bot) BanAuth(ctx context.Context, addr net.Addr)
- func (b *Bot) BanAuto(ctx context.Context, addr net.Addr)
- func (b *Bot) BanManually(ctx context.Context, addr net.Addr)
- func (b *Bot) Error(ctx context.Context, message string, args ...any)
- func (b *Bot) GetDKIMprivkey(ctx context.Context) string
- func (b *Bot) GetIFOptions(ctx context.Context, roomID id.RoomID) email.IncomingFilteringOptions
- func (b *Bot) GetMapping(ctx context.Context, mailbox string) (id.RoomID, bool)
- func (b *Bot) GetRelayConfig(ctx context.Context, roomID id.RoomID) *url.URL
- func (b *Bot) IncomingEmail(ctx context.Context, eml *email.Email) error
- func (b *Bot) IsBanned(ctx context.Context, addr net.Addr) bool
- func (b *Bot) IsGreylisted(ctx context.Context, addr net.Addr) bool
- func (b *Bot) IsTrusted(addr net.Addr) bool
- func (b *Bot) SendEmailReply(ctx context.Context)
- func (b *Bot) Sendmail(ctx context.Context, eventID id.EventID, from, to, data string, ...) (bool, error)
- func (b *Bot) SetSendmail(sendmail func(string, string, string, *url.URL) error)
- func (b *Bot) Start(statusMsg string) error
- func (b *Bot) Stop()
- func (b *Bot) SyncRooms()
- type MBXConfig
Constants ¶
This section is empty.
Variables ¶
var ErrNoRoom = errors.New("room not found")
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
Bot represents matrix bot
func New ¶
func New( q *queue.Queue, lp *linkpearl.Linkpearl, log *zerolog.Logger, cfg *config.Manager, psdc *psd.Client, proxies []string, prefix string, domains []string, admins []string, mbxc MBXConfig, ) (*Bot, error)
New creates a new matrix bot
func (*Bot) ActivateAlias ¶
func (*Bot) ActivateMailbox ¶
func (b *Bot) ActivateMailbox(ctx context.Context, ownerID id.UserID, roomID id.RoomID, mailbox string) bool
ActivateMailbox using the configured flow
func (*Bot) BanManually ¶
Ban an address manually
func (*Bot) GetDKIMprivkey ¶
GetDKIMprivkey returns DKIM private key
func (*Bot) GetIFOptions ¶
GetIFOptions returns incoming email filtering options (room settings)
func (*Bot) GetMapping ¶
GetMapping returns mapping of mailbox = room
func (*Bot) GetRelayConfig ¶
GetRelayConfig returns relay config for specific room (mailbox) if set
func (*Bot) IncomingEmail ¶
IncomingEmail sends incoming email to matrix room
func (*Bot) IsGreylisted ¶
IsGreylisted checks if host is in greylist
func (*Bot) SendEmailReply ¶
SendEmailReply sends replies from matrix thread to email thread
func (*Bot) Sendmail ¶
func (b *Bot) Sendmail(ctx context.Context, eventID id.EventID, from, to, data string, relayOverride *url.URL) (bool, error)
Sendmail tries to send email immediately, but if it gets 4xx error (greylisting), the email will be added to the queue and retried several times after that
func (*Bot) SetSendmail ¶
SetSendmail sets mail sending func to the bot