GitHunt
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 ๐Ÿš€

  1. Clone the repository:

    git clone https://github.com/felixkohlhas/smtp2telegram.git
    cd smtp2telegram
  2. Copy and configure the example file:

    cp docker-compose.example.yml docker-compose.yml
    nano docker-compose.yml  # or edit with your preferred editor
  3. Set your Telegram credentials:

    environment:
      TELEGRAM_BOT_TOKEN: "your_bot_token_here"
      TELEGRAM_CHAT_ID: "your_chat_id_here"
  4. 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.

Languages

Python72.0%Dockerfile16.6%Jinja6.7%Shell4.7%

Contributors

Created April 18, 2025
Updated April 22, 2025
FelixKohlhas/SMTP2Telegram | GitHunt