Enable redirects to sender using less own repositories

This commit is contained in:
Gonne 2025-02-24 22:46:42 +01:00
parent 450edd60db
commit 5f2ded90f5
2 changed files with 41 additions and 14 deletions

View file

@ -59,14 +59,16 @@
config.permittedInsecurePackages = ["jitsi-meet-1.0.8043"];
overlays = [
(final: prev: {
(_: prev: {
alias-to-sieve = inputs.alias-to-sieve.packages.x86_64-linux.default; # add custom package to convert alias files to sieve scripts on the stalwart machine
stalwart-mail = assert lib.assertMsg (prev.stalwart-mail.version == "0.11.6-unstable-2025-02-04") "Copy the Cargo.lock file from upstream and reintroduce the patch to sieve-rs, then update this assert statement.";
/*
prev.stalwart-mail.overrideAttrs (
finalAttrs: prevAttrs:
prevAttrs
*/
stalwart-mail = assert lib.assertMsg (prev.stalwart-mail.version == "0.11.6-unstable-2025-02-04") ''
1. If the bug https://github.com/stalwartlabs/sieve/issues/11 is resolved to our satisfaction, try to remove this overlay.
2. Check whether sieve-rs recieved new updates that our patch needs to be rebased upon.
3. Check whether the sieve-rs patch below that exchanges the dependency needs updates.
4. Then update the version comparison in this assert statement.
5. Update the `cargoHash` by setting it to `lib.fakeHash` and then inserting the result.
6. Check if we can get rid of alias-to-sieve when stalwart-mail has a builtin alias feature.
'';
prev.stalwart-mail.override (
let
rp = pkgs.rustPlatform;
@ -78,13 +80,11 @@
rp.buildRustPackage (
args
// rec {
src = final.fetchFromGitea {
domain = "gitea.mathebau.de";
owner = "gonne";
repo = "stalwart-mail";
rev = "549b7055f6419079bf0b0ddab5367f6e6834d265"; # Depend on sieve-rs without loop prevention
hash = "sha256-6+EyQC9hIDbmf0VGhU4XzNxtw/OgdNSOkm4dTClrowM=";
};
cargoPatches = [
# Let stalwart-mail depend on our own version of the sieve crate that does not have some “loop prevention” that disables redirects to the original sender.
# We want to redirect to sender if we simulate alias files and not doing so barely prevents loops in my opinion.
./sieve-rs.patch
];
cargoHash = "sha256-fdOU2W/EtkBk+1VmNMkFZTGbwBTQQRelrheVFhiUqlg=";
}
);