opensmtpd: add two configuration options

unpriviledged_smtpctl_encrypt (defaults to true) -- lets you invoke
smtpctl encrypt without being root

tag_char -- lets you override the + as in user+tag@domain.tld

obadz e0ef352a 19ee3baa

+18 -1
+18 -1
pkgs/servers/mail/opensmtpd/default.nix
··· 1 - { stdenv, fetchurl, autoconf, automake, libtool, bison 2 , libasr, libevent, zlib, openssl, db, pam 3 }: 4 5 stdenv.mkDerivation rec { ··· 15 }; 16 17 patches = [ ./proc_path.diff ]; 18 19 configureFlags = [ 20 "--sysconfdir=/etc"
··· 1 + { stdenv, lib, fetchurl, autoconf, automake, libtool, bison 2 , libasr, libevent, zlib, openssl, db, pam 3 + 4 + # opensmtpd requires root for no reason to encrypt passwords, this patch fixes it 5 + # see also https://github.com/OpenSMTPD/OpenSMTPD/issues/678 6 + , unpriviledged_smtpctl_encrypt ? true 7 + 8 + # This enables you to override the '+' character which typically separates the user from the tag in user+tag@domain.tld 9 + , tag_char ? null 10 }: 11 12 stdenv.mkDerivation rec { ··· 22 }; 23 24 patches = [ ./proc_path.diff ]; 25 + 26 + postPatch = with builtins; with lib; 27 + optionalString (isString tag_char) '' 28 + sed -i -e "s,TAG_CHAR.*'+',TAG_CHAR '${tag_char}'," smtpd/smtpd-defines.h 29 + '' + 30 + optionalString unpriviledged_smtpctl_encrypt '' 31 + substituteInPlace smtpd/smtpctl.c --replace \ 32 + 'if (geteuid())' \ 33 + 'if (geteuid() != 0 && !(argc > 1 && !strcmp(argv[1], "encrypt")))' 34 + ''; 35 36 configureFlags = [ 37 "--sysconfdir=/etc"