Giter Site home page Giter Site logo

mattermail's Introduction

mattermail icon MatterMail

MatterMail is an integration service for Mattermost, MatterMail listen an email box and publish all received emails in a channel or private group in Mattermost.

Build Status Coverage Status

mattermail screenshot

Redirect to the channel by subject (Version 3.0 or later)

Mattermail post the email using this rules (if "NoRedirectChannel:false"):

1 - If the email subject contains "[#anychannelname] blablabla" or "[@usertosend] xxxxxx", Mattermail will try to post to the channel or to the username

2 - If the email subject doesn't contain channel or username, Mattermail will try to post the channel defined in config.json

3 - If Mattermail can not post the email will try to post in "Town Square"

Install

Usage

  1. You need to create a user in Mattermost server, you can use MatterMail icon as profile picture.

  2. Get the Channel Handle of the channel and check if the user has permission to post in this channel mattermail channel_handle

  3. Edit the file config.json, e.g.:

[
	{
		"Name":          "Orders",
		"Server":        "https://mattermost.example.com",
		"Team":          "team1",
		"Channel":       "#orders",
		"MattermostUser":"[email protected]",
		"MattermostPass":"password",
		"ImapServer":    "imap.example.com:143",
		"Email":         "[email protected]",
		"EmailPass":     "password",
		"MailTemplate":  ":incoming_envelope: _From: **%v**_\n>_%v_\n\n%v"
	},
	{
		"Name":              "Bugs",
		"Server":            "https://mattermost.example.com",
		"Team":              "team1",
		"Channel":           "@user123",
		"MattermostUser":    "[email protected]",
		"MattermostPass":    "password",
		"ImapServer":        "imap.gmail.com:993",
		"Email":             "[email protected]",
		"EmailPass":         "password",
		"MailTemplate":      ":incoming_envelope: _From: **%v**_\n>_%v_\n\n%v",
		"StartTLS":          false,  /*Optional default false*/
		"Disabled":          false,  /*Optional default false*/
		"Debug":             true    /*Optional default false*/
        "LinesToPreview":    20,     /*Optional default 10*/
		"NoRedirectChannel": true,   /*Optional default false*/
        "NoAttachment":      true,   /*Optional leave out attachments*/

        /*Filter works only (Version 3.0 or later)*/
        "Filter":            [
            /* if subject contains 'Feature' redirect to #feature */
            {"Subject":"Feature", "Channel":"#feature"},
            
            /* if from contains '[email protected]' and subject contains 'to me' redirect to @test2*/
            {"From":"[email protected]", "Subject":"To Me", "Channel":"@test2"},
            
            /* if from contains '@companyb.com' redirect to #companyb */
			{"From":"@companyb.com", "Channel":"#companyb"} /**/
        ]
	},
	{
		/*.... other if you want ....*/
	}
]
  1. Execute the command to put in background
$ ./mattermail > /var/log/mattermail.log 2>&1 &

Options

$ ./mattermail --help
Options:
    -c, --config  Sets the file location for config.json
                  Default: ./config.json 
    -h, --help    Show this help
    -v, --version Print current version

Building

You need Go to build this project

$ go get github.com/rodrigocorsi2/mattermail

If you want to build MatterMail to Mattermost 2.2 you need to use release-2.2 branch

mattermail's People

Contributors

banzo avatar bhaskard avatar rodcorsi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.