Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nadiamoe/sendmail-telegram
✉️ sendmail-telegram is a sendmail implementation which sends telegram messages instead of emails
https://github.com/nadiamoe/sendmail-telegram
Last synced: 9 days ago
JSON representation
✉️ sendmail-telegram is a sendmail implementation which sends telegram messages instead of emails
- Host: GitHub
- URL: https://github.com/nadiamoe/sendmail-telegram
- Owner: nadiamoe
- Created: 2020-02-10T14:46:27.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-10T21:56:41.000Z (almost 5 years ago)
- Last Synced: 2024-12-27T05:04:24.064Z (9 days ago)
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ✉️ sendmail-telegram
Sendmail-telegram is an implementation of the `sendmail(8)` interface that uses a telegram bot to deliver emails.
A mapping of recipient addresses to telegram chat ids can be configured, as well as a catch-all chat.
## Usage
telegram-sendmail is `sendmail`-compliant (to an extent), to use it simply pipe an rfc2822-compliant email through `stdin`. Recipients can either be specified as positional arguments, or in the email using the `To`, `Cc` and `Bcc` headers.
```bash
$ cat sample.eml | ./sendmail
``````
Send an email to telegram users through a botUsage:
sendmail [flags]
sendmail [command]Available Commands:
aid Print recent updates for the bot
help Help about any commandFlags:
-h, --help help for sendmailUse "sendmail [command] --help" for more information about a command.
```
## Configuration
Sendmail-telegram needs some configuration to work. The minimum required settings are a Bot API Token, and a ChatID.
A sample configuration file can be found in `sendmail-telegram.SAMPLE.yml`, and will be searched for in:
1. CWD (`.`)
2. `$XDG_CONFIG_HOME`
3. `$HOME/.config`
2. `/etc`This file needs your Bot API token, and at least one Chat ID to send messages to:
**Bot API Token**: Can be obtained from the botfather. See [the official docs](https://core.telegram.org/bots/api) for details. When you get one, fill it in the default config.
**Chat ID**: For security reasons, telegram bots can only send messages to existing chats, this is, they cannot message you on their own. For this reason, you need to obtain a Chat ID before the bot can send you anything.
Fortunately, sendmail-telegram comes with a handy helper for this built-in. To use it, first send something to your bot, and then run `./sendmail aid`. This will print the chat IDs and names of the most recent messages sent to your bot.