Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/KostyaEsmukov/smtp_to_telegram
A small program that listens for SMTP and sends all incoming Email messages to Telegram
https://github.com/KostyaEsmukov/smtp_to_telegram
smtp telegram telegram-bot
Last synced: 7 days ago
JSON representation
A small program that listens for SMTP and sends all incoming Email messages to Telegram
- Host: GitHub
- URL: https://github.com/KostyaEsmukov/smtp_to_telegram
- Owner: KostyaEsmukov
- License: mit
- Created: 2019-02-23T18:07:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-12T15:23:01.000Z (about 1 year ago)
- Last Synced: 2024-10-20T20:48:41.027Z (23 days ago)
- Topics: smtp, telegram, telegram-bot
- Language: Go
- Homepage:
- Size: 110 KB
- Stars: 324
- Watchers: 14
- Forks: 78
- Open Issues: 8
-
Metadata Files:
- Readme: Readme.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome - KostyaEsmukov/smtp_to_telegram - A small program that listens for SMTP and sends all incoming Email messages to Telegram (Go)
README
# SMTP to Telegram
[![Docker Hub](https://img.shields.io/docker/pulls/kostyaesmukov/smtp_to_telegram.svg?style=flat-square)][Docker Hub]
[![Go Report Card](https://goreportcard.com/badge/github.com/KostyaEsmukov/smtp_to_telegram?style=flat-square)][Go Report Card]
[![License](https://img.shields.io/github/license/KostyaEsmukov/smtp_to_telegram.svg?style=flat-square)][License][Docker Hub]: https://hub.docker.com/r/kostyaesmukov/smtp_to_telegram
[Go Report Card]: https://goreportcard.com/report/github.com/KostyaEsmukov/smtp_to_telegram
[License]: https://github.com/KostyaEsmukov/smtp_to_telegram/blob/master/LICENSE`smtp_to_telegram` is a small program which listens for SMTP and sends
all incoming Email messages to Telegram.Say you have a software which can send Email notifications via SMTP.
You may use `smtp_to_telegram` as an SMTP server so
the notification mail would be sent to the chosen Telegram chats.## Getting started
1. Create a new Telegram bot: https://core.telegram.org/bots#creating-a-new-bot.
2. Open that bot account in the Telegram account which should receive
the messages, press `/start`.
3. Retrieve a chat id with `curl https://api.telegram.org/bot/getUpdates`.
4. Repeat steps 2 and 3 for each Telegram account which should receive the messages.
5. Start a docker container:```
docker run \
--name smtp_to_telegram \
-e ST_TELEGRAM_CHAT_IDS=, \
-e ST_TELEGRAM_BOT_TOKEN= \
kostyaesmukov/smtp_to_telegram
```Assuming that your Email-sending software is running in docker as well,
you may use `smtp_to_telegram:2525` as the target SMTP address.
No TLS or authentication is required.The default Telegram message format is:
```
From: {from}\\nTo: {to}\\nSubject: {subject}\\n\\n{body}\\n\\n{attachments_details}
```A custom format might be specified as well:
```
docker run \
--name smtp_to_telegram \
-e ST_TELEGRAM_CHAT_IDS=, \
-e ST_TELEGRAM_BOT_TOKEN= \
-e ST_TELEGRAM_MESSAGE_TEMPLATE="Subject: {subject}\\n\\n{body}" \
kostyaesmukov/smtp_to_telegram
```