Initial commit

- rough filestructure
- first simplistic daemon
This commit is contained in:
malte
2025-11-06 11:38:20 +01:00
parent af8df2e62e
commit d843c08425
10 changed files with 1389 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
//
// Husk milter
//
use std::{
env,
process,
};
pub mod config;
use config::HuskConfig;
pub mod types;
pub mod daemon;
use daemon::Daemon;
#[tokio::main]
async fn main() {
let config_file = env::args().nth(1).expect("config file missing");
let husk_config = HuskConfig::load(&config_file);
if husk_config.is_none() {
eprintln!("Cannot load configuration");
process::exit(1);
}
let husk_config = husk_config.unwrap();
log4rs::init_file(husk_config.logfile_config(), Default::default()).unwrap();
log::info!("starting...");
match Daemon::run().await {
Ok(_) => {
println!("exiting...");
},
Err(e) => {
println!("exit with {:?}", e);
}
}
}