M2MB is a smtp server that doesn't send mails (!) but transfer the message to a Slack/Mattermost instance through a webhook.
By default, m2mb will send all mails to the default configured channel. You can configure another default channel in the command line (see --help
) or configure per-mail rules using sieve filters (see documentation).
You need python 3.6 to use this program. If you can't install python 3.6 on your system, there is a Docker image available on Docker Hub
$ git clone https://github.com/thperret/M2MB
$ pip install --process-dependency-links .
$ docker pull thperret/m2mb
$ m2mbd localhost 8225 http://mattermost_instance/hooks/randomid
$ docker run -e WEBHOOK_URL=http://mattermost-instance/hooks/randomid -p 8225:25 thperret/m2mb
For advanced use, see documentation.