about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/mail/opensmtpd/extras.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/mail/opensmtpd/extras.nix')
-rw-r--r--nixpkgs/pkgs/servers/mail/opensmtpd/extras.nix92
1 files changed, 92 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/mail/opensmtpd/extras.nix b/nixpkgs/pkgs/servers/mail/opensmtpd/extras.nix
new file mode 100644
index 000000000000..1d4ad63c37d2
--- /dev/null
+++ b/nixpkgs/pkgs/servers/mail/opensmtpd/extras.nix
@@ -0,0 +1,92 @@
+{ stdenv, fetchurl, openssl, libevent, libasr,
+  python2, pkgconfig, lua5, perl, mysql, postgresql, sqlite, hiredis,
+  enablePython ? true,
+  enableLua ? true,
+  enablePerl ? true,
+  enableMysql ? true,
+  enablePostgres ? true,
+  enableSqlite ? true,
+  enableRedis ? true,
+}:
+
+stdenv.mkDerivation rec {
+  name = "opensmtpd-extras-${version}";
+  version = "6.4.0";
+
+  src = fetchurl {
+    url = "https://www.opensmtpd.org/archives/${name}.tar.gz";
+    sha256 = "09k25l7zy5ch3fk6qphni2h0rxdp8wacmfag1whi608dgimrhrnb";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ openssl libevent
+    libasr python2 lua5 perl mysql.connector-c postgresql sqlite hiredis ];
+
+  configureFlags = [
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+    "--with-privsep-user=smtpd"
+    "--with-libevent-dir=${libevent.dev}"
+
+    "--with-filter-clamav"
+    "--with-filter-dkim-signer"
+    "--with-filter-dnsbl"
+    "--with-filter-monkey"
+    "--with-filter-pause"
+    "--with-filter-regex"
+    "--with-filter-spamassassin"
+    "--with-filter-stub"
+    "--with-filter-trace"
+    "--with-filter-void"
+    "--with-queue-null"
+    "--with-queue-ram"
+    "--with-queue-stub"
+    "--with-table-ldap"
+    "--with-table-socketmap"
+    "--with-table-passwd"
+    "--with-table-stub"
+    "--with-scheduler-ram"
+    "--with-scheduler-stub"
+
+  ] ++ stdenv.lib.optional enablePython [
+    "--with-python=${python2}"
+    "--with-filter-python"
+    "--with-queue-python"
+    "--with-table-python"
+    "--with-scheduler-python"
+
+  ] ++ stdenv.lib.optional enableLua [
+    "--with-lua=${pkgconfig}"
+    "--with-filter-lua"
+
+  ] ++ stdenv.lib.optional enablePerl [
+    "--with-perl=${perl}"
+    "--with-filter-perl"
+
+  ] ++ stdenv.lib.optional enableMysql [
+    "--with-table-mysql"
+
+  ] ++ stdenv.lib.optional enablePostgres [
+    "--with-table-postgres"
+
+  ] ++ stdenv.lib.optional enableSqlite [
+    "--with-table-sqlite"
+
+  ] ++ stdenv.lib.optional enableRedis [
+    "--with-table-redis"
+  ];
+
+  NIX_CFLAGS_COMPILE =
+    stdenv.lib.optional enableRedis
+      "-I${hiredis}/include/hiredis -lhiredis"
+    ++ stdenv.lib.optional enableMysql
+      "-L${mysql.connector-c}/lib/mysql";
+
+  meta = with stdenv.lib; {
+    homepage = https://www.opensmtpd.org/;
+    description = "Extra plugins for the OpenSMTPD mail server";
+    license = licenses.isc;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ gebner ekleog ];
+  };
+}