Skip to main content

MIME E-mail forwarding script for Slack written in Python

Project description

PyPI version Build Status Coverage Status

MIME E-mail forwarding script for Slack written in Python.

Demo

Slack

Slack

Requirements

Getting Started

Install email2slack

From PyPI

# Install email2slack
pip install email2slack --upgrade

# Fetch configuration file from GitHub
cd /usr/local/etc/
curl -O https://raw.githubusercontent.com/mikoim/email2slack/master/contrib/email2slack

# Before using, You must edit config file
vim /usr/local/etc/email2slack

In this case, setuptools create script to call email2slack and place it in bin directory automatically. So you should use the script in Setup MTA section.

From GitHub repository

git clone https://github.com/mikoim/email2slack.git
cd email2slack

# Install email2slack
pip install .
cp contrib/email2slack /usr/local/etc/

# Before using, You must edit config file
vim /usr/local/etc/email2slack

Optional: Install nkf

pip3 install nkf

Setup MTA

Postfix

vim /etc/postfix/aliases

...

# notify only, not forward
user: |/usr/local/bin/email2slack.py

# notify and forward e-mail to another user
user: anotheruser, |/usr/local/bin/email2slack.py

# notify and leave e-mail on same user
user: \user, |/usr/local/bin/email2slack.py

# you can override default slack url, team and channel with command line option,
# which replace as default=value in each section.
# -s url / --slack url
# -t team-name / --team team-name
# -c channel-name / --channel channel-name
# -f /path/to/email2slack.conf / --config /path/to/email2slack.conf
user: "|/usr/local/bin/email2slack.py -c '@user'"
another: "|/usr/local/bin/email2slack.py -c '#random'"

...

newaliases

Contributors

Thank you for your great work!

  • @komeda-shinji

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
email2slack-1.0.0a5.tar.gz (9.4 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page