all repos — postern @ fc287763b9ce6b6f9823e11c0b1173da0446ebc5

Modern mail management

internal/imap/errors.go (view raw)

 1package imap
 2
 3import (
 4	"errors"
 5
 6	"github.com/emersion/go-imap/v2"
 7)
 8
 9var (
10	errDBSequenceOutOfRange = errors.New("sequence out of range")
11
12	errSequenceOutOfRange = &imap.Error{
13		Type: imap.StatusResponseTypeBad,
14		Code: imap.ResponseCodeClientBug,
15		Text: "Sequence out of range",
16	}
17
18	errMailboxNotExist = &imap.Error{
19		Type: imap.StatusResponseTypeNo,
20		Code: imap.ResponseCodeNonExistent,
21		Text: "Mailbox does not exist",
22	}
23
24	errInternalServerError = &imap.Error{
25		Type: imap.StatusResponseTypeBad,
26		Code: imap.ResponseCodeServerBug,
27		Text: "internal server error",
28	}
29
30	errBadFlag = &imap.Error{
31		Type: imap.StatusResponseTypeBad,
32		Code: imap.ResponseCodeClientBug,
33		Text: "Unsupported flag",
34	}
35
36	errNoMailboxSelected = &imap.Error{
37		Type: imap.StatusResponseTypeNo,
38		Code: imap.ResponseCodeCannot,
39		Text: "No mailbox selected",
40	}
41
42	errMailboxReadOnly = &imap.Error{
43		Type: imap.StatusResponseTypeNo,
44		Code: imap.ResponseCodeCannot,
45		Text: "Mailbox was selected read-only (EXAMINE)",
46	}
47)