1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
-
-
-
|
//! Simple SMTP-to-Telegram gateway. Can parse email and send them as telegram
//! messages to specified chats, generally you specify which email address is
//! available in configuration, everything else is sent to default address.
mod mail;
mod telegram;
mod utils;
#[cfg(test)]
mod tests;
use crate::mail::MailServer;
use async_compat::Compat;
use just_getopt::{
OptFlags,
OptSpecs,
OptValue,
|
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
+
|
smol::block_on(Compat::new(async {
async_main().await.unwrap()
}));
Ok(())
}
/// Actual main function running async with Error propagation support
async fn async_main () -> Result<()> {
let specs = OptSpecs::new()
.option("help", "h", OptValue::None)
.option("help", "help", OptValue::None)
.option("config", "c", OptValue::Required)
.option("config", "config", OptValue::Required)
.flag(OptFlags::OptionsEverywhere);
|