From cd9f816c08fcc8e277b02ffe8c2ae404be6d9dfe Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Mon, 30 Jun 2008 21:11:07 +0000 Subject: [PATCH] Some security options added to mail-related servers.. svn path=/nixpkgs/trunk/; revision=12222 --- pkgs/servers/mail/dovecot/default.nix | 8 +++++++- pkgs/servers/mail/postfix/default.nix | 19 ++++++++++++++++--- pkgs/top-level/all-packages.nix | 4 ++-- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/pkgs/servers/mail/dovecot/default.nix b/pkgs/servers/mail/dovecot/default.nix index e93926b2f378..70e84fa51b03 100644 --- a/pkgs/servers/mail/dovecot/default.nix +++ b/pkgs/servers/mail/dovecot/default.nix @@ -1,7 +1,13 @@ -{stdenv, fetchurl}: +{stdenv, fetchurl + , openssl + , pam +}: stdenv.mkDerivation { name = "dovecot-1.0.3"; + + buildInputs = [openssl pam]; + src = fetchurl { url = http://dovecot.org/releases/1.0/dovecot-1.0.3.tar.gz; sha256 = "14b3sbvj9xpm5mjwfavwrcwmzfdgian51ncspl8j83cd8j01jdjz"; diff --git a/pkgs/servers/mail/postfix/default.nix b/pkgs/servers/mail/postfix/default.nix index 6a0ac22602d5..03fd33150e32 100644 --- a/pkgs/servers/mail/postfix/default.nix +++ b/pkgs/servers/mail/postfix/default.nix @@ -1,4 +1,7 @@ -{stdenv, fetchurl, db4, glibc}: +{stdenv, fetchurl, db4, glibc + , openssl + , cyrus_sasl +}: assert stdenv.isLinux; @@ -11,10 +14,18 @@ stdenv.mkDerivation { installTargets = ["non-interactive-package"]; installFlags = [" install_root=$out "]; - preInstall = "sed -e '/^PATH=/d' -i postfix-install"; + preInstall = " + sed -e '/^PATH=/d' -i postfix-install + "; postInstall = '' ensureDir $out mv ut/$out/* $out/ + + mkdir $out/share/postfix/conf + cp conf/* $out/share/postfix/conf + sed -e 's@PATH=.*@PATH=${stdenv.coreutils}/bin:${stdenv.findutils}/bin:${stdenv.gnused}/bin:${stdenv.gnugrep}/bin:$out/sbin@' -i $out/share/postfix/conf/post-install + sed -e '2aPATH=${stdenv.coreutils}/bin:${stdenv.findutils}/bin:${stdenv.gnused}/bin:${stdenv.gnugrep}/bin:$out/sbin' -i $out/share/postfix/conf/postfix-script + chmod a+x $out/share/postfix/conf/{postfix-script,post-install} ''; preBuild = '' @@ -28,9 +39,11 @@ stdenv.mkDerivation { export manpage_directory=$out/share/man export sample_directory=$out/share/postfix/doc/samples export readme_directory=$out/share/postfix/doc + + make makefiles CCARGS='-DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -DHAS_DB -I${cyrus_sasl}/include/sasl' AUXLIBS='-lssl -lcrypto -lsasl2 -ldb' ''; - buildinputs = [db4]; + buildinputs = [db4 openssl cyrus_sasl]; patches = [./postfix-2.2.9-db.patch ./postfix-2.2.9-lib.patch]; inherit glibc; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3e792a7d8948..5cf30cfe4b4e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4375,7 +4375,7 @@ let pkgs = rec { }; dovecot = import ../servers/mail/dovecot { - inherit fetchurl stdenv ; + inherit fetchurl stdenv openssl pam; }; ejabberd = import ../servers/xmpp/ejabberd { @@ -4411,7 +4411,7 @@ let pkgs = rec { }; postfix = import ../servers/mail/postfix { - inherit fetchurl stdenv db4; + inherit fetchurl stdenv db4 openssl cyrus_sasl; glibc = stdenv.glibc; };