summary refs log tree commit diff
path: root/pkgs/servers/mail
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-04-01 10:06:01 +0200
committerVladimír Čunát <vcunat@gmail.com>2016-04-01 10:06:01 +0200
commitab15a62c68bf7bf3b02e3bab00d121cc1426733c (patch)
tree398a82403b04bfa0bae8cadf1c5a64cf83145965 /pkgs/servers/mail
parentc643ccaa8c91f78b8c89eb87589886b8906d5b38 (diff)
parenta26357eefe017964448b5bb464163646b927a267 (diff)
downloadnixlib-ab15a62c68bf7bf3b02e3bab00d121cc1426733c.tar
nixlib-ab15a62c68bf7bf3b02e3bab00d121cc1426733c.tar.gz
nixlib-ab15a62c68bf7bf3b02e3bab00d121cc1426733c.tar.bz2
nixlib-ab15a62c68bf7bf3b02e3bab00d121cc1426733c.tar.lz
nixlib-ab15a62c68bf7bf3b02e3bab00d121cc1426733c.tar.xz
nixlib-ab15a62c68bf7bf3b02e3bab00d121cc1426733c.tar.zst
nixlib-ab15a62c68bf7bf3b02e3bab00d121cc1426733c.zip
Merge branch 'master' into closure-size
Beware that stdenv doesn't build. It seems something more will be needed
than just resolution of merge conflicts.
Diffstat (limited to 'pkgs/servers/mail')
-rw-r--r--pkgs/servers/mail/dovecot/2.2.x.nix75
-rw-r--r--pkgs/servers/mail/dovecot/default.nix68
-rw-r--r--pkgs/servers/mail/postfix/2.11.nix66
-rw-r--r--pkgs/servers/mail/postfix/3.0.nix91
-rw-r--r--pkgs/servers/mail/postfix/db-linux3.patch39
-rw-r--r--pkgs/servers/mail/postfix/default.nix103
-rw-r--r--pkgs/servers/mail/postfix/postfix-2.11.0.patch76
-rw-r--r--pkgs/servers/mail/postfix/postfix-2.2.9-db.patch40
-rw-r--r--pkgs/servers/mail/postfix/postfix-2.2.9-lib.patch12
-rw-r--r--pkgs/servers/mail/rspamd/default.nix4
10 files changed, 122 insertions, 452 deletions
diff --git a/pkgs/servers/mail/dovecot/2.2.x.nix b/pkgs/servers/mail/dovecot/2.2.x.nix
deleted file mode 100644
index ec4c5c935af0..000000000000
--- a/pkgs/servers/mail/dovecot/2.2.x.nix
+++ /dev/null
@@ -1,75 +0,0 @@
-{ stdenv, lib, fetchurl, perl, pkgconfig, systemd, openssl
-, bzip2, zlib, inotify-tools, pam, libcap
-, clucene_core_2, icu, openldap
-# Auth modules
-, withMySQL ? false, libmysql
-, withPgSQL ? false, postgresql
-, withSQLite ? true, sqlite
-}:
-
-stdenv.mkDerivation rec {
-  name = "dovecot-2.2.21";
-
-  nativeBuildInputs = [ perl pkgconfig ];
-  buildInputs = [ openssl bzip2 zlib clucene_core_2 icu openldap ]
-    ++ lib.optionals (stdenv.isLinux) [ systemd pam libcap inotify-tools ]
-    ++ lib.optional withMySQL libmysql
-    ++ lib.optional withPgSQL postgresql
-    ++ lib.optional withSQLite sqlite;
-
-  src = fetchurl {
-    url = "http://dovecot.org/releases/2.2/${name}.tar.gz";
-    sha256 = "080bil83gr2dski4gk2bxykg2g497kqm2hn2z4xkbw71b6g17dvs";
-  };
-
-  preConfigure = ''
-    patchShebangs src/config/settings-get.pl
-  '';
-
-  # We need this for sysconfdir, see remark below.
-  installFlags = [ "DESTDIR=$(out)" ];
-
-  postInstall = ''
-    cp -r $out/$out/* $out
-    rm -rf $out/$(echo "$out" | cut -d "/" -f2)
-  '' + lib.optionalString stdenv.isDarwin ''
-    install_name_tool -change libclucene-shared.1.dylib \
-        ${clucene_core_2}/lib/libclucene-shared.1.dylib \
-        $out/lib/dovecot/lib21_fts_lucene_plugin.so
-    install_name_tool -change libclucene-core.1.dylib \
-        ${clucene_core_2}/lib/libclucene-core.1.dylib \
-        $out/lib/dovecot/lib21_fts_lucene_plugin.so
-  '';
-
-  patches = [
-    # Make dovecot look for plugins in /etc/dovecot/modules
-    # so we can symlink plugins from several packages there.
-    # The symlinking needs to be done in NixOS.
-    ./2.2.x-module_dir.patch
-  ];
-
-  configureFlags = [
-    # It will hardcode this for /var/lib/dovecot.
-    # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626211
-    "--localstatedir=/var"
-    # We need this so utilities default to reading /etc/dovecot/dovecot.conf file.
-    "--sysconfdir=/etc"
-    "--with-ldap"
-    "--with-ssl=openssl"
-    "--with-zlib"
-    "--with-bzlib"
-    "--with-ldap"
-    "--with-lucene"
-    "--with-icu"
-  ] ++ lib.optional (stdenv.isLinux) "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
-    ++ lib.optional withMySQL "--with-mysql"
-    ++ lib.optional withPgSQL "--with-pgsql"
-    ++ lib.optional withSQLite "--with-sqlite";
-
-  meta = {
-    homepage = "http://dovecot.org/";
-    description = "Open source IMAP and POP3 email server written with security primarily in mind";
-    maintainers = with stdenv.lib.maintainers; [viric simons rickynils];
-    hydraPlatforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/servers/mail/dovecot/default.nix b/pkgs/servers/mail/dovecot/default.nix
index 3997370154e4..ec4c5c935af0 100644
--- a/pkgs/servers/mail/dovecot/default.nix
+++ b/pkgs/servers/mail/dovecot/default.nix
@@ -1,27 +1,75 @@
-{stdenv, fetchurl, openssl, pam, bzip2, zlib, inotify-tools, openldap}:
+{ stdenv, lib, fetchurl, perl, pkgconfig, systemd, openssl
+, bzip2, zlib, inotify-tools, pam, libcap
+, clucene_core_2, icu, openldap
+# Auth modules
+, withMySQL ? false, libmysql
+, withPgSQL ? false, postgresql
+, withSQLite ? true, sqlite
+}:
 
 stdenv.mkDerivation rec {
-  name = "dovecot-2.1.17";
+  name = "dovecot-2.2.21";
 
-  buildInputs = [openssl bzip2 zlib openldap] ++ stdenv.lib.optionals stdenv.isLinux [pam inotify-tools];
+  nativeBuildInputs = [ perl pkgconfig ];
+  buildInputs = [ openssl bzip2 zlib clucene_core_2 icu openldap ]
+    ++ lib.optionals (stdenv.isLinux) [ systemd pam libcap inotify-tools ]
+    ++ lib.optional withMySQL libmysql
+    ++ lib.optional withPgSQL postgresql
+    ++ lib.optional withSQLite sqlite;
 
   src = fetchurl {
-    url = "http://dovecot.org/releases/2.1/${name}.tar.gz";
-    sha256 = "06j2s5bcrmc0dhjsyavqiss3k65p6xn00a7sffpsv6w3yngv777m";
+    url = "http://dovecot.org/releases/2.2/${name}.tar.gz";
+    sha256 = "080bil83gr2dski4gk2bxykg2g497kqm2hn2z4xkbw71b6g17dvs";
   };
 
-  # It will hardcode this for /var/lib/dovecot.
-  # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626211
+  preConfigure = ''
+    patchShebangs src/config/settings-get.pl
+  '';
+
+  # We need this for sysconfdir, see remark below.
+  installFlags = [ "DESTDIR=$(out)" ];
+
+  postInstall = ''
+    cp -r $out/$out/* $out
+    rm -rf $out/$(echo "$out" | cut -d "/" -f2)
+  '' + lib.optionalString stdenv.isDarwin ''
+    install_name_tool -change libclucene-shared.1.dylib \
+        ${clucene_core_2}/lib/libclucene-shared.1.dylib \
+        $out/lib/dovecot/lib21_fts_lucene_plugin.so
+    install_name_tool -change libclucene-core.1.dylib \
+        ${clucene_core_2}/lib/libclucene-core.1.dylib \
+        $out/lib/dovecot/lib21_fts_lucene_plugin.so
+  '';
+
+  patches = [
+    # Make dovecot look for plugins in /etc/dovecot/modules
+    # so we can symlink plugins from several packages there.
+    # The symlinking needs to be done in NixOS.
+    ./2.2.x-module_dir.patch
+  ];
+
   configureFlags = [
+    # It will hardcode this for /var/lib/dovecot.
+    # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626211
     "--localstatedir=/var"
+    # We need this so utilities default to reading /etc/dovecot/dovecot.conf file.
+    "--sysconfdir=/etc"
     "--with-ldap"
-  ];
+    "--with-ssl=openssl"
+    "--with-zlib"
+    "--with-bzlib"
+    "--with-ldap"
+    "--with-lucene"
+    "--with-icu"
+  ] ++ lib.optional (stdenv.isLinux) "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
+    ++ lib.optional withMySQL "--with-mysql"
+    ++ lib.optional withPgSQL "--with-pgsql"
+    ++ lib.optional withSQLite "--with-sqlite";
 
   meta = {
     homepage = "http://dovecot.org/";
     description = "Open source IMAP and POP3 email server written with security primarily in mind";
-    maintainers = with stdenv.lib.maintainers; [viric simons];
+    maintainers = with stdenv.lib.maintainers; [viric simons rickynils];
     hydraPlatforms = stdenv.lib.platforms.linux;
   };
-
 }
diff --git a/pkgs/servers/mail/postfix/2.11.nix b/pkgs/servers/mail/postfix/2.11.nix
deleted file mode 100644
index 7c936bf12446..000000000000
--- a/pkgs/servers/mail/postfix/2.11.nix
+++ /dev/null
@@ -1,66 +0,0 @@
-{ stdenv, fetchurl, makeWrapper, gnused, db, openssl, cyrus_sasl, coreutils
-, findutils, gnugrep, gawk
-}:
-
-stdenv.mkDerivation rec {
-
-  name = "postfix-${version}";
-
-  version = "2.11.5";
-
-  src = fetchurl {
-    url = "ftp://ftp.cs.uu.nl/mirror/postfix/postfix-release/official/${name}.tar.gz";
-    sha256 = "11riz8ggaa09pi8d6xv2807qp7yjn918mrylfvkfwmvcdlgwck0a";
-  };
-
-  patches = [
-    ./postfix-2.11.0.patch
-    ./postfix-script-shell.patch
-  ];
-
-  buildInputs = [ makeWrapper gnused db openssl cyrus_sasl ];
-
-  preBuild = ''
-    sed -e '/^PATH=/d' -i postfix-install
-
-    export command_directory=$out/sbin
-    export config_directory=$out/etc/postfix
-    export daemon_directory=$out/libexec/postfix
-    export data_directory=/var/lib/postfix
-    export html_directory=$out/share/postfix/doc/html
-    export mailq_path=$out/bin/mailq
-    export manpage_directory=$out/share/man
-    export newaliases_path=$out/bin/newaliases
-    export queue_directory=/var/spool/postfix
-    export readme_directory=$out/share/postfix/doc
-    export sendmail_path=$out/bin/sendmail
-
-    make makefiles \
-      CCARGS='-DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I${cyrus_sasl}/include/sasl \
-              -fPIE -fstack-protector-all --param ssp-buffer-size=4 -O2 -D_FORTIFY_SOURCE=2' \
-      AUXLIBS='-ldb -lnsl -lresolv -lsasl2 -lcrypto -lssl -pie -Wl,-z,relro,-z,now'
-  '';
-
-  installTargets = [ "non-interactive-package" ];
-
-  installFlags = [ " install_root=$out " ];
-
-  postInstall = ''
-    mkdir -p $out
-    mv -v ut/$out/* $out/
-    sed -e '/^PATH=/d' -i $out/libexec/postfix/post-install
-    wrapProgram $out/libexec/postfix/post-install \
-      --prefix PATH ":" ${coreutils}/bin:${findutils}/bin:${gnugrep}/bin
-    wrapProgram $out/libexec/postfix/postfix-script \
-      --prefix PATH ":" ${coreutils}/bin:${findutils}/bin:${gnugrep}/bin:${gawk}/bin:${gnused}/bin
-  '';
-
-  meta = {
-    homepage = "http://www.postfix.org/";
-    description = "A fast, easy to administer, and secure mail server";
-    license = stdenv.lib.licenses.bsdOriginal;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.rickynils ];
-  };
-
-}
diff --git a/pkgs/servers/mail/postfix/3.0.nix b/pkgs/servers/mail/postfix/3.0.nix
deleted file mode 100644
index 52327090e441..000000000000
--- a/pkgs/servers/mail/postfix/3.0.nix
+++ /dev/null
@@ -1,91 +0,0 @@
-{ stdenv, lib, fetchurl, makeWrapper, gnused, db, openssl, cyrus_sasl
-, coreutils, findutils, gnugrep, gawk, icu, pcre
-, withPgSQL ? false, postgresql
-, withMySQL ? false, libmysql
-, withSQLite ? false, sqlite
-}:
-
-let
-  ccargs = lib.concatStringsSep " " ([
-    "-DUSE_TLS" "-DUSE_SASL_AUTH" "-DUSE_CYRUS_SASL" "-I${cyrus_sasl}/include/sasl"
-    "-DHAS_DB_BYPASS_MAKEDEFS_CHECK"
-    "-fPIE" "-fstack-protector-all" "--param" "ssp-buffer-size=4" "-O2" "-D_FORTIFY_SOURCE=2"
-   ] ++ lib.optional withPgSQL "-DHAS_PGSQL"
-     ++ lib.optionals withMySQL [ "-DHAS_MYSQL" "-I${libmysql}/include/mysql" ]
-     ++ lib.optional withSQLite "-DHAS_SQLITE");
-   auxlibs = lib.concatStringsSep " " ([
-     "-ldb" "-lnsl" "-lresolv" "-lsasl2" "-lcrypto" "-lssl" "-pie" "-Wl,-z,relro,-z,now"
-   ] ++ lib.optional withPgSQL "-lpq"
-     ++ lib.optional withMySQL "-lmysqlclient"
-     ++ lib.optional withSQLite "-lsqlite3");
-
-in stdenv.mkDerivation rec {
-
-  name = "postfix-${version}";
-
-  version = "3.0.3";
-
-  src = fetchurl {
-    url = "ftp://ftp.cs.uu.nl/mirror/postfix/postfix-release/official/${name}.tar.gz";
-    sha256 = "00mc12k5p1zlrlqcf33vh5zizaqr5ai8q78dwv69smjh6kn4c7j0";
-  };
-
-  buildInputs = [ makeWrapper gnused db openssl cyrus_sasl icu pcre ]
-                ++ lib.optional withPgSQL postgresql
-                ++ lib.optional withMySQL libmysql
-                ++ lib.optional withSQLite sqlite;
-
-  patches = [
-    ./postfix-script-shell.patch
-    ./postfix-3.0-no-warnings.patch
-    ./post-install-script.patch
-    ./relative-symlinks.patch
-  ];
-
-  preBuild = ''
-    sed -e '/^PATH=/d' -i postfix-install
-    sed -e "s|@PACKAGE@|$out|" -i conf/post-install
-
-    # post-install need skip permissions check/set on all symlinks following to /nix/store
-    sed -e "s|@NIX_STORE@|$NIX_STORE|" -i conf/post-install
-
-    export command_directory=$out/sbin
-    export config_directory=/etc/postfix
-    export meta_directory=$out/etc/postfix
-    export daemon_directory=$out/libexec/postfix
-    export data_directory=/var/lib/postfix/data
-    export html_directory=$out/share/postfix/doc/html
-    export mailq_path=$out/bin/mailq
-    export manpage_directory=$out/share/man
-    export newaliases_path=$out/bin/newaliases
-    export queue_directory=/var/lib/postfix/queue
-    export readme_directory=$out/share/postfix/doc
-    export sendmail_path=$out/bin/sendmail
-
-    make makefiles CCARGS='${ccargs}' AUXLIBS='${auxlibs}'
-  '';
-
-  installTargets = [ "non-interactive-package" ];
-
-  installFlags = [ "install_root=installdir" ];
-
-  postInstall = ''
-    mkdir -p $out
-    mv -v installdir/$out/* $out/
-    cp -rv installdir/etc $out
-    sed -e '/^PATH=/d' -i $out/libexec/postfix/post-install
-    wrapProgram $out/libexec/postfix/post-install \
-      --prefix PATH ":" ${coreutils}/bin:${findutils}/bin:${gnugrep}/bin
-    wrapProgram $out/libexec/postfix/postfix-script \
-      --prefix PATH ":" ${coreutils}/bin:${findutils}/bin:${gnugrep}/bin:${gawk}/bin:${gnused}/bin
-  '';
-
-  meta = {
-    homepage = "http://www.postfix.org/";
-    description = "A fast, easy to administer, and secure mail server";
-    license = lib.licenses.bsdOriginal;
-    platforms = lib.platforms.linux;
-    maintainers = [ lib.maintainers.rickynils ];
-  };
-
-}
diff --git a/pkgs/servers/mail/postfix/db-linux3.patch b/pkgs/servers/mail/postfix/db-linux3.patch
deleted file mode 100644
index c9dd4646798a..000000000000
--- a/pkgs/servers/mail/postfix/db-linux3.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff --git a/makedefs b/makedefs
-index b8b98c8..94443c0 100644
---- a/makedefs
-+++ b/makedefs
-@@ -341,20 +341,20 @@ EOF
- 		esac
- 		;;
-     Linux.3*)	SYSTYPE=LINUX3
--		if [ -f /usr/include/db.h ]
--		then
--		    : we are all set
--		elif [ -f /usr/include/db/db.h ]
--		then
--		    CCARGS="$CCARGS -I/usr/include/db"
--		else
--		    # On a properly installed system, Postfix builds
--		    # by including <db.h> and by linking with -ldb
--		    echo "No <db.h> include file found." 1>&2
--		    echo "Install the appropriate db*-devel package first." 1>&2
--		    echo "See the RELEASE_NOTES file for more information." 1>&2
--		    exit 1
--		fi
-+		#if [ -f /usr/include/db.h ]
-+		#then
-+		    #: we are all set
-+		#elif [ -f /usr/include/db/db.h ]
-+		#then
-+		    #CCARGS="$CCARGS -I/usr/include/db"
-+		#else
-+		    ## On a properly installed system, Postfix builds
-+		    ## by including <db.h> and by linking with -ldb
-+		    #echo "No <db.h> include file found." 1>&2
-+		    #echo "Install the appropriate db*-devel package first." 1>&2
-+		    #echo "See the RELEASE_NOTES file for more information." 1>&2
-+		    #exit 1
-+		#fi
- 		SYSLIBS="-ldb"
- 		for name in nsl resolv
- 		do
diff --git a/pkgs/servers/mail/postfix/default.nix b/pkgs/servers/mail/postfix/default.nix
index 838ca7a8d8df..52327090e441 100644
--- a/pkgs/servers/mail/postfix/default.nix
+++ b/pkgs/servers/mail/postfix/default.nix
@@ -1,70 +1,91 @@
-{ stdenv, fetchurl, db, glibc, openssl, cyrus_sasl
-, coreutils, findutils, gnused, gnugrep, bison, perl
+{ stdenv, lib, fetchurl, makeWrapper, gnused, db, openssl, cyrus_sasl
+, coreutils, findutils, gnugrep, gawk, icu, pcre
+, withPgSQL ? false, postgresql
+, withMySQL ? false, libmysql
+, withSQLite ? false, sqlite
 }:
 
-assert stdenv.isLinux;
+let
+  ccargs = lib.concatStringsSep " " ([
+    "-DUSE_TLS" "-DUSE_SASL_AUTH" "-DUSE_CYRUS_SASL" "-I${cyrus_sasl}/include/sasl"
+    "-DHAS_DB_BYPASS_MAKEDEFS_CHECK"
+    "-fPIE" "-fstack-protector-all" "--param" "ssp-buffer-size=4" "-O2" "-D_FORTIFY_SOURCE=2"
+   ] ++ lib.optional withPgSQL "-DHAS_PGSQL"
+     ++ lib.optionals withMySQL [ "-DHAS_MYSQL" "-I${libmysql}/include/mysql" ]
+     ++ lib.optional withSQLite "-DHAS_SQLITE");
+   auxlibs = lib.concatStringsSep " " ([
+     "-ldb" "-lnsl" "-lresolv" "-lsasl2" "-lcrypto" "-lssl" "-pie" "-Wl,-z,relro,-z,now"
+   ] ++ lib.optional withPgSQL "-lpq"
+     ++ lib.optional withMySQL "-lmysqlclient"
+     ++ lib.optional withSQLite "-lsqlite3");
 
-stdenv.mkDerivation rec {
-  name = "postfix-2.8.12";
+in stdenv.mkDerivation rec {
+
+  name = "postfix-${version}";
+
+  version = "3.0.3";
 
   src = fetchurl {
     url = "ftp://ftp.cs.uu.nl/mirror/postfix/postfix-release/official/${name}.tar.gz";
-    sha256 = "11z07mjy53l1fnl7k4101yk4ilibgqr1164628mqcbmmr8bh2szl";
+    sha256 = "00mc12k5p1zlrlqcf33vh5zizaqr5ai8q78dwv69smjh6kn4c7j0";
   };
 
-  buildInputs = [db openssl cyrus_sasl bison perl];
+  buildInputs = [ makeWrapper gnused db openssl cyrus_sasl icu pcre ]
+                ++ lib.optional withPgSQL postgresql
+                ++ lib.optional withMySQL libmysql
+                ++ lib.optional withSQLite sqlite;
 
   patches = [
-    ./postfix-2.2.9-db.patch
-    ./postfix-2.2.9-lib.patch
-    ./db-linux3.patch
     ./postfix-script-shell.patch
+    ./postfix-3.0-no-warnings.patch
+    ./post-install-script.patch
+    ./relative-symlinks.patch
   ];
 
-  postPatch = ''
-    sed -i -e s,/usr/bin,/var/run/current-system/sw/bin, \
-      -e s,/usr/sbin,/var/run/current-system/sw/bin, \
-      -e s,:/sbin,, src/util/sys_defs.h
-  '';
-
   preBuild = ''
-    export daemon_directory=$out/libexec/postfix
+    sed -e '/^PATH=/d' -i postfix-install
+    sed -e "s|@PACKAGE@|$out|" -i conf/post-install
+
+    # post-install need skip permissions check/set on all symlinks following to /nix/store
+    sed -e "s|@NIX_STORE@|$NIX_STORE|" -i conf/post-install
+
     export command_directory=$out/sbin
-    export queue_directory=/var/spool/postfix
-    export sendmail_path=$out/bin/sendmail
-    export mailq_path=$out/bin/mailq
-    export newaliases_path=$out/bin/newaliases
+    export config_directory=/etc/postfix
+    export meta_directory=$out/etc/postfix
+    export daemon_directory=$out/libexec/postfix
+    export data_directory=/var/lib/postfix/data
     export html_directory=$out/share/postfix/doc/html
+    export mailq_path=$out/bin/mailq
     export manpage_directory=$out/share/man
-    export sample_directory=$out/share/postfix/doc/samples
+    export newaliases_path=$out/bin/newaliases
+    export queue_directory=/var/lib/postfix/queue
     export readme_directory=$out/share/postfix/doc
+    export sendmail_path=$out/bin/sendmail
 
-    make makefiles CCARGS='-DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I${cyrus_sasl}/include/sasl -fPIE -fstack-protector-all --param ssp-buffer-size=4 -O2 -D_FORTIFY_SOURCE=2' AUXLIBS='-lssl -lcrypto -lsasl2 -ldb -lnsl -pie -Wl,-z,relro,-z,now'
+    make makefiles CCARGS='${ccargs}' AUXLIBS='${auxlibs}'
   '';
 
-  installPhase = ''
-    sed -e '/^PATH=/d' -i postfix-install
-    $SHELL postfix-install install_root=out -non-interactive -package
-
-    mkdir -p $out
-    mv -v "out$out/"* $out/
+  installTargets = [ "non-interactive-package" ];
 
-    mkdir -p $out/share/postfix
-    mv conf $out/share/postfix/
-    mv LICENSE TLS_LICENSE $out/share/postfix/
+  installFlags = [ "install_root=installdir" ];
 
-    sed -e 's@^PATH=.*@PATH=${coreutils}/bin:${findutils}/bin:${gnused}/bin:${gnugrep}/bin:'$out'/sbin@' -i $out/share/postfix/conf/post-install $out/libexec/postfix/post-install
-    sed -e '2aPATH=${coreutils}/bin:${findutils}/bin:${gnused}/bin:${gnugrep}/bin:'$out'/sbin' -i $out/share/postfix/conf/postfix-script $out/libexec/postfix/postfix-script
-    chmod a+x $out/share/postfix/conf/{postfix-script,post-install}
+  postInstall = ''
+    mkdir -p $out
+    mv -v installdir/$out/* $out/
+    cp -rv installdir/etc $out
+    sed -e '/^PATH=/d' -i $out/libexec/postfix/post-install
+    wrapProgram $out/libexec/postfix/post-install \
+      --prefix PATH ":" ${coreutils}/bin:${findutils}/bin:${gnugrep}/bin
+    wrapProgram $out/libexec/postfix/postfix-script \
+      --prefix PATH ":" ${coreutils}/bin:${findutils}/bin:${gnugrep}/bin:${gawk}/bin:${gnused}/bin
   '';
 
-  inherit glibc;
-
   meta = {
     homepage = "http://www.postfix.org/";
-    description = "a fast, easy to administer, and secure mail server";
-    license = stdenv.lib.licenses.bsdOriginal;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.simons ];
+    description = "A fast, easy to administer, and secure mail server";
+    license = lib.licenses.bsdOriginal;
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.rickynils ];
   };
+
 }
diff --git a/pkgs/servers/mail/postfix/postfix-2.11.0.patch b/pkgs/servers/mail/postfix/postfix-2.11.0.patch
deleted file mode 100644
index cdc4521c428a..000000000000
--- a/pkgs/servers/mail/postfix/postfix-2.11.0.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-diff -ruN postfix-2.11.0-orig/makedefs postfix-2.11.0/makedefs
---- postfix-2.11.0-orig/makedefs	2014-01-05 18:18:56.000000000 +0100
-+++ postfix-2.11.0/makedefs	2014-04-24 09:27:58.193869491 +0200
-@@ -290,36 +290,6 @@
- 		esac
- 		;;
-     Linux.2*)	SYSTYPE=LINUX2
--		case "$CCARGS" in
--		 *-DNO_DB*) ;;
--		 *-DHAS_DB*) ;;
--		 *) if [ -f /usr/include/db.h ]
--		    then
--			: we are all set
--		    elif [ -f /usr/include/db/db.h ]
--		    then
--			CCARGS="$CCARGS -I/usr/include/db"
--		    else
--			# No, we're not going to try db1 db2 db3 etc.
--			# On a properly installed system, Postfix builds
--			# by including <db.h> and by linking with -ldb
--			echo "No <db.h> include file found." 1>&2
--			echo "Install the appropriate db*-devel package first." 1>&2
--			exit 1
--		    fi
--		    SYSLIBS="-ldb"
--		    ;;
--		esac
--		for name in nsl resolv $GDBM_LIBS
--		do
--		    for lib in /usr/lib64 /lib64 /usr/lib /lib
--		    do
--			test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
--			    SYSLIBS="$SYSLIBS -l$name"
--			    break
--			}
--		    done
--		done
- 		# Kernel 2.4 added IPv6
- 		case "$RELEASE" in
- 		2.[0-3].*) CCARGS="$CCARGS -DNO_IPV6";;
-@@ -363,35 +333,6 @@
- 		esac
- 		;;
-     Linux.3*)	SYSTYPE=LINUX3
--		case "$CCARGS" in
--		 *-DNO_DB*) ;;
--		 *-DHAS_DB*) ;;
--		 *) if [ -f /usr/include/db.h ]
--		    then
--			: we are all set
--		    elif [ -f /usr/include/db/db.h ]
--		    then
--			CCARGS="$CCARGS -I/usr/include/db"
--		    else
--			# On a properly installed system, Postfix builds
--			# by including <db.h> and by linking with -ldb
--			echo "No <db.h> include file found." 1>&2
--			echo "Install the appropriate db*-devel package first." 1>&2
--			exit 1
--		    fi
--		    SYSLIBS="-ldb"
--		    ;;
--		esac
--		for name in nsl resolv
--		do
--		    for lib in /usr/lib64 /lib64 /usr/lib /usr/lib/* /lib /lib/*
--		    do
--			test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
--			    SYSLIBS="$SYSLIBS -l$name"
--			    break
--			}
--		    done
--		done
- 		;;
-      GNU.0*|GNU/kFreeBSD.[567]*)
- 		SYSTYPE=GNU0
diff --git a/pkgs/servers/mail/postfix/postfix-2.2.9-db.patch b/pkgs/servers/mail/postfix/postfix-2.2.9-db.patch
deleted file mode 100644
index 65f55ffd8f05..000000000000
--- a/pkgs/servers/mail/postfix/postfix-2.2.9-db.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-diff -ruN postfix-2.2.9/makedefs postfix-2.2.9.new/makedefs
---- postfix-2.2.9/makedefs	2006-01-03 21:50:25.000000000 +0000
-+++ postfix-2.2.9.new/makedefs	2006-03-11 00:38:30.000000000 +0000
-@@ -219,21 +219,21 @@
- 		;;
-     Linux.2*)	SYSTYPE=LINUX2
- 		# Postfix no longer needs DB 1.85 compatibility
--		if [ -f /usr/include/db.h ]
--		then
--		    : we are all set
--		elif [ -f /usr/include/db/db.h ]
--		then
--		    CCARGS="$CCARGS -I/usr/include/db"
--		else
--		    # No, we're not going to try db1 db2 db3 etc.
--		    # On a properly installed system, Postfix builds
--		    # by including <db.h> and by linking with -ldb
--		    echo "No <db.h> include file found." 1>&2
--		    echo "Install the appropriate db*-devel package first." 1>&2
--		    echo "See the RELEASE_NOTES file for more information." 1>&2
--		    exit 1
--		fi
-+		#if [ -f /usr/include/db.h ]
-+		#then
-+		    #: we are all set
-+		#elif [ -f /usr/include/db/db.h ]
-+		#then
-+		    #CCARGS="$CCARGS -I/usr/include/db"
-+		#else
-+		    ## No, we're not going to try db1 db2 db3 etc.
-+		    ## On a properly installed system, Postfix builds
-+		    ## by including <db.h> and by linking with -ldb
-+		    #echo "No <db.h> include file found." 1>&2
-+		    #echo "Install the appropriate db*-devel package first." 1>&2
-+		    #echo "See the RELEASE_NOTES file for more information." 1>&2
-+		    #exit 1
-+		#fi
- 		# GDBM locks the DBM .pag file after open. This breaks postmap.
- 		# if [ -f /usr/include/gdbm-ndbm.h ]
- 		# then
diff --git a/pkgs/servers/mail/postfix/postfix-2.2.9-lib.patch b/pkgs/servers/mail/postfix/postfix-2.2.9-lib.patch
deleted file mode 100644
index 03dcaa87f238..000000000000
--- a/pkgs/servers/mail/postfix/postfix-2.2.9-lib.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ruN postfix-2.2.9/makedefs postfix-2.2.9.new/makedefs
---- postfix-2.2.9/makedefs	2006-01-03 21:50:25.000000000 +0000
-+++ postfix-2.2.9.new/makedefs	2006-03-11 01:40:30.000000000 +0000
-@@ -247,7 +247,7 @@
- 		SYSLIBS="-ldb"
- 		for name in nsl resolv $GDBM_LIBS
- 		do
--		    for lib in /usr/lib64 /lib64 /usr/lib /lib
-+		    for lib in $glibc/usr/lib64 $glibc/lib64 $glibc/usr/lib $glibc/lib
- 		    do
- 			test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
- 			    SYSLIBS="$SYSLIBS -l$name"
diff --git a/pkgs/servers/mail/rspamd/default.nix b/pkgs/servers/mail/rspamd/default.nix
index bd4f3db3ab5d..f3156afd97ac 100644
--- a/pkgs/servers/mail/rspamd/default.nix
+++ b/pkgs/servers/mail/rspamd/default.nix
@@ -6,13 +6,13 @@ in
 
 stdenv.mkDerivation rec {
   name = "rspamd-${version}";
-  version = "1.1.3";
+  version = "1.2.0";
 
   src = fetchFromGitHub {
     owner = "vstakhov";
     repo = "rspamd";
     rev = version;
-    sha256 = "0mvh812a91yqynmcpv159dmkipx72fwg7rgscq7virzphchkbzvj";
+    sha256 = "00d9c9b8w6j0ls1w08bfghn4635as779b45vhhlv1f5wfzhxz6a1";
   };
 
   nativeBuildInputs = [ cmake pkgconfig perl ];