Origin for each line in README.md from check-in 78b11b0319:
78b11b0319 2026-08-01 arcade: # smtp2tg 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: SMTP-to-Telegram gateway. Receives emails via SMTP and forwards them to Telegram chats. 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: --- 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: ## Installation 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: ### From source 78b11b0319 2026-08-01 arcade: ```bash 78b11b0319 2026-08-01 arcade: git clone https://github.com/kworr/smtp2tg 78b11b0319 2026-08-01 arcade: cd smtp2tg 78b11b0319 2026-08-01 arcade: cargo build --release 78b11b0319 2026-08-01 arcade: ``` 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: ## Configuration 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: 1. Create `smtp2tg.toml` (see `smtp2tg.toml.example` for reference). 78b11b0319 2026-08-01 arcade: 2. Get a Telegram Bot Token from [@BotFather](https://t.me/BotFather). 78b11b0319 2026-08-01 arcade: 3. Get your chat ID (use [@getidsbot](https://t.me/getidsbot) or debug mode in Telegram client). 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: ### Example configuration 78b11b0319 2026-08-01 arcade: ```toml 78b11b0319 2026-08-01 arcade: api_key = "replace-with-your-telegram-bot-token" 78b11b0319 2026-08-01 arcade: api_gateway = "https://api.telegram.org" 78b11b0319 2026-08-01 arcade: listen_on = "127.0.0.1:1025" 78b11b0319 2026-08-01 arcade: fields = ["date", "from", "subject"] 78b11b0319 2026-08-01 arcade: domains = ["example.com", "localhost"] 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: default = 0 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: [recipients] 78b11b0319 2026-08-01 arcade: "admin@example.com" = 12345678 78b11b0319 2026-08-01 arcade: "alerts@example.com" = -10012345678 78b11b0319 2026-08-01 arcade: ``` 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: All recipients are internally lowercased, so `UserName` equals `username`. 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: --- 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: ## Usage 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: ### Run 78b11b0319 2026-08-01 arcade: ```bash 78b11b0319 2026-08-01 arcade: ./smtp2tg -c /path/to/smtp2tg.toml 78b11b0319 2026-08-01 arcade: ``` 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: ### CLI arguments 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: | Argument | Description | Example | 78b11b0319 2026-08-01 arcade: |---------------|---------------------------|-----------------------| 78b11b0319 2026-08-01 arcade: | `-h`, `--help` | Show help | `smtp2tg --help` | 78b11b0319 2026-08-01 arcade: | `-c`, `--config` | Path to config file | `smtp2tg -c config.toml` | 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: --- 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: ## Security 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: ### Important 78b11b0319 2026-08-01 arcade: - **Recommended usage**: Run on `127.0.0.1` (localhost) only. 78b11b0319 2026-08-01 arcade: - If exposing to a network: 78b11b0319 2026-08-01 arcade: - **Restrict port access** via firewall. 78b11b0319 2026-08-01 arcade: - **Use TLS** (e.g., via `stunnel` or `nginx`). 78b11b0319 2026-08-01 arcade: - **Implement authentication** (this software does not provide it). 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: ### Config file permissions 78b11b0319 2026-08-01 arcade: Set file permissions to `0600` (owner read/write only): 78b11b0319 2026-08-01 arcade: ```bash 78b11b0319 2026-08-01 arcade: chmod 600 smtp2tg.toml 78b11b0319 2026-08-01 arcade: ``` 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: --- 78b11b0319 2026-08-01 arcade: ## How it works 78b11b0319 2026-08-01 arcade: 1. A client (e.g., Postfix) sends an email to `listen_on` (e.g., `127.0.0.1:1025`). 78b11b0319 2026-08-01 arcade: 2. smtp2tg parses the email and converts it to a Telegram message. 78b11b0319 2026-08-01 arcade: 3. The message is sent to the specified chat (or `default` if address is unknown). 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: ### Example: Email → Telegram 78b11b0319 2026-08-01 arcade: **Incoming email:** 78b11b0319 2026-08-01 arcade: ```text 78b11b0319 2026-08-01 arcade: From: user@example.com 78b11b0319 2026-08-01 arcade: To: admin@example.com 78b11b0319 2026-08-01 arcade: Subject: Test 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: Hello, world! 78b11b0319 2026-08-01 arcade: ``` 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: **Telegram message:** 78b11b0319 2026-08-01 arcade: ```html 78b11b0319 2026-08-01 arcade: <blockquote expandable> 78b11b0319 2026-08-01 arcade: <u><i>Subject:</i></u> <code>Test</code> 78b11b0319 2026-08-01 arcade: <u><i>From:</i></u> <code>user@example.com</code> 78b11b0319 2026-08-01 arcade: <u><i>Date:</i></u> <code>Mon, 01 Jan 2024 12:00:00 +0000</code> 78b11b0319 2026-08-01 arcade: </blockquote> 78b11b0319 2026-08-01 arcade: <pre>Hello, world!</pre> 78b11b0319 2026-08-01 arcade: ``` 78b11b0319 2026-08-01 arcade: 78b11b0319 2026-08-01 arcade: --- 78b11b0319 2026-08-01 arcade: ## Links 78b11b0319 2026-08-01 arcade: - **Original repository**: [http://fs.b1t.name/smtp2tg](http://fs.b1t.name/smtp2tg) 78b11b0319 2026-08-01 arcade: - **GitHub Mirror**: [https://github.com/kworr/smtp2tg](https://github.com/kworr/smtp2tg)