imap

package
v0.0.0-...-ce23fcf Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Stores messages on an IMAP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Use

func Use(bkd *backend.Backend, config *Config) *conns

Types

type Config

type Config struct {
	Hostname string
	Port     int
	Tls      bool
	Suffix   string
}

func (*Config) Host

func (c *Config) Host() string

type Events

type Events struct {
	backend.EventsBackend
	// contains filtered or unexported fields
}

func (*Events) DeleteAllEvents

func (b *Events) DeleteAllEvents(user string) error

type Labels

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

func (*Labels) DeleteLabel

func (b *Labels) DeleteLabel(user, id string) error

func (Labels) GetPassword

func (b Labels) GetPassword(user string) (string, error)

Allow other backends (e.g. a SMTP backend) to access users' password.

func (*Labels) InsertLabel

func (b *Labels) InsertLabel(user string, label *backend.Label) (inserted *backend.Label, err error)

func (*Labels) ListLabels

func (b *Labels) ListLabels(user string) (labels []*backend.Label, err error)

func (*Labels) UpdateLabel

func (b *Labels) UpdateLabel(user string, update *backend.LabelUpdate) (label *backend.Label, err error)

type Messages

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

func (*Messages) CountMessages

func (b *Messages) CountMessages(user string) (counts []*backend.MessagesCount, err error)

func (*Messages) DeleteAttachment

func (b *Messages) DeleteAttachment(user, id string) error

func (*Messages) DeleteMessage

func (b *Messages) DeleteMessage(user, id string) (err error)

func (*Messages) GetMessage

func (be *Messages) GetMessage(user, id string) (msg *backend.Message, err error)

func (Messages) GetPassword

func (b Messages) GetPassword(user string) (string, error)

Allow other backends (e.g. a SMTP backend) to access users' password.

func (*Messages) InsertAttachment

func (b *Messages) InsertAttachment(user string, attachment *backend.Attachment, data []byte) (*backend.Attachment, error)

func (*Messages) InsertMessage

func (b *Messages) InsertMessage(user string, msg *backend.Message) (inserted *backend.Message, err error)

func (*Messages) ListAttachments

func (b *Messages) ListAttachments(user, msg string) ([]*backend.Attachment, error)

func (*Messages) ListMessages

func (b *Messages) ListMessages(user string, filter *backend.MessagesFilter) (msgs []*backend.Message, total int, err error)

func (*Messages) ReadAttachment

func (b *Messages) ReadAttachment(user, id string) (att *backend.Attachment, out []byte, err error)

func (*Messages) UpdateMessage

func (b *Messages) UpdateMessage(user string, update *backend.MessageUpdate) (msg *backend.Message, err error)

type Users

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

IMAP backend cannot upate users, so when requesting to update it will just return silently. When inserting a new user, it will just check that the user already exist on the IMAP server.

func (*Users) Auth

func (b *Users) Auth(username, password string) (user *backend.User, err error)

func (Users) GetPassword

func (b Users) GetPassword(user string) (string, error)

Allow other backends (e.g. a SMTP backend) to access users' password.

func (*Users) GetUser

func (b *Users) GetUser(id string) (user *backend.User, err error)

func (*Users) InsertUser

func (b *Users) InsertUser(u *backend.User, password string) (*backend.User, error)

func (*Users) IsUsernameAvailable

func (b *Users) IsUsernameAvailable(username string) (bool, error)

Cannot check if a username is available, always return true

func (*Users) UpdateUser

func (b *Users) UpdateUser(update *backend.UserUpdate) error

func (*Users) UpdateUserPassword

func (b *Users) UpdateUserPassword(id, current, new string) error

Jump to

Keyboard shortcuts

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