Check-in [8ea7b79fca]
Logged in as anonymous
Overview
Comment:getting rid of direct tokio dependancy properly
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | v0.5.4
Files: files | file ages | folders
SHA3-256: 8ea7b79fca20b6ab24918da2a095d7b4f7d6b7dc347efbf0463aa88514443f71
User & Date: arcade on 2026-01-02 06:38:43.283
Other Links: manifest | tags
Context
2026-01-07
07:50
Create new branch named "release" check-in: 2f3e033caa user: arcade tags: release
2026-01-02
06:52
update/fix workflows check-in: d9d438563e user: arcade tags: trunk
06:38
getting rid of direct tokio dependancy properly check-in: 8ea7b79fca user: arcade tags: trunk, v0.5.4
2026-01-01
08:47
add proper tokio runtime, clean up junk about short headers, add api_gateway support check-in: 14ef340959 user: arcade tags: trunk, v0.5.3
Changes
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
 "lazy_static",
 "mail-parser",
 "mailin-embedded",
 "regex",
 "smol",
 "stacked_errors",
 "tgbot",
 "tokio",
]

[[package]]
name = "socket2"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881"







<







1514
1515
1516
1517
1518
1519
1520

1521
1522
1523
1524
1525
1526
1527
 "lazy_static",
 "mail-parser",
 "mailin-embedded",
 "regex",
 "smol",
 "stacked_errors",
 "tgbot",

]

[[package]]
name = "socket2"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881"
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408"
dependencies = [
 "bytes",
 "libc",
 "mio",
 "pin-project-lite",
 "socket2",
 "tokio-macros",
 "windows-sys 0.61.2",
]

[[package]]
name = "tokio-macros"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5"
dependencies = [
 "proc-macro2",
 "quote",
 "syn",
]

[[package]]
name = "tokio-rustls"
version = "0.26.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61"
dependencies = [
 "rustls",







<



<
<
<
<
<
<
<
<
<
<
<







1677
1678
1679
1680
1681
1682
1683

1684
1685
1686











1687
1688
1689
1690
1691
1692
1693
checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408"
dependencies = [
 "bytes",
 "libc",
 "mio",
 "pin-project-lite",
 "socket2",

 "windows-sys 0.61.2",
]












[[package]]
name = "tokio-rustls"
version = "0.26.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61"
dependencies = [
 "rustls",
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
 "proc-macro2",
 "quote",
 "syn",
]

[[package]]
name = "zmij"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aac060176f7020d62c3bcc1cdbcec619d54f48b07ad1963a3f80ce7a0c17755f"







|

|
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
 "proc-macro2",
 "quote",
 "syn",
]

[[package]]
name = "zmij"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de9211a9f64b825911bdf0240f58b7a8dac217fe260fc61f080a07f61372fbd5"
12
13
14
15
16
17
18
19
20
21
22
23
lazy_static = "1.5.0"
mail-parser = { version = "0.11", features = ["serde"] }
mailin-embedded = "^0"
regex = "1.11.1"
smol = "2.0.2"
stacked_errors = "0.7.1"
tgbot = "0.40"
tokio = { version = "~1", features = [ "macros", "rt" ] }

[profile.release]
lto = true
codegen-units = 1







<




12
13
14
15
16
17
18

19
20
21
22
lazy_static = "1.5.0"
mail-parser = { version = "0.11", features = ["serde"] }
mailin-embedded = "^0"
regex = "1.11.1"
smol = "2.0.2"
stacked_errors = "0.7.1"
tgbot = "0.40"


[profile.release]
lto = true
codegen-units = 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21



22
23
24
25
26
27
28
29
30
31
32
33




34



35
36
37
38
39
40
41
42
//! 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 smol::{
	fs::metadata,
};
use just_getopt::{
	OptFlags,
	OptSpecs,
	OptValue,
};



use stacked_errors::{
	Result,
	StackableErr,
	bail,
};

use std::{
	io::Cursor,
	os::unix::fs::PermissionsExt,
	path::Path,
};





#[tokio::main(flavor = "current_thread")]



async fn 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);
	let mut args = std::env::args();













|
<
<





>
>
>












>
>
>
>
|
>
>
>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14


15
16
17
18
19
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
//! 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,
};
use smol::{
	fs::metadata,
};
use stacked_errors::{
	Result,
	StackableErr,
	bail,
};

use std::{
	io::Cursor,
	os::unix::fs::PermissionsExt,
	path::Path,
};

fn main () -> Result<()> {
	smol::block_on(Compat::new(async {
		async_main().await.unwrap()
	}));

	Ok(())
}

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);
	let mut args = std::env::args();