diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-12-14 13:03:04 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-12-14 13:03:04 +0100 |
commit | 1f6e64d34e44b8b7bc7247af38bccf3ade86cf0b (patch) | |
tree | 8c949a1ef85b00e881a0d052e2956ecbe74a4910 /src/server.rs | |
parent | 65f4ceae7835a1bed8ff65ecbc4933b4b3553c84 (diff) | |
download | aerogramme-1f6e64d34e44b8b7bc7247af38bccf3ade86cf0b.tar.gz aerogramme-1f6e64d34e44b8b7bc7247af38bccf3ade86cf0b.zip |
add support for hot reloading
Diffstat (limited to 'src/server.rs')
-rw-r--r-- | src/server.rs | 8 |
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 }) } |