aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorQuentin <quentin@dufour.io>2024-01-25 08:13:03 +0000
committerQuentin <quentin@dufour.io>2024-01-25 08:13:03 +0000
commit1730bd6c10712de3437e2f870a4a7bfc85a23e85 (patch)
treecc1a1cb1165eff5a1b2c73ce15fc74dd770cbf9b /src/config.rs
parent4eebc2cb7d08570d33251934ae40425dd855aa21 (diff)
parentefd9ae5defd8647b709ad0e6cf17f3b28278c591 (diff)
downloadaerogramme-1730bd6c10712de3437e2f870a4a7bfc85a23e85.tar.gz
aerogramme-1730bd6c10712de3437e2f870a4a7bfc85a23e85.zip
Merge pull request 'feat/finalize-v0.2' (#82) from feat/finalize-v0.2 into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/aerogramme/pulls/82
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/config.rs b/src/config.rs
index b9c1f09..faaa1ba 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct CompanionConfig {
pub pid: Option<PathBuf>,
- pub imap: ImapConfig,
+ pub imap: ImapUnsecureConfig,
#[serde(flatten)]
pub users: LoginStaticConfig,
@@ -18,8 +18,10 @@ pub struct CompanionConfig {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ProviderConfig {
pub pid: Option<PathBuf>,
- pub imap: ImapConfig,
- pub lmtp: LmtpConfig,
+ pub imap: Option<ImapConfig>,
+ pub imap_unsecure: Option<ImapUnsecureConfig>,
+ pub lmtp: Option<LmtpConfig>,
+ pub auth: Option<AuthConfig>,
pub users: UserManagement,
}
@@ -32,6 +34,11 @@ pub enum UserManagement {
}
#[derive(Serialize, Deserialize, Debug, Clone)]
+pub struct AuthConfig {
+ pub bind_addr: SocketAddr,
+}
+
+#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct LmtpConfig {
pub bind_addr: SocketAddr,
pub hostname: String,
@@ -40,6 +47,13 @@ pub struct LmtpConfig {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ImapConfig {
pub bind_addr: SocketAddr,
+ pub certs: PathBuf,
+ pub key: PathBuf,
+}
+
+#[derive(Serialize, Deserialize, Debug, Clone)]
+pub struct ImapUnsecureConfig {
+ pub bind_addr: SocketAddr,
}
#[derive(Serialize, Deserialize, Debug, Clone)]