2021-08-05 21:33:18 +00:00
|
|
|
{ lib, stdenv, fetchurl, tlsSupport ? true, openssl }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ssmtp";
|
|
|
|
version = "2.64";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-08-05 21:33:18 +00:00
|
|
|
url = "mirror://debian/pool/main/s/ssmtp/ssmtp_${version}.orig.tar.bz2";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "0dps8s87ag4g3jr6dk88hs9zl46h3790marc5c2qw7l71k4pvhr2";
|
|
|
|
};
|
|
|
|
|
|
|
|
# A request has been made to merge this patch into ssmtp.
|
|
|
|
# See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858781
|
|
|
|
patches = [ ./ssmtp_support_AuthPassFile_parameter.patch ];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
2021-01-15 22:18:51 +00:00
|
|
|
(lib.enableFeature tlsSupport "ssl")
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
postConfigure = ''
|
|
|
|
# Don't run the script that interactively generates a config file.
|
|
|
|
# Also don't install the broken, cyclic symlink /lib/sendmail.
|
|
|
|
sed -e '/INSTALLED_CONFIGURATION_FILE/d' \
|
|
|
|
-e 's|/lib/sendmail|$(TMPDIR)/sendmail|' \
|
|
|
|
-i Makefile
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace '$(INSTALL) -s' '$(INSTALL) -s --strip-program $(STRIP)'
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installFlags = [ "etcdir=$(out)/etc" ];
|
|
|
|
|
|
|
|
installTargets = [ "install" "install-sendmail" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
buildInputs = lib.optional tlsSupport openssl;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
NIX_LDFLAGS = lib.optionalString tlsSupport "-lcrypto";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-08-05 21:33:18 +00:00
|
|
|
description = "simple MTA to deliver mail from a computer to a mail hub";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ basvandijk ];
|
|
|
|
};
|
|
|
|
}
|