summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-06-23 21:04:55 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-04-25 00:04:26 +0200
commit72844d532b6d3b2a50b7a6412b87446662d55230 (patch)
treeed29329e58c49358b80095d14ff0bfdeb9abd3c0
parent2e5c081c473a8b5951f28a916d625ab5bb46c7c5 (diff)
downloadNUR-72844d532b6d3b2a50b7a6412b87446662d55230.tar.gz
NUR-72844d532b6d3b2a50b7a6412b87446662d55230.tar.zst
NUR-72844d532b6d3b2a50b7a6412b87446662d55230.zip
Configure mail (dovecot, postfix, spam checks)
-rw-r--r--modules/myids.nix6
-rw-r--r--pkgs/default.nix6
-rw-r--r--pkgs/dovecot/plugins/deleted_to_trash/default.nix21
-rw-r--r--pkgs/dovecot/plugins/deleted_to_trash/dovecot-deleted_to_trash.json15
-rw-r--r--pkgs/dovecot/plugins/deleted_to_trash/fix_mbox.patch12
-rw-r--r--pkgs/dovecot/plugins/fts_xapian/default.nix14
-rw-r--r--pkgs/dovecot/plugins/fts_xapian/fts-xapian.json15
7 files changed, 87 insertions, 2 deletions
diff --git a/modules/myids.nix b/modules/myids.nix
index 7ec9c0ef..e949ca7a 100644
--- a/modules/myids.nix
+++ b/modules/myids.nix
@@ -3,7 +3,8 @@
3 # Check that there is no clash with nixos/modules/misc/ids.nix 3 # Check that there is no clash with nixos/modules/misc/ids.nix
4 config = { 4 config = {
5 ids.uids = { 5 ids.uids = {
6 opendarc = 391; 6 vhost = 390;
7 openarc = 391;
7 opendmarc = 392; 8 opendmarc = 392;
8 peertube = 394; 9 peertube = 394;
9 redis = 395; 10 redis = 395;
@@ -13,7 +14,8 @@
13 mastodon = 399; 14 mastodon = 399;
14 }; 15 };
15 ids.gids = { 16 ids.gids = {
16 opendarc = 392; 17 vhost = 390;
18 openarc = 391;
17 opendmarc = 392; 19 opendmarc = 392;
18 peertube = 394; 20 peertube = 394;
19 redis = 395; 21 redis = 395;
diff --git a/pkgs/default.nix b/pkgs/default.nix
index 74f9d184..ff9d477b 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -50,4 +50,10 @@ rec {
50 python = python3; 50 python = python3;
51 inherit mylibs; 51 inherit mylibs;
52 }; 52 };
53 dovecot_deleted-to-trash = callPackage ./dovecot/plugins/deleted_to_trash {
54 inherit mylibs;
55 };
56 dovecot_fts-xapian = callPackage ./dovecot/plugins/fts_xapian {
57 inherit mylibs;
58 };
53} 59}
diff --git a/pkgs/dovecot/plugins/deleted_to_trash/default.nix b/pkgs/dovecot/plugins/deleted_to_trash/default.nix
new file mode 100644
index 00000000..db1afb50
--- /dev/null
+++ b/pkgs/dovecot/plugins/deleted_to_trash/default.nix
@@ -0,0 +1,21 @@
1{ stdenv, fetchurl, dovecot, mylibs, fetchpatch }:
2
3stdenv.mkDerivation (mylibs.fetchedGithub ./dovecot-deleted_to_trash.json // rec {
4 buildInputs = [ dovecot ];
5 patches = [
6 (fetchpatch {
7 name = "fix-dovecot-2.3.diff";
8 url = "https://github.com/lexbrugman/dovecot_deleted_to_trash/commit/c52a3799a96104a603ade33404ef6aa1db647b2f.diff";
9 sha256 = "0pld3rdcjp9df2qxbp807k6v4f48lyk0xy5q508ypa57d559y6dq";
10 })
11 ./fix_mbox.patch
12 ];
13 preConfigure = ''
14 substituteInPlace Makefile --replace \
15 "/usr/include/dovecot" \
16 "${dovecot}/include/dovecot"
17 substituteInPlace Makefile --replace \
18 "/usr/lib/dovecot/modules" \
19 "$out/lib/dovecot"
20 '';
21})
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
index 00000000..2987a023
--- /dev/null
+++ b/pkgs/dovecot/plugins/deleted_to_trash/dovecot-deleted_to_trash.json
@@ -0,0 +1,15 @@
1{
2 "tag": "81b0754-master",
3 "meta": {
4 "name": "dovecot-deleted_to_trash",
5 "url": "https://github.com/lexbrugman/dovecot_deleted_to_trash",
6 "branch": "master"
7 },
8 "github": {
9 "owner": "lexbrugman",
10 "repo": "dovecot_deleted_to_trash",
11 "rev": "81b07549accfc36467bf8527a53c295c7a02dbb9",
12 "sha256": "1b3k31g898s4fa0a9l4kvjsdyds772waaay84sjdxv09jw6mqs0f",
13 "fetchSubmodules": true
14 }
15}
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
index 00000000..0060fb4d
--- /dev/null
+++ b/pkgs/dovecot/plugins/deleted_to_trash/fix_mbox.patch
@@ -0,0 +1,12 @@
1diff --git a/src/deleted-to-trash-plugin.c b/src/deleted-to-trash-plugin.c
2index bb4cc78..66bad53 100644
3--- a/src/deleted-to-trash-plugin.c
4+++ b/src/deleted-to-trash-plugin.c
5@@ -82,6 +82,7 @@ static struct mailbox *mailbox_open_or_create(struct mailbox_list *list, const c
6 *error_r = mail_storage_get_last_error(mailbox_get_storage(box), &error);
7 if (error != MAIL_ERROR_NOTFOUND)
8 {
9+ i_error("%s", *error_r);
10 mailbox_free(&box);
11 return NULL;
12 }
diff --git a/pkgs/dovecot/plugins/fts_xapian/default.nix b/pkgs/dovecot/plugins/fts_xapian/default.nix
new file mode 100644
index 00000000..350a3ff0
--- /dev/null
+++ b/pkgs/dovecot/plugins/fts_xapian/default.nix
@@ -0,0 +1,14 @@
1{ stdenv, autoconf, automake, pkg-config, dovecot, libtool, xapian, icu, mylibs }:
2
3stdenv.mkDerivation (mylibs.fetchedGithub ./fts-xapian.json // rec {
4 buildInputs = [ dovecot autoconf automake libtool pkg-config xapian icu ];
5 preConfigure = ''
6 export PANDOC=false
7 autoreconf -vi
8 '';
9 configureFlags = [
10 "--with-dovecot=${dovecot}/lib/dovecot"
11 "--without-dovecot-install-dirs"
12 "--with-moduledir=$(out)/lib/dovecot"
13 ];
14})
diff --git a/pkgs/dovecot/plugins/fts_xapian/fts-xapian.json b/pkgs/dovecot/plugins/fts_xapian/fts-xapian.json
new file mode 100644
index 00000000..a7867766
--- /dev/null
+++ b/pkgs/dovecot/plugins/fts_xapian/fts-xapian.json
@@ -0,0 +1,15 @@
1{
2 "tag": "9a94b4a-master",
3 "meta": {
4 "name": "fts-xapian",
5 "url": "https://github.com/grosjo/fts-xapian",
6 "branch": "master"
7 },
8 "github": {
9 "owner": "grosjo",
10 "repo": "fts-xapian",
11 "rev": "9a94b4aeaac3988786ad72a716127c306b05c9d6",
12 "sha256": "12xv5fnqahs0cy26ja2jwk6dg95626amblisf2wcx3nqzkcf4w1y",
13 "fetchSubmodules": true
14 }
15}