aboutsummaryrefslogtreecommitdiff
path: root/src/server.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-06-22 14:58:57 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-06-22 14:59:32 +0200
commit98f55be7304ef1078960408ff4435109601c0206 (patch)
treee06c089fb2da88d8901649c0a5379ff9a3f043ed /src/server.rs
parentc04b16a601c180c768cee805363ae0c6985d767a (diff)
downloadaerogramme-98f55be7304ef1078960408ff4435109601c0206.tar.gz
aerogramme-98f55be7304ef1078960408ff4435109601c0206.zip
It compiles again!
Diffstat (limited to 'src/server.rs')
-rw-r--r--src/server.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/server.rs b/src/server.rs
index 908ed11..cbe434c 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -22,7 +22,10 @@ impl Server {
let (login, lmtp_conf, imap_conf) = build(config)?;
let lmtp_server = lmtp_conf.map(|cfg| LmtpServer::new(cfg, login.clone()));
- let imap_server = imap_conf.map(|cfg| imap::new(cfg, login.clone()));
+ let imap_server = match imap_conf {
+ Some(cfg) => Some(imap::new(cfg, login.clone()).await?),
+ None => None,
+ };
Ok(Self { lmtp_server, imap_server })
}
@@ -44,7 +47,7 @@ impl Server {
}
},
async {
- match self.imap_server.as_ref() {
+ match self.imap_server {
None => Ok(()),
Some(s) => s.run(exit_signal.clone()).await,
}
@@ -74,7 +77,7 @@ fn build(config: Config) -> Result<(ArcLoginProvider, Option<LmtpConfig>, Option
(None, None) => bail!("No login provider is set up in config file"),
};
- Ok(lp, config.lmtp_config, config.imap_config)
+ Ok((lp, config.lmtp, config.imap))
}
pub fn watch_ctrl_c() -> (watch::Receiver<bool>, Arc<watch::Sender<bool>>) {