2021-01-19 06:50:56 +00:00
|
|
|
{ coreutils, db, fetchurl, openssl, pcre, perl, pkg-config, lib, stdenv
|
2018-07-21 14:14:46 +01:00
|
|
|
, enableLDAP ? false, openldap
|
2019-09-22 08:38:09 +01:00
|
|
|
, enableMySQL ? false, libmysqlclient, zlib
|
2018-07-21 14:14:46 +01:00
|
|
|
, enableAuthDovecot ? false, dovecot
|
2018-09-17 09:50:14 +01:00
|
|
|
, enablePAM ? false, pam
|
2019-08-22 16:55:50 +01:00
|
|
|
, enableSPF ? true, libspf2
|
2020-05-31 21:45:47 +01:00
|
|
|
, enableDMARC ? true, opendmarc
|
2021-07-14 20:57:17 +01:00
|
|
|
, enableRedis ? false, hiredis
|
2017-12-30 08:56:21 +00:00
|
|
|
}:
|
2015-02-18 18:55:07 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-05-18 18:06:58 +01:00
|
|
|
pname = "exim";
|
2021-09-29 16:48:06 +01:00
|
|
|
version = "4.95";
|
2015-02-18 18:55:07 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-07-17 18:20:32 +01:00
|
|
|
url = "https://ftp.exim.org/pub/exim/exim4/${pname}-${version}.tar.xz";
|
2021-09-29 16:48:06 +01:00
|
|
|
sha256 = "0rzi0kc3qiiaw8vnv5qrpwdvvh4sr5chns026xy99spjzx9vd76c";
|
2015-02-18 18:55:07 +00:00
|
|
|
};
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2018-07-21 14:14:46 +01:00
|
|
|
buildInputs = [ coreutils db openssl perl pcre ]
|
2021-01-15 07:07:56 +00:00
|
|
|
++ lib.optional enableLDAP openldap
|
|
|
|
++ lib.optionals enableMySQL [ libmysqlclient zlib ]
|
|
|
|
++ lib.optional enableAuthDovecot dovecot
|
|
|
|
++ lib.optional enablePAM pam
|
|
|
|
++ lib.optional enableSPF libspf2
|
2021-07-14 20:57:17 +01:00
|
|
|
++ lib.optional enableDMARC opendmarc
|
|
|
|
++ lib.optional enableRedis hiredis;
|
2015-02-18 18:55:07 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
sed '
|
|
|
|
s:^\(BIN_DIRECTORY\)=.*:\1='"$out"'/bin:
|
|
|
|
s:^\(CONFIGURE_FILE\)=.*:\1=/etc/exim.conf:
|
|
|
|
s:^\(EXIM_USER\)=.*:\1=ref\:nobody:
|
|
|
|
s:^\(SPOOL_DIRECTORY\)=.*:\1=/exim-homeless-shelter:
|
2018-09-17 21:01:11 +01:00
|
|
|
s:^# \(TRANSPORT_LMTP\)=.*:\1=yes:
|
2015-02-18 18:55:07 +00:00
|
|
|
s:^# \(SUPPORT_MAILDIR\)=.*:\1=yes:
|
|
|
|
s:^EXIM_MONITOR=.*$:# &:
|
|
|
|
s:^\(FIXED_NEVER_USERS\)=root$:\1=0:
|
|
|
|
s:^# \(WITH_CONTENT_SCAN\)=.*:\1=yes:
|
|
|
|
s:^# \(AUTH_PLAINTEXT\)=.*:\1=yes:
|
2020-05-18 18:06:58 +01:00
|
|
|
s:^# \(USE_OPENSSL\)=.*:\1=yes:
|
2015-02-18 18:55:07 +00:00
|
|
|
s:^# \(USE_OPENSSL_PC=openssl\)$:\1:
|
|
|
|
s:^# \(LOG_FILE_PATH=syslog\)$:\1:
|
|
|
|
s:^# \(HAVE_IPV6=yes\)$:\1:
|
|
|
|
s:^# \(CHOWN_COMMAND\)=.*:\1=${coreutils}/bin/chown:
|
|
|
|
s:^# \(CHGRP_COMMAND\)=.*:\1=${coreutils}/bin/chgrp:
|
|
|
|
s:^# \(CHMOD_COMMAND\)=.*:\1=${coreutils}/bin/chmod:
|
|
|
|
s:^# \(MV_COMMAND\)=.*:\1=${coreutils}/bin/mv:
|
|
|
|
s:^# \(RM_COMMAND\)=.*:\1=${coreutils}/bin/rm:
|
|
|
|
s:^# \(TOUCH_COMMAND\)=.*:\1=${coreutils}/bin/touch:
|
|
|
|
s:^# \(PERL_COMMAND\)=.*:\1=${perl}/bin/perl:
|
2020-10-31 09:57:46 +00:00
|
|
|
s:^# \(LOOKUP_DSEARCH=yes\)$:\1:
|
2021-01-15 07:07:56 +00:00
|
|
|
${lib.optionalString enableLDAP ''
|
2017-12-30 08:56:21 +00:00
|
|
|
s:^# \(LDAP_LIB_TYPE=OPENLDAP2\)$:\1:
|
|
|
|
s:^# \(LOOKUP_LDAP=yes\)$:\1:
|
2019-03-12 19:28:53 +00:00
|
|
|
s:^\(LOOKUP_LIBS\)=\(.*\):\1=\2 -lldap -llber:
|
|
|
|
s:^# \(LOOKUP_LIBS\)=.*:\1=-lldap -llber:
|
2017-12-30 08:56:21 +00:00
|
|
|
''}
|
2021-01-15 07:07:56 +00:00
|
|
|
${lib.optionalString enableMySQL ''
|
2018-07-21 14:14:46 +01:00
|
|
|
s:^# \(LOOKUP_MYSQL=yes\)$:\1:
|
2019-09-22 08:38:09 +01:00
|
|
|
s:^# \(LOOKUP_MYSQL_PC=libmysqlclient\)$:\1:
|
|
|
|
s:^\(LOOKUP_LIBS\)=\(.*\):\1=\2 -lmysqlclient -L${libmysqlclient}/lib/mysql -lssl -ldl -lm -lpthread -lz:
|
|
|
|
s:^# \(LOOKUP_LIBS\)=.*:\1=-lmysqlclient -L${libmysqlclient}/lib/mysql -lssl -ldl -lm -lpthread -lz:
|
2021-05-12 09:53:59 +01:00
|
|
|
s:^# \(LOOKUP_INCLUDE\)=.*:\1=-I${libmysqlclient.dev}/include/mysql/:
|
2018-07-21 14:14:46 +01:00
|
|
|
''}
|
2021-01-15 07:07:56 +00:00
|
|
|
${lib.optionalString enableAuthDovecot ''
|
2018-07-21 14:14:46 +01:00
|
|
|
s:^# \(AUTH_DOVECOT\)=.*:\1=yes:
|
|
|
|
''}
|
2021-01-15 07:07:56 +00:00
|
|
|
${lib.optionalString enablePAM ''
|
2018-09-17 09:50:14 +01:00
|
|
|
s:^# \(SUPPORT_PAM\)=.*:\1=yes:
|
|
|
|
s:^\(EXTRALIBS_EXIM\)=\(.*\):\1=\2 -lpam:
|
|
|
|
s:^# \(EXTRALIBS_EXIM\)=.*:\1=-lpam:
|
|
|
|
''}
|
2021-01-15 07:07:56 +00:00
|
|
|
${lib.optionalString enableSPF ''
|
2019-08-22 16:55:50 +01:00
|
|
|
s:^# \(SUPPORT_SPF\)=.*:\1=yes:
|
|
|
|
s:^# \(LDFLAGS += -lspf2\):\1:
|
|
|
|
''}
|
2021-01-15 07:07:56 +00:00
|
|
|
${lib.optionalString enableDMARC ''
|
2020-05-31 21:45:47 +01:00
|
|
|
s:^# \(SUPPORT_DMARC\)=.*:\1=yes:
|
|
|
|
s:^# \(LDFLAGS += -lopendmarc\):\1:
|
|
|
|
''}
|
2021-07-14 20:57:17 +01:00
|
|
|
${lib.optionalString enableRedis ''
|
|
|
|
s:^# \(LOOKUP_REDIS=yes\)$:\1:
|
|
|
|
s:^\(LOOKUP_LIBS\)=\(.*\):\1=\2 -lhiredis -L${hiredis}/lib/hiredis:
|
|
|
|
s:^# \(LOOKUP_LIBS\)=.*:\1=-lhiredis -L${hiredis}/lib/hiredis:
|
|
|
|
s:^\(LOOKUP_INCLUDE\)=\(.*\):\1=\2 -I${hiredis}/include/hiredis/:
|
|
|
|
s:^# \(LOOKUP_INCLUDE\)=.*:\1=-I${hiredis}/include/hiredis/:
|
|
|
|
''}
|
2015-02-18 18:55:07 +00:00
|
|
|
#/^\s*#.*/d
|
|
|
|
#/^\s*$/d
|
|
|
|
' < src/EDITME > Local/Makefile
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/share/man/man8
|
|
|
|
cp doc/exim.8 $out/share/man/man8
|
|
|
|
|
|
|
|
( cd build-Linux-*
|
|
|
|
cp exicyclog exim_checkaccess exim_dumpdb exim_lock exim_tidydb \
|
|
|
|
exipick exiqsumm exigrep exim_dbmbuild exim exim_fixdb eximstats \
|
|
|
|
exinext exiqgrep exiwhat \
|
|
|
|
$out/bin )
|
|
|
|
|
|
|
|
( cd $out/bin
|
|
|
|
for i in mailq newaliases rmail rsmtp runq sendmail; do
|
|
|
|
ln -s exim $i
|
|
|
|
done )
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2021-02-12 12:10:02 +00:00
|
|
|
homepage = "https://exim.org/";
|
2015-04-30 16:05:14 +01:00
|
|
|
description = "A mail transfer agent (MTA)";
|
2020-07-17 18:20:32 +01:00
|
|
|
license = with licenses; [ gpl2Plus bsd3 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ tv ajs124 das_j ];
|
2021-02-12 12:10:12 +00:00
|
|
|
changelog = "https://github.com/Exim/exim/blob/exim-${version}/doc/doc-txt/ChangeLog";
|
2015-02-18 18:55:07 +00:00
|
|
|
};
|
|
|
|
}
|