FE
FelixKohlhas/SMTP2Telegram
A lightweight SMTP server that forwards incoming emails to Telegram.
SMTP2Telegram ๐งโก๏ธ๐ฑ
A lightweight SMTP server that forwards incoming emails to Telegram. Designed to run in Docker for easy deployment.
Uses a containerized version of ehlo.
Prerequisites ๐
- Docker and Docker Compose installed
- Telegram bot token (from @BotFather)
- Telegram chat ID where messages should be forwarded
Quick Start ๐
-
Clone the repository:
git clone https://github.com/felixkohlhas/smtp2telegram.git cd smtp2telegram -
Copy and configure the example file:
cp docker-compose.example.yml docker-compose.yml nano docker-compose.yml # or edit with your preferred editor -
Set your Telegram credentials:
environment: TELEGRAM_BOT_TOKEN: "your_bot_token_here" TELEGRAM_CHAT_ID: "your_chat_id_here"
-
Build and run the container:
docker-compose build docker-compose up -d
Configuration โ๏ธ
Environment Variables
| Variable | Description | Required |
|---|---|---|
TELEGRAM_BOT_TOKEN |
Your Telegram bot token | Yes |
TELEGRAM_CHAT_ID |
Target chat/channel/group ID | Yes |
Ports
- SMTP port (default: 10025) - ensure this is accessible and not blocked
Usage Example ๐ก
Configure your email client or application to send emails to:
- Server: IP/hostname where SMTP2Telegram is running
- Port: 10025 (or your custom port)
- No authentication required
All received emails will be forwarded to your specified Telegram chat.
On this page
Languages
Python72.0%Dockerfile16.6%Jinja6.7%Shell4.7%
Contributors
Created April 18, 2025
Updated April 22, 2025
