mail2most: Index | Files

package mail2most

import ""

Package mail2most is an implementation for reading and filtering emails and pushing them to mattermost

It uses the IMAP protocol to connect to an email account and can filter via:

- Folder - Subject - From - To - Time range

and pushes the subject and body into mattermost


Package Files

charsets.go config.go const.go doc.go imap.go internals.go logger.go logging.go mail2most.go mailparse.go mattermost.go structs.go


const (
    // ERROR .
    ERROR string = "error"
    // INFO .
    INFO string = "info"
    // DEBUG .
    DEBUG string = "debug"
    // LOGSTDOUT .
    LOGSTDOUT string = "stdout"
    // LOGFILE .
    LOGFILE string = "logfile"
    LOGFORMATJSON string = "json"
    LOGFORMATTEXT string = "text"

type Attachment Uses

type Attachment struct {
    Filename string
    Content  []byte

Attachment .

type Mail Uses

type Mail struct {
    ID            uint32
    Subject, Body string
    From, To      []*imap.Address
    Date          time.Time
    Attachments   []Attachment

Mail contains mail information

type Mail2Most Uses

type Mail2Most struct {
    Config config
    Logger *log.Logger

Mail2Most implements the basic interface

func New Uses

func New(confPath string) (Mail2Most, error)

New creates a new Mail2Most object

func (Mail2Most) Debug Uses

func (m Mail2Most) Debug(msg string, params map[string]interface{})

Debug logging

func (Mail2Most) Error Uses

func (m Mail2Most) Error(msg string, params map[string]interface{})

Error logging

func (Mail2Most) GetMail Uses

func (m Mail2Most) GetMail(profile int) ([]Mail, error)

GetMail returns emails filter by profile id

func (Mail2Most) Info Uses

func (m Mail2Most) Info(msg string, params map[string]interface{})

Info logging

func (Mail2Most) ListFlags Uses

func (m Mail2Most) ListFlags(profile int) ([]string, error)

ListFlags lists all flags for profile

func (Mail2Most) ListMailBoxes Uses

func (m Mail2Most) ListMailBoxes(profile int) ([]string, error)

ListMailBoxes lists all available mailboxes

func (Mail2Most) PostMattermost Uses

func (m Mail2Most) PostMattermost(profile int, mail Mail) error

PostMattermost posts a msg to mattermost

func (Mail2Most) Run Uses

func (m Mail2Most) Run() error

Run starts mail2most

Package mail2most imports 30 packages (graph) and is imported by 1 packages. Updated 2020-07-07. Refresh now. Tools for package owners.