aboutsummaryrefslogtreecommitdiff
path: root/src/server.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-12-14 13:03:04 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-12-14 13:03:04 +0100
commit1f6e64d34e44b8b7bc7247af38bccf3ade86cf0b (patch)
tree8c949a1ef85b00e881a0d052e2956ecbe74a4910 /src/server.rs
parent65f4ceae7835a1bed8ff65ecbc4933b4b3553c84 (diff)
downloadaerogramme-1f6e64d34e44b8b7bc7247af38bccf3ade86cf0b.tar.gz
aerogramme-1f6e64d34e44b8b7bc7247af38bccf3ade86cf0b.zip
add support for hot reloading
Diffstat (limited to 'src/server.rs')
-rw-r--r--src/server.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server.rs b/src/server.rs
index 2321da8..8abdb86 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -18,21 +18,21 @@ pub struct Server {
impl Server {
pub async fn from_companion_config(config: CompanionConfig) -> Result<Self> {
- let login = Arc::new(StaticLoginProvider::new(config.users)?);
+ let login = Arc::new(StaticLoginProvider::new(config.users).await?);
let lmtp_server = None;
- let imap_server = Some(imap::new(config.imap, login).await?);
+ let imap_server = Some(imap::new(config.imap, login.clone()).await?);
Ok(Self { lmtp_server, imap_server })
}
pub async fn from_provider_config(config: ProviderConfig) -> Result<Self> {
let login: ArcLoginProvider = match config.users {
- UserManagement::Static(x) => Arc::new(StaticLoginProvider::new(x)?),
+ UserManagement::Static(x) => Arc::new(StaticLoginProvider::new(x).await?),
UserManagement::Ldap(x) => Arc::new(LdapLoginProvider::new(x)?),
};
let lmtp_server = Some(LmtpServer::new(config.lmtp, login.clone()));
- let imap_server = Some(imap::new(config.imap, login).await?);
+ let imap_server = Some(imap::new(config.imap, login.clone()).await?);
Ok(Self { lmtp_server, imap_server })
}