Documentation
¶
Index ¶
- Constants
- func Validate(s *models.IMAP) error
- type Client
- type Email
- type Mailbox
- func (mbox *Mailbox) DeleteEmails(uids []uint32) error
- func (mbox *Mailbox) GenerateAll(markAsRead, delete bool) (chan Response, error)
- func (mbox *Mailbox) GenerateUnread(markAsRead, delete bool) (chan Response, error)
- func (mbox *Mailbox) GetAll(markAsRead, delete bool) ([]Email, error)
- func (mbox *Mailbox) GetUnread(markAsRead, delete bool) ([]Email, error)
- func (mbox *Mailbox) MarkAsUnread(uids []uint32) error
- type Monitor
- type Response
Constants ¶
View Source
const GenerateBufferSize = 100
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface {
Close(expunge bool) (cmd *imap.Command, err error)
Login(username, password string) (cmd *imap.Command, err error)
Logout(timeout time.Duration) (cmd *imap.Command, err error)
Select(mbox string, readonly bool) (cmd *imap.Command, err error)
UIDFetch(seq *imap.SeqSet, items ...string) (cmd *imap.Command, err error)
UIDSearch(spec ...imap.Field) (cmd *imap.Command, err error)
UIDStore(seq *imap.SeqSet, item string, value imap.Field) (cmd *imap.Command, err error)
}
Client interface for IMAP interactions
type Mailbox ¶
type Mailbox struct {
Host string
TLS bool
User string
Pwd string
Folder string
// Read only mode, false (original logic) if not initialized
ReadOnly bool
}
Mailbox holds onto the credentials and other information needed for connecting to an IMAP server.
func (*Mailbox) DeleteEmails ¶
DeleteEmails will delete emails from the supplied slice of UIDs
func (*Mailbox) GenerateAll ¶
GenerateAll will find all emails in the email folder and pass them along to the responses channel.
func (*Mailbox) GenerateUnread ¶
GenerateUnread will find all unread emails in the folder and pass them along to the responses channel.
func (*Mailbox) GetAll ¶
GetAll will pull all emails from the email folder and return them as a list.
func (*Mailbox) GetUnread ¶
GetUnread will find all unread emails in the folder and return them as a list.
func (*Mailbox) MarkAsUnread ¶
MarkAsUnread will set the UNSEEN flag on a supplied slice of UIDs
Click to show internal directories.
Click to hide internal directories.