Documentation ¶
Index ¶
- Constants
- Variables
- func AsClose(parent context.Context) context.Context
- func AsSilent(parent context.Context) context.Context
- func AsUID(parent context.Context) context.Context
- type Backend
- func (b *Backend) AddUser(ctx context.Context, conn connector.Connector, store store.Store, ...) (string, error)
- func (b *Backend) Close(ctx context.Context) error
- func (b *Backend) GetState(username, password string, sessionID int) (*State, error)
- func (b *Backend) RemoveUser(ctx context.Context, userID string) error
- func (b *Backend) SetDelimiter(delim string)
- type Mailbox
- func (m *Mailbox) Append(ctx context.Context, literal []byte, flags imap.FlagSet, date time.Time) (int, error)
- func (m *Mailbox) Attributes(ctx context.Context) (imap.FlagSet, error)
- func (m *Mailbox) Close(ctx context.Context) error
- func (m *Mailbox) Copy(ctx context.Context, seq *proto.SequenceSet, name string) (response.Item, error)
- func (m *Mailbox) Count() int
- func (m *Mailbox) Expunge(ctx context.Context, seq *proto.SequenceSet) error
- func (m *Mailbox) ExpungeIssued() bool
- func (m *Mailbox) Fetch(ctx context.Context, seq *proto.SequenceSet, ...) error
- func (m *Mailbox) Flags(ctx context.Context) (imap.FlagSet, error)
- func (m *Mailbox) Flush(ctx context.Context, permitExpunge bool) ([]response.Response, error)
- func (m *Mailbox) GetMessagesWithFlag(flag string) []int
- func (m *Mailbox) GetMessagesWithoutFlag(flag string) []int
- func (m *Mailbox) Move(ctx context.Context, seq *proto.SequenceSet, name string) (response.Item, error)
- func (m *Mailbox) Name() string
- func (m *Mailbox) PermanentFlags(ctx context.Context) (imap.FlagSet, error)
- func (m *Mailbox) ReadOnly() bool
- func (m *Mailbox) Search(ctx context.Context, keys []*proto.SearchKey) ([]int, error)
- func (m *Mailbox) Selected() bool
- func (m *Mailbox) Store(ctx context.Context, seq *proto.SequenceSet, operation proto.Operation, ...) error
- func (m *Mailbox) Subscribed() bool
- func (m *Mailbox) UIDNext() int
- func (m *Mailbox) UIDValidity() int
- type Match
- type State
- func (state *State) Close(ctx context.Context) error
- func (state *State) Create(ctx context.Context, name string) error
- func (state *State) Delete(ctx context.Context, name string) error
- func (state *State) Done() <-chan struct{}
- func (state *State) Examine(ctx context.Context, name string, fn func(*Mailbox) error) error
- func (state *State) Idle(ctx context.Context, ...) error
- func (state *State) IsSelected() bool
- func (state *State) List(ctx context.Context, ref, pattern string, subscribed bool, ...) error
- func (state *State) Mailbox(ctx context.Context, name string, fn func(*Mailbox) error) error
- func (state *State) Rename(ctx context.Context, oldName, newName string) error
- func (state *State) Select(ctx context.Context, name string, fn func(*Mailbox) error) error
- func (state *State) Selected(ctx context.Context, fn func(*Mailbox) error) error
- func (state *State) SetConnMetadataKeyValue(key string, value any) error
- func (state *State) Subscribe(ctx context.Context, name string) error
- func (state *State) Unsubscribe(ctx context.Context, name string) error
- func (state *State) UserID() string
Constants ¶
const InternalIDHeaderLength = 51
InternalIDHeaderLength is the expected length of the full header entry, excluding the new line character.
const InternalIDHeaderLengthWithNewLine = InternalIDHeaderLength + 2
InternalIDHeaderLengthWithNewLine is the same as InternalIDHeaderLength, but includes the \r\n character.
const InternalIDKey = `X-PM-GLUON-ID`
InternalIDKey is the key of the header entry we add to messages in the mailserver system. This allows us to detect when clients try to create a duplicate of a message, which we treat instead as a copy.
Variables ¶
var ( ErrNoSuchUser = errors.New("no such user") ErrNoSuchSnapshot = errors.New("no such snapshot") ErrNoSuchMessage = errors.New("no such message") ErrNoSuchMailbox = errors.New("no such mailbox") ErrExistingMailbox = errors.New("a mailbox with that name already exists") ErrAlreadySubscribed = errors.New("already subscribed to this mailbox") ErrAlreadyUnsubscribed = errors.New("not subscribed to this mailbox") ErrSessionNotSelected = errors.New("session is not selected") ErrNotImplemented = errors.New("not implemented") )
Functions ¶
func AsClose ¶
AsClose marks this context as handling a CLOSE command. This modifies some backend behaviour (such as not returning EXPUNGE responses).
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
func (*Backend) RemoveUser ¶ added in v0.5.0
func (*Backend) SetDelimiter ¶
type Mailbox ¶
type Mailbox struct {
// contains filtered or unexported fields
}
func (*Mailbox) Attributes ¶
func (*Mailbox) Copy ¶
func (m *Mailbox) Copy(ctx context.Context, seq *proto.SequenceSet, name string) (response.Item, error)
Copy copies the messages represented by the given sequence set into the mailbox with the given name. If the context is a UID context, the sequence set refers to message UIDs. If no items are copied the response object will be nil.
func (*Mailbox) ExpungeIssued ¶
func (*Mailbox) Fetch ¶
func (m *Mailbox) Fetch(ctx context.Context, seq *proto.SequenceSet, attributes []*proto.FetchAttribute, ch chan response.Response) error
func (*Mailbox) GetMessagesWithFlag ¶
func (*Mailbox) GetMessagesWithoutFlag ¶
func (*Mailbox) Move ¶
func (m *Mailbox) Move(ctx context.Context, seq *proto.SequenceSet, name string) (response.Item, error)
Move moves the messages represented by the given sequence set into the mailbox with the given name. If the context is a UID context, the sequence set refers to message UIDs. If no items are moved the response object will be nil.
func (*Mailbox) PermanentFlags ¶
func (*Mailbox) Subscribed ¶
func (*Mailbox) UIDValidity ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
TODO(REFACTOR): Decide on the best way to pass around user/state/snap objects! Currently quite gross...
func (*State) IsSelected ¶
func (*State) SetConnMetadataKeyValue ¶ added in v0.8.0
Source Files ¶
- backend.go
- context.go
- errors.go
- header.go
- init.go
- mailbox.go
- mailbox_fetch.go
- mailbox_fetcher.go
- mailbox_search.go
- mailbox_tx.go
- match.go
- message_tx.go
- message_uid.go
- paths.go
- responders.go
- seqset.go
- snapshot.go
- snapshot_messages.go
- state.go
- state_actions.go
- state_updates.go
- user.go
- user_state.go
- user_updates.go