Documentation ¶
Overview ¶
Package imapmemserver implements an in-memory IMAP server.
Index ¶
- type Mailbox
- type MailboxView
- func (mbox *MailboxView) Close()
- func (mbox *MailboxView) Fetch(w *imapserver.FetchWriter, numSet imap.NumSet, options *imap.FetchOptions) error
- func (mbox *MailboxView) Idle(w *imapserver.UpdateWriter, stop <-chan struct{}) error
- func (mbox *MailboxView) Poll(w *imapserver.UpdateWriter, allowExpunge bool) error
- func (mbox *MailboxView) Search(numKind imapserver.NumKind, criteria *imap.SearchCriteria, ...) (*imap.SearchData, error)
- func (mbox *MailboxView) Store(w *imapserver.FetchWriter, numSet imap.NumSet, flags *imap.StoreFlags, ...) error
- type Server
- type User
- func (u *User) Append(mailbox string, r imap.LiteralReader, options *imap.AppendOptions) (*imap.AppendData, error)
- func (u *User) Create(name string, options *imap.CreateOptions) error
- func (u *User) Delete(name string) error
- func (u *User) List(w *imapserver.ListWriter, ref string, patterns []string, ...) error
- func (u *User) Login(username, password string) error
- func (u *User) Namespace() (*imap.NamespaceData, error)
- func (u *User) Rename(oldName, newName string) error
- func (u *User) Status(name string, options *imap.StatusOptions) (*imap.StatusData, error)
- func (u *User) Subscribe(name string) error
- func (u *User) Unsubscribe(name string) error
- type UserSession
- func (sess *UserSession) Close() error
- func (sess *UserSession) Copy(numSet imap.NumSet, destName string) (*imap.CopyData, error)
- func (sess *UserSession) Idle(w *imapserver.UpdateWriter, stop <-chan struct{}) error
- func (sess *UserSession) Move(w *imapserver.MoveWriter, numSet imap.NumSet, destName string) error
- func (sess *UserSession) Poll(w *imapserver.UpdateWriter, allowExpunge bool) error
- func (sess *UserSession) Select(name string, options *imap.SelectOptions) (*imap.SelectData, error)
- func (sess *UserSession) Unselect() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mailbox ¶
type Mailbox struct {
// contains filtered or unexported fields
}
Mailbox is an in-memory mailbox.
The same mailbox can be shared between multiple connections and multiple users.
func NewMailbox ¶
NewMailbox creates a new mailbox.
func (*Mailbox) Expunge ¶
func (mbox *Mailbox) Expunge(w *imapserver.ExpungeWriter, uids *imap.UIDSet) error
func (*Mailbox) NewView ¶
func (mbox *Mailbox) NewView() *MailboxView
NewView creates a new view into this mailbox.
Callers must call MailboxView.Close once they are done with the mailbox view.
func (*Mailbox) SetSubscribed ¶
SetSubscribed changes the subscription state of this mailbox.
func (*Mailbox) StatusData ¶
func (mbox *Mailbox) StatusData(options *imap.StatusOptions) *imap.StatusData
StatusData returns data for the STATUS command.
type MailboxView ¶
type MailboxView struct { *Mailbox // contains filtered or unexported fields }
A MailboxView is a view into a mailbox.
Each view has its own queue of pending unilateral updates.
Once the mailbox view is no longer used, Close must be called.
Typically, a new MailboxView is created for each IMAP connection in the selected state.
func (*MailboxView) Close ¶
func (mbox *MailboxView) Close()
Close releases the resources allocated for the mailbox view.
func (*MailboxView) Fetch ¶
func (mbox *MailboxView) Fetch(w *imapserver.FetchWriter, numSet imap.NumSet, options *imap.FetchOptions) error
func (*MailboxView) Idle ¶
func (mbox *MailboxView) Idle(w *imapserver.UpdateWriter, stop <-chan struct{}) error
func (*MailboxView) Poll ¶
func (mbox *MailboxView) Poll(w *imapserver.UpdateWriter, allowExpunge bool) error
func (*MailboxView) Search ¶
func (mbox *MailboxView) Search(numKind imapserver.NumKind, criteria *imap.SearchCriteria, options *imap.SearchOptions) (*imap.SearchData, error)
func (*MailboxView) Store ¶
func (mbox *MailboxView) Store(w *imapserver.FetchWriter, numSet imap.NumSet, flags *imap.StoreFlags, options *imap.StoreOptions) error
type Server ¶
type Server struct { Logger *zap.SugaredLogger Notification *notification.Notifications // contains filtered or unexported fields }
Server is a server instance.
A server contains a list of users.
func New ¶
func New(logger *zap.SugaredLogger, notification *notification.Notifications) *Server
New creates a new server.
func (*Server) NewSession ¶
func (s *Server) NewSession() imapserver.Session
NewSession creates a new IMAP session.
type User ¶
type User struct {
// contains filtered or unexported fields
}
func (*User) List ¶
func (u *User) List(w *imapserver.ListWriter, ref string, patterns []string, options *imap.ListOptions) error
func (*User) Unsubscribe ¶
type UserSession ¶
type UserSession struct {
// contains filtered or unexported fields
}
UserSession represents a session tied to a specific user.
UserSession implements imapserver.Session. Typically, a UserSession pointer is embedded into a larger struct which overrides Login.
func NewUserSession ¶
func NewUserSession(user *User) *UserSession
NewUserSession creates a new user session.
func (*UserSession) Close ¶
func (sess *UserSession) Close() error
func (*UserSession) Copy ¶
func (sess *UserSession) Copy(numSet imap.NumSet, destName string) (*imap.CopyData, error)
func (*UserSession) Idle ¶
func (sess *UserSession) Idle(w *imapserver.UpdateWriter, stop <-chan struct{}) error
func (*UserSession) Move ¶
func (sess *UserSession) Move(w *imapserver.MoveWriter, numSet imap.NumSet, destName string) error
func (*UserSession) Poll ¶
func (sess *UserSession) Poll(w *imapserver.UpdateWriter, allowExpunge bool) error
func (*UserSession) Select ¶
func (sess *UserSession) Select(name string, options *imap.SelectOptions) (*imap.SelectData, error)
func (*UserSession) Unselect ¶
func (sess *UserSession) Unselect() error