From 72844d532b6d3b2a50b7a6412b87446662d55230 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 23 Jun 2019 21:04:55 +0200 Subject: [PATCH] Configure mail (dovecot, postfix, spam checks) --- modules/myids.nix | 6 ++++-- pkgs/default.nix | 6 ++++++ .../plugins/deleted_to_trash/default.nix | 21 +++++++++++++++++++ .../dovecot-deleted_to_trash.json | 15 +++++++++++++ .../plugins/deleted_to_trash/fix_mbox.patch | 12 +++++++++++ pkgs/dovecot/plugins/fts_xapian/default.nix | 14 +++++++++++++ .../plugins/fts_xapian/fts-xapian.json | 15 +++++++++++++ 7 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 pkgs/dovecot/plugins/deleted_to_trash/default.nix create mode 100644 pkgs/dovecot/plugins/deleted_to_trash/dovecot-deleted_to_trash.json create mode 100644 pkgs/dovecot/plugins/deleted_to_trash/fix_mbox.patch create mode 100644 pkgs/dovecot/plugins/fts_xapian/default.nix create mode 100644 pkgs/dovecot/plugins/fts_xapian/fts-xapian.json 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 @@ # 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; 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 { 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 index 00000000..db1afb50 --- /dev/null +++ b/pkgs/dovecot/plugins/deleted_to_trash/default.nix @@ -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 index 00000000..2987a023 --- /dev/null +++ b/pkgs/dovecot/plugins/deleted_to_trash/dovecot-deleted_to_trash.json @@ -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 index 00000000..0060fb4d --- /dev/null +++ b/pkgs/dovecot/plugins/deleted_to_trash/fix_mbox.patch @@ -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 index 00000000..350a3ff0 --- /dev/null +++ b/pkgs/dovecot/plugins/fts_xapian/default.nix @@ -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 index 00000000..a7867766 --- /dev/null +++ b/pkgs/dovecot/plugins/fts_xapian/fts-xapian.json @@ -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 + } +} -- 2.41.0