mail2telegram  by TBXark

Email-to-Telegram forwarder using Cloudflare Workers

created 1 year ago
319 stars

Top 86.1% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a Telegram bot that forwards emails to Telegram messages, leveraging Cloudflare Email Routing. It's designed for users who want to receive email notifications directly in Telegram, offering features like email previews, summaries (with OpenAI integration), and management of sender lists via Telegram mini-programs.

How It Works

The solution deploys as a Cloudflare Worker. Emails are routed via Cloudflare Email Routing to the Worker. The Worker then processes the email content and forwards it to a specified Telegram chat using the Telegram Bot API. It utilizes Cloudflare KV for storing configurations like whitelists/blacklists and potentially email data, with an option to integrate OpenAI for content summarization.

Quick Start & Requirements

  • Deployment: Via Cloudflare Wrangler CLI (wrangler deploy) or copy-paste deployment to Cloudflare Workers.
  • Prerequisites:
    • Telegram Bot Token (from @BotFather).
    • Cloudflare account with Email Routing configured.
    • Node.js and yarn for CLI deployment.
    • Cloudflare KV Namespace bound to the Worker as DB.
  • Configuration: Set environment variables (TELEGRAM_ID, TELEGRAM_TOKEN, DOMAIN, etc.) in Cloudflare Worker settings.
  • Docs: mail2telegram English

Highlighted Details

  • Email previews, TEXT, and HTML viewing modes directly within Telegram.
  • Optional email content summarization via OpenAI API integration.
  • Telegram mini-program for managing sender whitelists and blacklists.
  • Supports forwarding to backup email addresses via FORWARD_LIST.

Maintenance & Community

The project is maintained by TBXark. Links to community support (Discord/Slack) or a roadmap are not explicitly provided in the README.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: Permissive MIT license allows for commercial use and integration with closed-source applications.

Limitations & Caveats

The bot does not support email attachments directly; a separate project is recommended for this. Large emails or attachments might cause Worker timeouts or duplicate notifications, though GUARDIAN_MODE can mitigate this at the cost of increased KV writes. The WHITE_LIST and BLOCK_LIST environment variables are being deprecated in favor of the mini-program management.

Health Check
Last commit

5 days ago

Responsiveness

1 day

Pull Requests (30d)
2
Issues (30d)
0
Star History
33 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.