Documentation ¶
Index ¶
- Variables
- func GenerateAll(info MailboxInfo, markAsRead, delete bool) (chan Response, error)
- func GenerateSince(info MailboxInfo, since time.Time, markAsRead, delete bool) (chan Response, error)
- func GenerateUnread(info MailboxInfo, markAsRead, delete bool) (chan Response, error)
- func VisibleText(body io.Reader) ([][]byte, error)
- type Email
- type MailboxInfo
- type Response
Constants ¶
This section is empty.
Variables ¶
var GenerateBufferSize = 100
Functions ¶
func GenerateAll ¶
func GenerateAll(info MailboxInfo, markAsRead, delete bool) (chan Response, error)
GenerateAll will find all emails in the email folder and pass them along to the responses channel.
func GenerateSince ¶
func GenerateSince(info MailboxInfo, since time.Time, markAsRead, delete bool) (chan Response, error)
GenerateSince will find all emails that have an internal date after the given time and pass them along to the responses channel.
func GenerateUnread ¶
func GenerateUnread(info MailboxInfo, markAsRead, delete bool) (chan Response, error)
GenerateUnread will find all unread emails in the folder and pass them along to the responses channel.
Types ¶
type Email ¶
type Email struct { Message *mail.Message From *mail.Address `json:"from"` To []*mail.Address `json:"to"` Cc []*mail.Address `json:"cc"` Bcc []*mail.Address `json:"bcc"` ReplyTo *mail.Address `json:"reply_to"` InternalDate time.Time `json:"internal_date"` Precedence string `json:"precedence"` Subject string `json:"subject"` HTML []byte `json:"html"` Text []byte `json:"text"` IsMultiPart bool `json:"is_multipart"` }
Email is a simplified email struct containing the basic pieces of an email. If you want more info, it should all be available within the Message attribute.
func GetAll ¶
func GetAll(info MailboxInfo, markAsRead, delete bool) ([]Email, error)
GetAll will pull all emails from the email folder and return them as a list.
func GetUnread ¶
func GetUnread(info MailboxInfo, markAsRead, delete bool) ([]Email, error)
GetUnread will find all unread emails in the folder and return them as a list.
func NewEmail ¶
NewEmail will parse an imap.FieldMap into an Email. This will expect the message to container the internaldate and the body with all headers included.
func (*Email) VisibleText ¶
VisibleText will return any visible text from an HTML email body.