Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ont/slacker
Simple smtp email server which redirects emails to slack.
https://github.com/ont/slacker
cron email monit mta notifications redirects-emails slack slack-channels
Last synced: 2 months ago
JSON representation
Simple smtp email server which redirects emails to slack.
- Host: GitHub
- URL: https://github.com/ont/slacker
- Owner: ont
- License: mit
- Created: 2016-09-14T13:01:48.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-07-06T00:46:14.000Z (7 months ago)
- Last Synced: 2024-08-06T18:17:49.346Z (6 months ago)
- Topics: cron, email, monit, mta, notifications, redirects-emails, slack, slack-channels
- Language: Python
- Homepage:
- Size: 40 KB
- Stars: 33
- Watchers: 2
- Forks: 12
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - ont/slacker - Simple smtp email server which redirects emails to slack. (Python)
README
# Slacker
Slacker is simple email-to-slack gateway. It support basic rules for routing
messages to different slack channels from different bots.Main purpose of slacker is to redirect messages from old-school systems which doesn't
support messaging other than email. For example cron and monit
(https://mmonit.com/monit/) support only emails as the only system for
notifications.## Installation
Slacker can be easily installed via docker:
```bash
docker pull ontrif/slacker
```Then run container with custom slacker `config.yml`:
```bash
docker run \
-d --restart=always \
--name=slacker \
-v /path/to/config.yml:/etc/slacker/config.yml \
-p localhost:8025:8025 \
ontrif/slacker
```
Last command will start SMTP server on `localhost:8025`## Config
Slacker supports simple list of rules for configuring target slack channel, bot
name and its avatar depending on email content.There are two sections:
* default: this is default options for sending message to slack.
* rules: list of rules for matching email message against 'from', 'to' and/or 'subject'.Each rule in list tested in order. First matched rule is used to update
options values from 'default' section of config.Example `config.yml` for redirecting email to two channels: `#monit` and `#cron`:
```yaml
# default values for channel, bot name, avatar url, slack token and debug mode
default:
channel: "#general"
username: "slacker"
icon_url: ""
slack_token: "xoxb-00000000000-aaaaaaaaaaaaaaaaaaaaaaaa"
debug: false# list of rules
rules:
- name: "Monit rule"
from: "monit@.*" # all emails from monit@localhost will match this ruleoptions:
username: "monit"
channel: "#monit"
icon_url: "https://bitbucket.org/tildeslash/monit/avatar/128"
debug: false- name: "Cron rule"
from: "root@localhost"
subject: "Cron.*" # cron email subject starts with "Cron..."options:
username: "cron"
channel: "#cron"
icon_url: ""
debug: true # will output full email with all X-headers
```