2022-05-18 10:24:37 +00:00
|
|
|
mod bayou;
|
2022-05-19 10:10:48 +00:00
|
|
|
mod config;
|
2022-05-18 10:24:37 +00:00
|
|
|
mod cryptoblob;
|
2022-05-19 10:10:48 +00:00
|
|
|
mod login;
|
2022-05-19 10:14:06 +00:00
|
|
|
mod mailbox;
|
2022-05-18 10:24:37 +00:00
|
|
|
mod time;
|
|
|
|
mod uidindex;
|
2022-05-19 12:33:49 +00:00
|
|
|
mod server;
|
2022-05-18 10:24:37 +00:00
|
|
|
|
2022-05-19 10:10:48 +00:00
|
|
|
use anyhow::{bail, Result};
|
|
|
|
use std::sync::Arc;
|
2022-05-18 12:54:48 +00:00
|
|
|
|
|
|
|
use rusoto_signature::Region;
|
|
|
|
|
2022-05-19 10:10:48 +00:00
|
|
|
use config::*;
|
|
|
|
use login::{ldap_provider::*, static_provider::*, *};
|
|
|
|
use mailbox::Mailbox;
|
2022-05-19 12:33:49 +00:00
|
|
|
use server::Server;
|
2022-05-18 10:24:37 +00:00
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
async fn main() {
|
2022-05-19 10:10:48 +00:00
|
|
|
if let Err(e) = main2().await {
|
|
|
|
eprintln!("Error: {}", e);
|
|
|
|
std::process::exit(1);
|
|
|
|
}
|
2022-05-18 10:24:37 +00:00
|
|
|
}
|
|
|
|
|
2022-05-19 10:10:48 +00:00
|
|
|
async fn main2() -> Result<()> {
|
|
|
|
let config = read_config("mailrage.toml".into())?;
|
2022-05-18 12:54:48 +00:00
|
|
|
|
2022-05-19 12:33:49 +00:00
|
|
|
let server = Server::new(config)?;
|
|
|
|
server.run().await
|
2022-05-19 10:10:48 +00:00
|
|
|
}
|
2022-05-18 10:24:37 +00:00
|
|
|
|