Send Linux mails to Slack with golang

LinuxMailToSlack

Install

go install github.com/TKMAX777/MailToSlack@latest
sudo apt install postfix

Configuration

AddEnvironmentVariables

SLACK_BOT_TOKEN="xoxb-xxxx"
SLACK_CHANNEL="Cxxxxxxx"
SLACK_ICON_EMOJI=":+1:"

AddMailSettings

# /etc/aliases
USERNAME:   "|/path/to/binary"

Example

Cron logging

  • Make shell script to excute binary
# /usr/local/MailToSlack/start.sh

#!/usr/bin/bash
export SLACK_BOT_TOKEN="xoxb-***"
export SLACK_ICON_EMOJI=":mailbox:"
export SLACK_CHANNEL="C******"

/usr/local/MailToSlack/MailToSlack
  • Change aliases file
# /etc/aliases
cronuser: root, "|/usr/local/MailToSlack/start.sh"
  • Change cron settings
# crontab
MAILTO=cronuser
Similar Resources

Slack Bot Framework

slacker Built on top of the Slack API github.com/slack-go/slack with the idea to simplify the Real-Time Messaging feature to easily create Slack Bots,

Dec 25, 2022

Slack bot core/framework written in Go with support for reactions to message updates/deletes

Slack bot core/framework written in Go with support for reactions to message updates/deletes

Overview Requirements Features Demo The Name Concepts Create Your Own Slackscot Assembling the Parts and Bringing Your slackscot to Life Configuration

Oct 28, 2022

Slack remind generator

slack-reminder Slack remind generator slack-reminder.mov Why Slack's /reminder is very hard to use. Required Go 1.16 ~ Installation $ go install githu

Nov 17, 2022

🦎 A slack bot for random gex quotes

🦎 A slack bot for random gex quotes

Jan 3, 2022

Library for testing interactive Slack applications.

Slackster Library for testing interactive Slack applications. Mock Slack API: user info, post and update message, publish view. Testing Slack UI in th

Aug 17, 2022

Notify Slack about KPIs test

Notify Slack about KPIs test

This action is a part of GitHub Actions Library created by rtCamp. Slack Notify - GitHub Action A GitHub Action to send a message to a Slack channel.

Jan 10, 2022

The original Slack library for Go created by Norberto Lopes, transferred to a Github organization

The original Slack library for Go created by Norberto Lopes, transferred to a Github organization

Slack API in Go This is the original Slack library for Go created by Norberto Lopes, transferred to a Github organization. This library supports most

Dec 8, 2021

Notify messages from gcs bucket objects to slack

Notify to Slack Notify message to slack from gcs storage file. Deploy $ gcloud functions deploy notify_to_slack \ --entry-point NotifyToSlack \

Oct 5, 2021

Slack Export Connection Visualizer

Slack Export Connection Visualizer Prerequisites Golang 1.16+ slack export unzipped into ./data email - department CSV located at ./data/dept.csv Run

Dec 28, 2021
REPLbot is a Slack bot that allows you to control a REPL from within Slack.
REPLbot is a Slack bot that allows you to control a REPL from within Slack.

?? REPLbot REPLbot is a Slack bot that allows you to control a REPL from within Slack. It comes with a few REPLs (Go ?? , Java, NodeJS, PHP, Python, R

Dec 31, 2022
This slack-bot collects all @gophers notifications into one slack channel

slack-bot Slack bot copying reference to a ping to notifications channel The bot is designed to listen on messages containing specific tag, copy refer

Apr 11, 2022
send current weather updates from openweathermap api to your slack profile status using github action
send current weather updates from openweathermap api to your slack profile status using github action

go-slack-weather Send current weather updates from OpenWeatherMap API to your Slack profile status using GitHub Action Contents Setup Change Update Pe

Oct 31, 2022
Send Slack reports of pull requests pending review
Send Slack reports of pull requests pending review

preport Born out of a desire to get pull requests reviewed faster without having to send manual reminders, preport generates reports of GitLab pull re

Nov 23, 2021
Client to send messages to channels in Slack.

Slack Client A simple client to send messages to channels in Slack. Example package main import { "fmt" slack "github.com/tommzn/go-slack" }

Mar 13, 2022
Auto send check-in message to Slack channel at a specific time.
Auto send check-in message to Slack channel at a specific time.

Auto Slack Check-in auto-slack-checkin is a command line interface (CLI) that sends check-in or check-out message for you while you are sleeping ??.

Feb 15, 2022
Observer-pattern is broken at GitHub, too many mails

Informer What Returns information at your will. Should enable you to turn off all notifications, without loosing important notices. Format should be y

Jan 21, 2022
Golang Framework for writing Slack bots

hanu - Go for Slack Bots! The Go framework hanu is your best friend to create Slack bots! hanu uses allot for easy command and request parsing (e.g. w

Oct 24, 2022
Golang bot that connects to slack using Socketclient to read and write messages.
Golang bot that connects to slack using Socketclient to read and write messages.

?? (not)simple go project ?? Golang bot that connects to slack using Socketclient to read and write messages. ?? Use ?? @SquidBot : Mentions your name

Aug 23, 2022
IRC, Slack, Telegram and RocketChat bot written in go
IRC, Slack, Telegram and RocketChat bot written in go

go-bot IRC, Slack & Telegram bot written in Go using go-ircevent for IRC connectivity, nlopes/slack for Slack and Syfaro/telegram-bot-api for Telegram

Dec 20, 2022