imap

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: AGPL-3.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Version = "1.0.1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*client.Client
	IDCli *id.Client
}

func WrapEXClient

func WrapEXClient(c *client.Client) *Client

type Conf

type Conf struct {
	SrvAddr    string                 `json:"srv_addr"`
	SrvDomain  string                 `json:"srv_domain"`
	RemoteConf map[string]*RemoteConf `json:"remote_conf"`
}

func (*Conf) String

func (c *Conf) String() string

type Mailbox

type Mailbox struct {
	Subscribed bool
	// contains filtered or unexported fields
}

func (*Mailbox) Check

func (mbox *Mailbox) Check() error

func (*Mailbox) CopyMessages

func (mbox *Mailbox) CopyMessages(uid bool, seqSet *imap.SeqSet, destName string) error

func (*Mailbox) CreateMessage

func (mbox *Mailbox) CreateMessage(flags []string, date time.Time, body imap.Literal) error

func (*Mailbox) Expunge

func (mbox *Mailbox) Expunge() error

func (*Mailbox) Info

func (mbox *Mailbox) Info() (*imap.MailboxInfo, error)

func (*Mailbox) ListMessages

func (mbox *Mailbox) ListMessages(uid bool, seqSet *imap.SeqSet, items []imap.FetchItem, ch chan<- *imap.Message) error

func (*Mailbox) MoveMessages

func (mbox *Mailbox) MoveMessages(uid bool, seqSet *imap.SeqSet, dest string) error

func (*Mailbox) Name

func (mbox *Mailbox) Name() string

func (*Mailbox) SearchMessages

func (mbox *Mailbox) SearchMessages(uid bool, criteria *imap.SearchCriteria) ([]uint32, error)

func (*Mailbox) SetSubscribed

func (mbox *Mailbox) SetSubscribed(subscribed bool) error

func (*Mailbox) Status

func (mbox *Mailbox) Status(items []imap.StatusItem) (*imap.MailboxStatus, error)

func (*Mailbox) UpdateMessagesFlags

func (mbox *Mailbox) UpdateMessagesFlags(uid bool, seqSet *imap.SeqSet, op imap.FlagsOp, flags []string) error

type RemoteConf

type RemoteConf struct {
	RemoteSrvCAs   string `json:"ca_files"`
	RemoteCADomain string `json:"ca_domain"`
	AllowNotSecure bool   `json:"allow_not_secure"`
	RemoteSrvName  string `json:"remote_srv_name"`
	RemoteSrvPort  int    `json:"remote_srv_port"`
	// contains filtered or unexported fields
}

func (*RemoteConf) String

func (rc *RemoteConf) String() string

type Service

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

func NewIMAPSrv

func NewIMAPSrv(cfg *Conf, lclSrvTls *tls.Config) (*Service, error)

func (*Service) Login

func (is *Service) Login(_ *imap.ConnInfo, username, password string) (backend.User, error)

func (*Service) Start

func (is *Service) Start(sig chan struct{}) error

func (*Service) StartWithCtx added in v1.2.2

func (is *Service) StartWithCtx(cancel context.CancelFunc) error

func (*Service) Stop added in v1.2.2

func (is *Service) Stop()

type User

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

func (*User) CreateMailbox

func (u *User) CreateMailbox(name string) error

func (*User) DeleteMailbox

func (u *User) DeleteMailbox(name string) error

func (*User) GetMailbox

func (u *User) GetMailbox(name string) (mailbox backend.Mailbox, err error)

func (*User) ListMailboxes

func (u *User) ListMailboxes(subscribed bool) (mailboxes []backend.Mailbox, err error)

func (*User) Logout

func (u *User) Logout() error

func (*User) RenameMailbox

func (u *User) RenameMailbox(existingName, newName string) error

func (*User) Username

func (u *User) Username() string

Jump to

Keyboard shortcuts

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