20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
3. Get your chat ID (use [@getidsbot](https://t.me/getidsbot) or debug mode in Telegram client).
### Example configuration
```toml
api_key = "replace-with-your-telegram-bot-token"
api_gateway = "https://api.telegram.org"
listen_on = "127.0.0.1:1025"
unknown = "relay"
fields = ["date", "from", "subject"]
domains = ["example.com", "localhost"]
default = 0
[recipients]
"admin@example.com" = 12345678
"alerts@example.com" = -10012345678
```
To catch bounces (so they wouldn't stuck in upper mail server) make sure sender
envelope address is real as required by mail library (actually not sure whether
this applies to mailin). For example Postfix has to be tweaked like this:
$config_directory/main.cf:
smtp_generic_maps = hash:$config_directory/generic
$config_directory/generic:
"" postmaster@example.com
<> postmaster@example.com
Actually not sure which one works...
---
## Usage
### Run
```bash
./smtp2tg -c /path/to/smtp2tg.toml
|