From 43a5bab9a5cf3247c4c8c11e395ee5159857beac Mon Sep 17 00:00:00 2001 From: pacien Date: Thu, 22 Aug 2019 17:50:13 +0200 Subject: [PATCH 1/2] libspf2: init at 1.2.10 --- .../development/libraries/libspf2/default.nix | 43 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/libraries/libspf2/default.nix diff --git a/pkgs/development/libraries/libspf2/default.nix b/pkgs/development/libraries/libspf2/default.nix new file mode 100644 index 000000000000..d4b112704284 --- /dev/null +++ b/pkgs/development/libraries/libspf2/default.nix @@ -0,0 +1,43 @@ +{ stdenv, fetchurl, autoreconfHook }: + +with stdenv.lib; + +stdenv.mkDerivation rec { + pname = "libspf2"; + version = "1.2.10"; + + src = fetchurl { + url = "https://www.libspf2.org/spf/libspf2-${version}.tar.gz"; + sha256 = "1j91p0qiipzf89qxq4m1wqhdf01hpn1h5xj4djbs51z23bl3s7nr"; + }; + + patches = [ + (fetchurl { + name = "0001-gcc-variadic-macros.patch"; + url = "https://github.com/shevek/libspf2/commit/5852828582f556e73751076ad092f72acf7fc8b6.patch"; + sha256 = "1v6ashqzpr0xidxq0vpkjd8wd66cj8df01kyzj678ljzcrax35hk"; + }) + ]; + + postPatch = '' + # disable static bins compilation + sed -i \ + -e '/bin_PROGRAMS/s/spfquery_static//' src/spfquery/Makefile.am \ + -e '/bin_PROGRAMS/s/spftest_static//' src/spftest/Makefile.am \ + -e '/bin_PROGRAMS/s/spfd_static//' src/spfd/Makefile.am \ + -e '/bin_PROGRAMS/s/spf_example_static//' src/spf_example/Makefile.am + ''; + + # autoreconf necessary because we modified automake files + nativeBuildInputs = [ autoreconfHook ]; + + doCheck = true; + + meta = { + description = "Implementation of the Sender Policy Framework for SMTP authorization"; + homepage = https://www.libspf2.org; + license = with licenses; [ lgpl21Plus bsd2 ]; + maintainers = with maintainers; [ pacien ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8b1fd5c8792c..a9a69a18757b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4498,6 +4498,8 @@ in libsidplayfp = callPackage ../development/libraries/libsidplayfp { }; + libspf2 = callPackage ../development/libraries/libspf2 { }; + libsrs2 = callPackage ../development/libraries/libsrs2 { }; libtermkey = callPackage ../development/libraries/libtermkey { }; From f1ef419be34a773677b7408bb7b5db02c2d93699 Mon Sep 17 00:00:00 2001 From: pacien Date: Thu, 22 Aug 2019 17:55:50 +0200 Subject: [PATCH 2/2] exim: add SPF support --- pkgs/servers/mail/exim/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/mail/exim/default.nix b/pkgs/servers/mail/exim/default.nix index a537a4c6d00c..25a94cd27bfa 100644 --- a/pkgs/servers/mail/exim/default.nix +++ b/pkgs/servers/mail/exim/default.nix @@ -3,6 +3,7 @@ , enableMySQL ? false, mysql, zlib , enableAuthDovecot ? false, dovecot , enablePAM ? false, pam +, enableSPF ? true, libspf2 }: stdenv.mkDerivation rec { @@ -18,7 +19,8 @@ stdenv.mkDerivation rec { ++ stdenv.lib.optional enableLDAP openldap ++ stdenv.lib.optionals enableMySQL [ mysql.connector-c zlib ] ++ stdenv.lib.optional enableAuthDovecot dovecot - ++ stdenv.lib.optional enablePAM pam; + ++ stdenv.lib.optional enablePAM pam + ++ stdenv.lib.optional enableSPF libspf2; preBuild = '' sed ' @@ -64,6 +66,10 @@ stdenv.mkDerivation rec { s:^\(EXTRALIBS_EXIM\)=\(.*\):\1=\2 -lpam: s:^# \(EXTRALIBS_EXIM\)=.*:\1=-lpam: ''} + ${stdenv.lib.optionalString enableSPF '' + s:^# \(SUPPORT_SPF\)=.*:\1=yes: + s:^# \(LDFLAGS += -lspf2\):\1: + ''} #/^\s*#.*/d #/^\s*$/d ' < src/EDITME > Local/Makefile