Versions in this module Expand all Collapse all v0 v0.1.30 Nov 7, 2026 Changes in this version + const EBCC + const ECC + const EDate + const EEHost + const EEMailbox + const EEName + const EESR + const EFrom + const EInReplyTo + const EMessageID + const EReplyTo + const ESender + const ESubject + const ETo + const IdleEventExists + const IdleEventExpunge + const IdleEventFetch + const StateConnected + const StateDisconnected + const StateIdlePending + const StateIdling + const StateSelected + const StateStoppingIdle + const TimeFormat + var AddSlashes = strings.NewReplacer(`"`, `\"`) + var CommandTimeout time.Duration + var DialTimeout time.Duration + var RemoveSlashes = strings.NewReplacer(`\"`, `"`) + var RetryCount = 10 + var SkipResponses = false + var TLSSkipVerify bool + var Verbose = false + func GetTokenName(tokenType TType) string + func IsLiteral(b rune) bool + func MakeIMAPLiteral(s string) string + func SetLogger(logger Logger) + func SetSlogLogger(logger *slog.Logger) + type Attachment struct + Content []byte + MimeType string + Name string + func (a Attachment) String() string + type Dialer struct + ConnNum int + Connected bool + Folder string + Host string + Password string + Port int + ReadOnly bool + Username string + func New(username string, password string, host string, port int) (d *Dialer, err error) + func NewWithOAuth2(username string, accessToken string, host string, port int) (d *Dialer, err error) + func (d *Dialer) Append(folder string, flags []string, date time.Time, message []byte) error + func (d *Dialer) Authenticate(user string, accessToken string) (err error) + func (d *Dialer) CheckType(token *Token, acceptableTypes []TType, tks []*Token, loc string, v ...any) (err error) + func (d *Dialer) Clone() (d2 *Dialer, err error) + func (d *Dialer) Close() (err error) + func (d *Dialer) CopyEmail(uid int, folder string) error + func (d *Dialer) CreateFolder(name string) error + func (d *Dialer) DeleteEmail(uid int) (err error) + func (d *Dialer) DeleteFolder(name string) error + func (d *Dialer) ExamineFolder(folder string) (err error) + func (d *Dialer) Exec(command string, buildResponse bool, retryCount int, ...) (response string, err error) + func (d *Dialer) Expunge() (err error) + func (d *Dialer) GetEmails(uids ...int) (emails map[int]*Email, err error) + func (d *Dialer) GetFolderStats() ([]FolderStats, error) + func (d *Dialer) GetFolderStatsExcluding(excludedFolders []string) ([]FolderStats, error) + func (d *Dialer) GetFolderStatsStartingFrom(startFolder string) ([]FolderStats, error) + func (d *Dialer) GetFolderStatsStartingFromExcluding(startFolder string, excludedFolders []string) ([]FolderStats, error) + func (d *Dialer) GetFolders() (folders []string, err error) + func (d *Dialer) GetLastNUIDs(n int) ([]int, error) + func (d *Dialer) GetMaxUID() (uid int, err error) + func (d *Dialer) GetOverviews(uids ...int) (emails map[int]*Email, err error) + func (d *Dialer) GetTotalEmailCount() (count int, err error) + func (d *Dialer) GetTotalEmailCountExcluding(excludedFolders []string) (count int, err error) + func (d *Dialer) GetTotalEmailCountSafe() (count int, folderErrors []error, err error) + func (d *Dialer) GetTotalEmailCountSafeExcluding(excludedFolders []string) (count int, folderErrors []error, err error) + func (d *Dialer) GetTotalEmailCountSafeStartingFrom(startFolder string) (count int, folderErrors []error, err error) + func (d *Dialer) GetTotalEmailCountSafeStartingFromExcluding(startFolder string, excludedFolders []string) (count int, folderErrors []error, err error) + func (d *Dialer) GetTotalEmailCountStartingFrom(startFolder string) (count int, err error) + func (d *Dialer) GetTotalEmailCountStartingFromExcluding(startFolder string, excludedFolders []string) (count int, err error) + func (d *Dialer) GetUIDs(search string) (uids []int, err error) + func (d *Dialer) Login(username string, password string) (err error) + func (d *Dialer) MarkSeen(uid int) (err error) + func (d *Dialer) MoveEmail(uid int, folder string) (err error) + func (d *Dialer) ParseFetchResponse(responseBody string) (records [][]*Token, err error) + func (d *Dialer) Reconnect() (err error) + func (d *Dialer) RenameFolder(oldName, newName string) error + func (d *Dialer) SearchUIDs(search *SearchBuilder) ([]int, error) + func (d *Dialer) SelectFolder(folder string) (err error) + func (d *Dialer) SetFlags(uid int, flags Flags) (err error) + func (d *Dialer) StartIdle(handler *IdleHandler) error + func (d *Dialer) State() int + func (d *Dialer) StopIdle() error + type Email struct + Attachments []Attachment + BCC EmailAddresses + CC EmailAddresses + Flags []string + From EmailAddresses + HTML string + InReplyTo string + MessageID string + Received time.Time + ReplyTo EmailAddresses + Sent time.Time + Size uint64 + Subject string + Text string + To EmailAddresses + UID int + func (e Email) String() string + type EmailAddresses map[string]string + func (e EmailAddresses) String() string + type ExistsEvent struct + MessageIndex int + type ExpungeEvent struct + MessageIndex int + type FetchEvent struct + Flags []string + MessageIndex int + UID uint32 + type FlagSet int + const FlagAdd + const FlagRemove + const FlagUnset + type Flags struct + Answered FlagSet + Deleted FlagSet + Draft FlagSet + Flagged FlagSet + Keywords map[string]bool + Seen FlagSet + type FolderStats struct + Count int + Error error + MaxUID int + Name string + type IdleHandler struct + OnExists func(event ExistsEvent) + OnExpunge func(event ExpungeEvent) + OnFetch func(event FetchEvent) + type Logger interface + Debug func(msg string, args ...any) + Error func(msg string, args ...any) + Info func(msg string, args ...any) + Warn func(msg string, args ...any) + WithAttrs func(args ...any) Logger + func SlogLogger(logger *slog.Logger) Logger + type SearchBuilder struct + func Search() *SearchBuilder + func (s *SearchBuilder) All() *SearchBuilder + func (s *SearchBuilder) Answered() *SearchBuilder + func (s *SearchBuilder) BCC(addr string) *SearchBuilder + func (s *SearchBuilder) Before(t time.Time) *SearchBuilder + func (s *SearchBuilder) Body(text string) *SearchBuilder + func (s *SearchBuilder) Build() string + func (s *SearchBuilder) CC(addr string) *SearchBuilder + func (s *SearchBuilder) Deleted() *SearchBuilder + func (s *SearchBuilder) Draft() *SearchBuilder + func (s *SearchBuilder) Flagged() *SearchBuilder + func (s *SearchBuilder) From(addr string) *SearchBuilder + func (s *SearchBuilder) Header(field, value string) *SearchBuilder + func (s *SearchBuilder) Keyword(keyword string) *SearchBuilder + func (s *SearchBuilder) Larger(bytes int) *SearchBuilder + func (s *SearchBuilder) New() *SearchBuilder + func (s *SearchBuilder) Not(inner *SearchBuilder) *SearchBuilder + func (s *SearchBuilder) Old() *SearchBuilder + func (s *SearchBuilder) On(t time.Time) *SearchBuilder + func (s *SearchBuilder) Or(a, b *SearchBuilder) *SearchBuilder + func (s *SearchBuilder) Recent() *SearchBuilder + func (s *SearchBuilder) Seen() *SearchBuilder + func (s *SearchBuilder) SentBefore(t time.Time) *SearchBuilder + func (s *SearchBuilder) SentOn(t time.Time) *SearchBuilder + func (s *SearchBuilder) SentSince(t time.Time) *SearchBuilder + func (s *SearchBuilder) Since(t time.Time) *SearchBuilder + func (s *SearchBuilder) Smaller(bytes int) *SearchBuilder + func (s *SearchBuilder) Subject(subject string) *SearchBuilder + func (s *SearchBuilder) Text(text string) *SearchBuilder + func (s *SearchBuilder) To(addr string) *SearchBuilder + func (s *SearchBuilder) UID(set string) *SearchBuilder + func (s *SearchBuilder) Unanswered() *SearchBuilder + func (s *SearchBuilder) Undeleted() *SearchBuilder + func (s *SearchBuilder) Undraft() *SearchBuilder + func (s *SearchBuilder) Unflagged() *SearchBuilder + func (s *SearchBuilder) Unkeyword(keyword string) *SearchBuilder + func (s *SearchBuilder) Unseen() *SearchBuilder + type TType uint8 + const TAtom + const TContainer + const TLiteral + const TNil + const TNumber + const TQuoted + const TUnset + type Token struct + Num int + Str string + Tokens []*Token + Type TType + func (t Token) String() string