about summary refs log tree commit diff stats
path: root/modules/by-name/st/stalwart-mail/patches
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-02-09 16:24:51 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-03-09 13:44:14 +0100
commitf7ff6a320e216da1b52e335599e42a86106cf908 (patch)
tree8b9dfed4f281c299a31a52c10e676c38955fc8b9 /modules/by-name/st/stalwart-mail/patches
parentscripts/test_build.sh: Init (diff)
downloadnixos-server-f7ff6a320e216da1b52e335599e42a86106cf908.zip
module/stalwart-mail: Init initial version
Diffstat (limited to 'modules/by-name/st/stalwart-mail/patches')
-rw-r--r--modules/by-name/st/stalwart-mail/patches/build-crates-main-Cargo.toml-Activate-appropriate-de.patch26
-rw-r--r--modules/by-name/st/stalwart-mail/patches/fix-crates-directory-Guard-all-enterprise-only-featu.patch86
2 files changed, 112 insertions, 0 deletions
diff --git a/modules/by-name/st/stalwart-mail/patches/build-crates-main-Cargo.toml-Activate-appropriate-de.patch b/modules/by-name/st/stalwart-mail/patches/build-crates-main-Cargo.toml-Activate-appropriate-de.patch
new file mode 100644
index 0000000..bfea568
--- /dev/null
+++ b/modules/by-name/st/stalwart-mail/patches/build-crates-main-Cargo.toml-Activate-appropriate-de.patch
@@ -0,0 +1,26 @@
+From 42cbd55c21196bdb57ac9795a938b94a781bb1e9 Mon Sep 17 00:00:00 2001
+From: Benedikt Peetz <benedikt.peetz@b-peetz.de>
+Date: Sun, 9 Feb 2025 00:17:52 +0100
+Subject: [PATCH] build(crates/main/Cargo.toml): Activate appropriate default
+ features
+
+---
+ crates/main/Cargo.toml | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/crates/main/Cargo.toml b/crates/main/Cargo.toml
+index 036d2dcf..baa320ef 100644
+--- a/crates/main/Cargo.toml
++++ b/crates/main/Cargo.toml
+@@ -35,7 +35,7 @@ jemallocator = "0.5.0"
+ 
+ [features]
+ #default = ["sqlite", "postgres", "mysql", "rocks", "elastic", "s3", "redis", "azure", "enterprise"]
+-default = ["rocks", "enterprise"]
++default = ["rocks", "redis"]
+ sqlite = ["store/sqlite"]
+ foundationdb = ["store/foundation", "common/foundation"]
+ postgres = ["store/postgres"]
+-- 
+2.47.1
+
diff --git a/modules/by-name/st/stalwart-mail/patches/fix-crates-directory-Guard-all-enterprise-only-featu.patch b/modules/by-name/st/stalwart-mail/patches/fix-crates-directory-Guard-all-enterprise-only-featu.patch
new file mode 100644
index 0000000..80c4b60
--- /dev/null
+++ b/modules/by-name/st/stalwart-mail/patches/fix-crates-directory-Guard-all-enterprise-only-featu.patch
@@ -0,0 +1,86 @@
+From 3d20702a481bfa4ecc692cd07a7f1fe0a66bb5d9 Mon Sep 17 00:00:00 2001
+From: Benedikt Peetz <benedikt.peetz@b-peetz.de>
+Date: Sun, 9 Feb 2025 00:38:13 +0100
+Subject: [PATCH] fix(crates/directory): Guard all enterprise only features
+ behind a `enterprise` cfg block
+
+---
+ crates/directory/src/core/config.rs   | 1 +
+ crates/directory/src/core/dispatch.rs | 7 +++++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/crates/directory/src/core/config.rs b/crates/directory/src/core/config.rs
+index dfb7bf9b..0c3ce96a 100644
+--- a/crates/directory/src/core/config.rs
++++ b/crates/directory/src/core/config.rs
+@@ -84,6 +84,7 @@ impl Directories {
+                 "memory" => MemoryDirectory::from_config(config, prefix, data_store.clone())
+                     .await
+                     .map(DirectoryInner::Memory),
++                #[cfg(feature = "enterprise")]
+                 "oidc" => OpenIdDirectory::from_config(config, prefix, data_store.clone())
+                     .map(DirectoryInner::OpenId),
+                 unknown => {
+diff --git a/crates/directory/src/core/dispatch.rs b/crates/directory/src/core/dispatch.rs
+index a99e54fe..062f29c9 100644
+--- a/crates/directory/src/core/dispatch.rs
++++ b/crates/directory/src/core/dispatch.rs
+@@ -24,6 +24,7 @@ impl Directory {
+             DirectoryInner::Imap(store) => store.query(by).await,
+             DirectoryInner::Smtp(store) => store.query(by).await,
+             DirectoryInner::Memory(store) => store.query(by).await,
++            #[cfg(feature = "enterprise")]
+             DirectoryInner::OpenId(store) => store.query(by, return_member_of).await,
+         }
+         .caused_by(trc::location!())
+@@ -37,6 +38,7 @@ impl Directory {
+             DirectoryInner::Imap(store) => store.email_to_id(address).await,
+             DirectoryInner::Smtp(store) => store.email_to_id(address).await,
+             DirectoryInner::Memory(store) => store.email_to_id(address).await,
++            #[cfg(feature = "enterprise")]
+             DirectoryInner::OpenId(store) => store.email_to_id(address).await,
+         }
+         .caused_by(trc::location!())
+@@ -57,6 +59,7 @@ impl Directory {
+             DirectoryInner::Imap(store) => store.is_local_domain(domain).await,
+             DirectoryInner::Smtp(store) => store.is_local_domain(domain).await,
+             DirectoryInner::Memory(store) => store.is_local_domain(domain).await,
++            #[cfg(feature = "enterprise")]
+             DirectoryInner::OpenId(store) => store.is_local_domain(domain).await,
+         }
+         .caused_by(trc::location!())?;
+@@ -84,6 +87,7 @@ impl Directory {
+             DirectoryInner::Imap(store) => store.rcpt(email).await,
+             DirectoryInner::Smtp(store) => store.rcpt(email).await,
+             DirectoryInner::Memory(store) => store.rcpt(email).await,
++            #[cfg(feature = "enterprise")]
+             DirectoryInner::OpenId(store) => store.rcpt(email).await,
+         }
+         .caused_by(trc::location!())?;
+@@ -104,6 +108,7 @@ impl Directory {
+             DirectoryInner::Imap(store) => store.vrfy(address).await,
+             DirectoryInner::Smtp(store) => store.vrfy(address).await,
+             DirectoryInner::Memory(store) => store.vrfy(address).await,
++            #[cfg(feature = "enterprise")]
+             DirectoryInner::OpenId(store) => store.vrfy(address).await,
+         }
+         .caused_by(trc::location!())
+@@ -117,6 +122,7 @@ impl Directory {
+             DirectoryInner::Imap(store) => store.expn(address).await,
+             DirectoryInner::Smtp(store) => store.expn(address).await,
+             DirectoryInner::Memory(store) => store.expn(address).await,
++            #[cfg(feature = "enterprise")]
+             DirectoryInner::OpenId(store) => store.expn(address).await,
+         }
+         .caused_by(trc::location!())
+@@ -130,6 +136,7 @@ impl Directory {
+             | DirectoryInner::Imap(_)
+             | DirectoryInner::Smtp(_)
+             | DirectoryInner::Memory(_) => false,
++            #[cfg(feature = "enterprise")]
+             DirectoryInner::OpenId(_) => true,
+         }
+     }
+-- 
+2.47.1
+