From 5599901b3b99700bee872877f88c8100f5e3ff47 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 15 Jun 2022 18:44:58 +0200 Subject: Remove mailstore that is deprecated --- src/mailstore.rs | 33 --------------------------------- src/main.rs | 1 - src/server.rs | 3 --- 3 files changed, 37 deletions(-) delete mode 100644 src/mailstore.rs diff --git a/src/mailstore.rs b/src/mailstore.rs deleted file mode 100644 index 2bcc592..0000000 --- a/src/mailstore.rs +++ /dev/null @@ -1,33 +0,0 @@ -use std::sync::Arc; - -use anyhow::{bail, Result}; -use rusoto_signature::Region; - -use crate::config::*; -use crate::login::{ldap_provider::*, static_provider::*, *}; - -pub struct Mailstore { - pub login_provider: Box, -} -impl Mailstore { - pub fn new(config: Config) -> Result> { - let s3_region = Region::Custom { - name: config.aws_region.clone(), - endpoint: config.s3_endpoint, - }; - let k2v_region = Region::Custom { - name: config.aws_region, - endpoint: config.k2v_endpoint, - }; - let login_provider: Box = - match (config.login_static, config.login_ldap) { - (Some(st), None) => Box::new(StaticLoginProvider::new(st, k2v_region, s3_region)?), - (None, Some(ld)) => Box::new(LdapLoginProvider::new(ld, k2v_region, s3_region)?), - (Some(_), Some(_)) => { - bail!("A single login provider must be set up in config file") - } - (None, None) => bail!("No login provider is set up in config file"), - }; - Ok(Arc::new(Self { login_provider })) - } -} diff --git a/src/main.rs b/src/main.rs index 9ec5af0..11a0a89 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,6 @@ mod lmtp; mod login; mod mail_ident; mod mailbox; -mod mailstore; mod server; mod service; mod session; diff --git a/src/server.rs b/src/server.rs index 3abdfd1..2c8fe8b 100644 --- a/src/server.rs +++ b/src/server.rs @@ -1,7 +1,5 @@ use std::sync::Arc; - - use boitalettres::server::accept::addr::AddrIncoming; use boitalettres::server::accept::addr::AddrStream; use boitalettres::server::Server as ImapServer; @@ -13,7 +11,6 @@ use rusoto_signature::Region; use tokio::sync::watch; use tower::Service; -use crate::mailstore; use crate::service; use crate::lmtp::*; use crate::config::*; -- cgit v1.2.3