aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: ca661372862a04e754b91bd79cb14eb737e5e88c (plain) (blame)
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
mod bayou;
mod config;
mod cryptoblob;
mod login;
mod mailbox;
mod time;
mod uidindex;
mod server;

use anyhow::{bail, Result};
use std::sync::Arc;

use rusoto_signature::Region;

use config::*;
use login::{ldap_provider::*, static_provider::*, *};
use mailbox::Mailbox;
use server::Server;

#[tokio::main]
async fn main() {
    if let Err(e) = main2().await {
        eprintln!("Error: {}", e);
        std::process::exit(1);
    }
}

async fn main2() -> Result<()> {
    let config = read_config("mailrage.toml".into())?;

    let server = Server::new(config)?;
    server.run().await
}