]> git.immae.eu Git - perso/Immae/Config/Nix/NUR.git/commitdiff
Configure mail (dovecot, postfix, spam checks)
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 23 Jun 2019 19:04:55 +0000 (21:04 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 24 Apr 2020 22:04:26 +0000 (00:04 +0200)
modules/myids.nix
pkgs/default.nix
pkgs/dovecot/plugins/deleted_to_trash/default.nix [new file with mode: 0644]
pkgs/dovecot/plugins/deleted_to_trash/dovecot-deleted_to_trash.json [new file with mode: 0644]
pkgs/dovecot/plugins/deleted_to_trash/fix_mbox.patch [new file with mode: 0644]
pkgs/dovecot/plugins/fts_xapian/default.nix [new file with mode: 0644]
pkgs/dovecot/plugins/fts_xapian/fts-xapian.json [new file with mode: 0644]

index 7ec9c0efc5e595d7f591f3ed6ce1c9c851692a05..e949ca7ae8651ee09bb26aab85c66c43a0fa3b7f 100644 (file)
@@ -3,7 +3,8 @@
   # Check that there is no clash with nixos/modules/misc/ids.nix
   config = {
     ids.uids = {
-      opendarc = 391;
+      vhost = 390;
+      openarc = 391;
       opendmarc = 392;
       peertube = 394;
       redis = 395;
@@ -13,7 +14,8 @@
       mastodon = 399;
     };
     ids.gids = {
-      opendarc = 392;
+      vhost = 390;
+      openarc = 391;
       opendmarc = 392;
       peertube = 394;
       redis = 395;
index 74f9d184b2703cee2d97f7f069dbe669ad567eee..ff9d477b10fdfd6349b48aabe14f73e061afdc0a 100644 (file)
@@ -50,4 +50,10 @@ rec {
     python = python3;
     inherit mylibs;
   };
+  dovecot_deleted-to-trash = callPackage ./dovecot/plugins/deleted_to_trash {
+    inherit mylibs;
+  };
+  dovecot_fts-xapian = callPackage ./dovecot/plugins/fts_xapian {
+    inherit mylibs;
+  };
 }
diff --git a/pkgs/dovecot/plugins/deleted_to_trash/default.nix b/pkgs/dovecot/plugins/deleted_to_trash/default.nix
new file mode 100644 (file)
index 0000000..db1afb5
--- /dev/null
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, dovecot, mylibs, fetchpatch }:
+
+stdenv.mkDerivation (mylibs.fetchedGithub ./dovecot-deleted_to_trash.json // rec {
+  buildInputs = [ dovecot ];
+  patches = [
+    (fetchpatch {
+      name = "fix-dovecot-2.3.diff";
+      url = "https://github.com/lexbrugman/dovecot_deleted_to_trash/commit/c52a3799a96104a603ade33404ef6aa1db647b2f.diff";
+      sha256 = "0pld3rdcjp9df2qxbp807k6v4f48lyk0xy5q508ypa57d559y6dq";
+    })
+    ./fix_mbox.patch
+  ];
+  preConfigure = ''
+    substituteInPlace Makefile --replace \
+      "/usr/include/dovecot" \
+      "${dovecot}/include/dovecot"
+    substituteInPlace Makefile --replace \
+      "/usr/lib/dovecot/modules" \
+      "$out/lib/dovecot"
+    '';
+})
diff --git a/pkgs/dovecot/plugins/deleted_to_trash/dovecot-deleted_to_trash.json b/pkgs/dovecot/plugins/deleted_to_trash/dovecot-deleted_to_trash.json
new file mode 100644 (file)
index 0000000..2987a02
--- /dev/null
@@ -0,0 +1,15 @@
+{
+  "tag": "81b0754-master",
+  "meta": {
+    "name": "dovecot-deleted_to_trash",
+    "url": "https://github.com/lexbrugman/dovecot_deleted_to_trash",
+    "branch": "master"
+  },
+  "github": {
+    "owner": "lexbrugman",
+    "repo": "dovecot_deleted_to_trash",
+    "rev": "81b07549accfc36467bf8527a53c295c7a02dbb9",
+    "sha256": "1b3k31g898s4fa0a9l4kvjsdyds772waaay84sjdxv09jw6mqs0f",
+    "fetchSubmodules": true
+  }
+}
diff --git a/pkgs/dovecot/plugins/deleted_to_trash/fix_mbox.patch b/pkgs/dovecot/plugins/deleted_to_trash/fix_mbox.patch
new file mode 100644 (file)
index 0000000..0060fb4
--- /dev/null
@@ -0,0 +1,12 @@
+diff --git a/src/deleted-to-trash-plugin.c b/src/deleted-to-trash-plugin.c
+index bb4cc78..66bad53 100644
+--- a/src/deleted-to-trash-plugin.c
++++ b/src/deleted-to-trash-plugin.c
+@@ -82,6 +82,7 @@ static struct mailbox *mailbox_open_or_create(struct mailbox_list *list, const c
+       *error_r = mail_storage_get_last_error(mailbox_get_storage(box), &error);
+       if (error != MAIL_ERROR_NOTFOUND)
+       {
++              i_error("%s", *error_r);
+               mailbox_free(&box);
+               return NULL;
+       }
diff --git a/pkgs/dovecot/plugins/fts_xapian/default.nix b/pkgs/dovecot/plugins/fts_xapian/default.nix
new file mode 100644 (file)
index 0000000..350a3ff
--- /dev/null
@@ -0,0 +1,14 @@
+{ stdenv, autoconf, automake, pkg-config, dovecot, libtool, xapian, icu, mylibs }:
+
+stdenv.mkDerivation (mylibs.fetchedGithub ./fts-xapian.json // rec {
+  buildInputs = [ dovecot autoconf automake libtool pkg-config xapian icu ];
+  preConfigure = ''
+    export PANDOC=false
+    autoreconf -vi
+    '';
+  configureFlags = [
+    "--with-dovecot=${dovecot}/lib/dovecot"
+    "--without-dovecot-install-dirs"
+    "--with-moduledir=$(out)/lib/dovecot"
+  ];
+})
diff --git a/pkgs/dovecot/plugins/fts_xapian/fts-xapian.json b/pkgs/dovecot/plugins/fts_xapian/fts-xapian.json
new file mode 100644 (file)
index 0000000..a786776
--- /dev/null
@@ -0,0 +1,15 @@
+{
+  "tag": "9a94b4a-master",
+  "meta": {
+    "name": "fts-xapian",
+    "url": "https://github.com/grosjo/fts-xapian",
+    "branch": "master"
+  },
+  "github": {
+    "owner": "grosjo",
+    "repo": "fts-xapian",
+    "rev": "9a94b4aeaac3988786ad72a716127c306b05c9d6",
+    "sha256": "12xv5fnqahs0cy26ja2jwk6dg95626amblisf2wcx3nqzkcf4w1y",
+    "fetchSubmodules": true
+  }
+}