summary refs log tree commit diff
path: root/pkgs/servers/mail
diff options
context:
space:
mode:
authorDaniel Ehlers <danielehlers@mindeye.net>2017-03-27 23:42:02 +0200
committerDaniel Ehlers <danielehlers@mindeye.net>2017-05-02 01:46:12 +0200
commit4338f096f59ad448192d692504a08565775e06ab (patch)
tree1f269d1f9be1bdd6dd381ddc036d75f5342374d5 /pkgs/servers/mail
parent5fe81c1bdb8b1331cef33231d642940b3ff026a0 (diff)
downloadnixlib-4338f096f59ad448192d692504a08565775e06ab.tar
nixlib-4338f096f59ad448192d692504a08565775e06ab.tar.gz
nixlib-4338f096f59ad448192d692504a08565775e06ab.tar.bz2
nixlib-4338f096f59ad448192d692504a08565775e06ab.tar.lz
nixlib-4338f096f59ad448192d692504a08565775e06ab.tar.xz
nixlib-4338f096f59ad448192d692504a08565775e06ab.tar.zst
nixlib-4338f096f59ad448192d692504a08565775e06ab.zip
nullmailer + service: init at 2.0
Diffstat (limited to 'pkgs/servers/mail')
-rw-r--r--pkgs/servers/mail/nullmailer/default.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/pkgs/servers/mail/nullmailer/default.nix b/pkgs/servers/mail/nullmailer/default.nix
new file mode 100644
index 000000000000..44840c91b058
--- /dev/null
+++ b/pkgs/servers/mail/nullmailer/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchurl, lib, tls ? true, gnutls ? null }:
+
+assert tls -> gnutls != null;
+
+stdenv.mkDerivation rec {
+
+  version = "2.0";
+  name = "nullmailer-${version}";
+
+  src = fetchurl {
+    url = "http://untroubled.org/nullmailer/nullmailer-${version}.tar.gz";
+    sha256 = "112ghdln8q9yljc8kp9mc3843mh0fyb4rig2v4q2dzy1l324q3yp";
+  };
+
+  buildInputs = stdenv.lib.optional tls gnutls;
+
+  configureFlags = [
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+  ] ++ stdenv.lib.optional tls "--enable-tls";
+
+  installFlags = [ "DESTDIR=$(out)" ];
+
+  # We have to remove the ''var'' directory, since nix can't handle named pipes
+  # and we can't use it in the store anyway. Same for ''etc''.
+  # The second line is need, because the installer of nullmailer will copy its
+  # own prepared version of ''etc'' and ''var'' and also uses the prefix path (configure phase)
+  # for hardcoded absolute references to its own binary farm, e.g. sendmail binary is
+  # calling nullmailer-inject binary. Since we can't configure inside the store of
+  # the derivation we need both directories in the root, but don't want to put them there
+  # during install, hence we have to fix mumbling inside the install directory.
+  # This is kind of a hack, but the only way I know of, yet.
+  postInstall = ''
+    rm -rf $out/var/ $out/etc/
+    mv $out/$out/* $out/
+    rmdir $out/$out
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "http://untroubled.org/nullmailer/";
+    description = ''
+      A sendmail/qmail/etc replacement MTA for hosts which relay to a fixed set of smart relays.
+      It is designed to be simple to configure, secure, and easily extendable.
+    '';
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.all;
+    maintainers = with lib.maintainers ; [ sargon ];
+  };
+}