mail2most

package
v1.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2020 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

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

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment added in v1.7.0

type Attachment struct {
	Filename string
	Content  []byte
}

Attachment .

type Mail

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

Mail contains mail information

type Mail2Most

type Mail2Most struct {
	Config config
	Logger *log.Logger
}

Mail2Most implements the basic interface

func New

func New(confPath string) (Mail2Most, error)

New creates a new Mail2Most object

func (Mail2Most) Debug

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

Debug logging

func (Mail2Most) Error

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

Error logging

func (Mail2Most) GetMail

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

GetMail returns emails filter by profile id

func (Mail2Most) Info

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

Info logging

func (Mail2Most) ListFlags

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

ListFlags lists all flags for profile

func (Mail2Most) ListMailBoxes

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

ListMailBoxes lists all available mailboxes

func (Mail2Most) PostMattermost

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

PostMattermost posts a msg to mattermost

func (Mail2Most) Run

func (m Mail2Most) Run() error

Run starts mail2most

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL