aboutsummaryrefslogtreecommitdiff
path: root/src/server.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.rs')
-rw-r--r--src/server.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/server.rs b/src/server.rs
index 6210059..cf9930a 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -49,12 +49,13 @@ impl Server {
let lmtp_server = config.lmtp.map(|lmtp| LmtpServer::new(lmtp, login.clone()));
let imap_unsecure_server = config.imap_unsecure.map(|imap| imap::new_unsecure(imap, login.clone()));
let imap_server = config.imap.map(|imap| imap::new(imap, login.clone())).transpose()?;
+ let auth_server = config.auth.map(|auth| auth::AuthServer::new(auth, login.clone()));
Ok(Self {
lmtp_server,
imap_unsecure_server,
imap_server,
- auth_server: None,
+ auth_server,
pid_file: config.pid,
})
}
@@ -98,6 +99,12 @@ impl Server {
None => Ok(()),
Some(s) => s.run(exit_signal.clone()).await,
}
+ },
+ async {
+ match self.auth_server {
+ None => Ok(()),
+ Some(a) => a.run(exit_signal.clone()).await,
+ }
}
)?;