git.iko.soy/typeable/nixpkgs
on master help sign in
opensmtpd: 6.0.3p1 -> 6.4.0p1
commit58f701ab74568692a49a4230f37eb07b3b63740d authorLéo Gaspard <leo@gaspard.io> dateWed 24 Oct 2018, 00:07 (8 years ago) parent591ba73
4 files changed+43−28
nixos/doc/manual/release-notes/rl-1903.xml+8 nixos/tests/opensmtpd.nix+4−2 pkgs/servers/mail/opensmtpd/default.nix+19−26 pkgs/servers/mail/opensmtpd/fix-build.diff+12
nixos/doc/manual/release-notes/rl-1903.xml+8
@@ -137,6 +137,14 @@
137137 make sure to update your configuration if you want to keep <literal>proglodyte-wasm</literal>
138138 </para>
139139 </listitem>
140+ <listitem>
141+ <para>
142+ OpenSMTPD has been upgraded to version 6.4.0p1. This release makes
143+ backwards-incompatible changes to the configuration file format. See
144+ <command>man smtpd.conf</command> for more information on the new file
145+ format.
146+ </para>
147+ </listitem>
140148 </itemizedlist>
141149 </section>
142150
nixos/tests/opensmtpd.nix+4−2
@@ -17,11 +17,12 @@ import ./make-test.nix {
1717 extraServerArgs = [ "-v" ];
1818 serverConfiguration = ''
1919 listen on 0.0.0.0
20+ action do_relay relay
2021 # DO NOT DO THIS IN PRODUCTION!
2122 # Setting up authentication requires a certificate which is painful in
2223 # a test environment, but THIS WOULD BE DANGEROUS OUTSIDE OF A
2324 # WELL-CONTROLLED ENVIRONMENT!
24− accept from any for any relay
25+ match from any for any action do_relay
2526 '';
2627 };
2728 };
@@ -41,8 +42,9 @@ import ./make-test.nix {
4142 extraServerArgs = [ "-v" ];
4243 serverConfiguration = ''
4344 listen on 0.0.0.0
44− accept from any for local deliver to mda \
45+ action dovecot_deliver mda \
4546 "${pkgs.dovecot}/libexec/dovecot/deliver -d %{user.username}"
47+ match from any for local action dovecot_deliver
4648 '';
4749 };
4850 services.dovecot2 = {
pkgs/servers/mail/opensmtpd/default.nix+19−26
@@ -1,43 +1,33 @@
11{ stdenv, lib, fetchurl, fetchpatch, 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−# Deprecated: use the subaddressing-delimiter in the config file going forward
9−, tag_char ? null
2+, libasr, libevent, zlib, libressl, db, pam
103}:
114
12−if (tag_char != null)
13−then throw "opensmtpd: the tag_char argument is deprecated as it can now be specified at runtime via the 'subaddressing-delimiter' option of the configuration file"
14−else stdenv.mkDerivation rec {
5+stdenv.mkDerivation rec {
156 name = "opensmtpd-${version}";
16− version = "6.0.3p1";
7+ version = "6.4.0p1";
178
189 nativeBuildInputs = [ autoconf automake libtool bison ];
19− buildInputs = [ libasr libevent zlib openssl db pam ];
10+ buildInputs = [ libasr libevent zlib libressl db pam ];
2011
2112 src = fetchurl {
2213 url = "https://www.opensmtpd.org/archives/${name}.tar.gz";
23− sha256 = "291881862888655565e8bbe3cfb743310f5dc0edb6fd28a889a9a547ad767a81";
14+ sha256 = "1qxxhnlsmpfh9v4azgl0634955r085gsic1c66jdll21bd5w2mq8";
2415 };
2516
2617 patches = [
2718 ./proc_path.diff
28− (fetchpatch {
29− url = "https://github.com/OpenSMTPD/OpenSMTPD/commit/725ba4fa2ddf23bbcd1ff9ec92e86bbfaa6825c8.diff";
30− sha256 = "19rla0b2r53jpdiz25fcza29c2msz6j6paivxhp9jcy1xl457dqa";
31− })
19+ ./fix-build.diff # See https://github.com/OpenSMTPD/OpenSMTPD/pull/884
3220 ];
3321
34− postPatch = with builtins; with lib;
35− optionalString unpriviledged_smtpctl_encrypt ''
36− substituteInPlace smtpd/smtpctl.c --replace \
37− 'if (geteuid())' \
38− 'if (geteuid() != 0 && !(argc > 1 && !strcmp(argv[1], "encrypt")))'
39− substituteInPlace mk/smtpctl/Makefile.in --replace "chmod 2555" "chmod 0555"
40− '';
22+ # See https://github.com/OpenSMTPD/OpenSMTPD/issues/885 for the `sh bootstrap`
23+ # requirement
24+ postPatch = ''
25+ substituteInPlace smtpd/parse.y \
26+ --replace "/usr/libexec/" "$out/libexec/opensmtpd/"
27+ substituteInPlace mk/smtpctl/Makefile.am --replace "chgrp" "true"
28+ substituteInPlace mk/smtpctl/Makefile.am --replace "chmod 2555" "chmod 0555"
29+ sh bootstrap
30+ '';
4131
4232 configureFlags = [
4333 "--sysconfdir=/etc"
@@ -54,6 +44,9 @@ else stdenv.mkDerivation rec {
5444 "--with-table-db"
5545 ];
5646
47+ # See https://github.com/OpenSMTPD/OpenSMTPD/pull/884
48+ makeFlags = [ "CFLAGS=-ffunction-sections" "LDFLAGS=-Wl,--gc-sections" ];
49+
5750 installFlags = [
5851 "sysconfdir=\${out}/etc"
5952 "localstatedir=\${TMPDIR}"
@@ -67,6 +60,6 @@ else stdenv.mkDerivation rec {
6760 '';
6861 license = licenses.isc;
6962 platforms = platforms.linux;
70− maintainers = with maintainers; [ rickynils obadz ];
63+ maintainers = with maintainers; [ rickynils obadz ekleog ];
7164 };
7265}
pkgs/servers/mail/opensmtpd/fix-build.diffnew file+12
@@ -0,0 +1,12 @@
1+diff --git a/mk/smtpctl/Makefile.am b/mk/smtpctl/Makefile.am
2+index 5af0b713..f0fce735 100644
3+--- a/mk/smtpctl/Makefile.am
4++++ b/mk/smtpctl/Makefile.am
5+@@ -4,6 +4,7 @@ sbin_PROGRAMS= smtpctl
6+
7+ smtpctl_SOURCES= $(smtpd_srcdir)/enqueue.c
8+ smtpctl_SOURCES+= $(smtpd_srcdir)/parser.c
9++smtpctl_SOURCES+= $(smtpd_srcdir)/config.c
10+ smtpctl_SOURCES+= $(smtpd_srcdir)/log.c
11+ smtpctl_SOURCES+= $(smtpd_srcdir)/envelope.c
12+ smtpctl_SOURCES+= $(smtpd_srcdir)/queue_backend.c