Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInterrupted means the loop is interrupted by signal. ErrInterrupted = errors.New("interrupted") )
View Source
var UniAddressParser = func() (parser *mail.AddressParser) { parser = new(mail.AddressParser) parser.WordDecoder = UniWordDecoder return }()
UniAddressParser wraps a mail.AddressParser with multiple encodings support.
View Source
var UniWordDecoder = func() (dec *mime.WordDecoder) { dec = new(mime.WordDecoder) dec.CharsetReader = func(charset string, input io.Reader) (io.Reader, error) { e, err := htmlindex.Get(charset) if err != nil { return nil, err } return e.NewDecoder().Reader(input), err } return }()
UniWordDecoder wraps a mime.WordDecoder with multiple encodings support.
Functions ¶
func GenerateMessageID ¶
GenerateMessageID generates a unique message-id.
Types ¶
type Config ¶
type Config struct { IMAPAddress string IMAPUseTLS bool SMTPAddress string SMTPUseTLS bool User string Pass string // IgnoreExisting determines whether to ignore existing unseen mails. IgnoreExisting bool // MarkSeen determines whether to mark fetched mails seen. MarkSeen bool // UnseenOnly determines whether to look for unseen mails only. UnseenOnly bool Debug bool }
Config ...
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon ...
func (*Daemon) RegisterHandler ¶
func (d *Daemon) RegisterHandler(fun HandlerFunc)
RegisterHandler registers a handler.
func (*Daemon) SendPlainTextMail ¶
SendPlainTextMail sends a simple text email.
type Mail ¶
type Mail struct { Header mail.Header Result *imap.FetchResult MessageID string InReplyTo string FromAddr *mail.Address Subject string Date time.Time Texts []string Parts []*Part }
Mail contains raw mail data and some extracted essential info from it.
type Part ¶
type Part struct { Header textproto.MIMEHeader Data []byte }
Part is like multipart.Part but it provides raw data bytes.
Click to show internal directories.
Click to hide internal directories.