git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #15630 from obadz/opensmtpd

opensmtpd: 5.7.3p2 -> 5.9.2p1

commit89d50c4341a72bc2a0c3c5bfd0ffded30de141ff authorJoachim Fasting <joachifm@users.noreply.github.com> dateMon 23 May 2016, 08:52 (11 years ago) parentce4f6c2e69ed2b
3 files changed+62−44
nixos/modules/services/mail/opensmtpd.nix+10−1 pkgs/servers/mail/opensmtpd/default.nix+10−9 pkgs/servers/mail/opensmtpd/proc_path.diff+42−34
nixos/modules/services/mail/opensmtpd.nix+10−1
@@ -107,7 +107,16 @@ in {
107107 wantedBy = [ "multi-user.target" ];
108108 wants = [ "network.target" ];
109109 after = [ "network.target" ];
110− preStart = "mkdir -p /var/spool";
110+ preStart = ''
111+ mkdir -p /var/spool/smtpd
112+
113+ mkdir -p /var/spool/smtpd/offline
114+ chown root.smtpq /var/spool/smtpd/offline
115+ chmod 770 /var/spool/smtpd/offline
116+
117+ mkdir -p /var/spool/smtpd/purge
118+ chmod 700 /var/spool/smtpd/purge
119+ '';
111120 serviceConfig.ExecStart = "${opensmtpd}/sbin/smtpd -d -f ${conf} ${args}";
112121 environment.OPENSMTPD_PROC_PATH = "${procEnv}/libexec/opensmtpd";
113122 };
pkgs/servers/mail/opensmtpd/default.nix+10−9
@@ -1,17 +1,17 @@
11{ stdenv, fetchurl, autoconf, automake, libtool, bison
2−, libasr, libevent, zlib, openssl, db, pam, cacert
2+, libasr, libevent, zlib, openssl, db, pam
33}:
44
55stdenv.mkDerivation rec {
66 name = "opensmtpd-${version}";
7− version = "5.7.3p2";
7+ version = "5.9.2p1";
88
99 nativeBuildInputs = [ autoconf automake libtool bison ];
1010 buildInputs = [ libasr libevent zlib openssl db pam ];
1111
1212 src = fetchurl {
1313 url = "http://www.opensmtpd.org/archives/${name}.tar.gz";
14− sha256 = "0d2973008d0f66bebb84bed516be6c32617735241cc54dd26643529281a8e52b";
14+ sha256 = "07d7f1m5sxyz6mkk228rcm7fsf7350994ayvmhgph333q5rz48im";
1515 };
1616
1717 patches = [ ./proc_path.diff ];
@@ -23,8 +23,9 @@ stdenv.mkDerivation rec {
2323 "--with-pam"
2424 "--without-bsd-auth"
2525 "--with-sock-dir=/run"
26− "--with-privsep-user=smtpd"
27− "--with-queue-user=smtpq"
26+ "--with-user-smtpd=smtpd"
27+ "--with-user-queue=smtpq"
28+ "--with-group-queue=smtpq"
2829 "--with-ca-file=/etc/ssl/certs/ca-certificates.crt"
2930 "--with-libevent-dir=${libevent.dev}"
3031 "--enable-table-db"
@@ -35,14 +36,14 @@ stdenv.mkDerivation rec {
3536 "localstatedir=\${TMPDIR}"
3637 ];
3738
38− meta = {
39+ meta = with stdenv.lib; {
3940 homepage = https://www.opensmtpd.org/;
4041 description = ''
4142 A free implementation of the server-side SMTP protocol as defined by
4243 RFC 5321, with some additional standard extensions
4344 '';
44− license = stdenv.lib.licenses.isc;
45− platforms = stdenv.lib.platforms.linux;
46− maintainers = [ stdenv.lib.maintainers.rickynils ];
45+ license = licenses.isc;
46+ platforms = platforms.linux;
47+ maintainers = with maintainers; [ rickynils obadz ];
4748 };
4849}
pkgs/servers/mail/opensmtpd/proc_path.diff+42−34
@@ -1,11 +1,12 @@
1−diff -Naur opensmtpd-5.7.1p1/smtpd/parse.y opensmtpd-5.7.1p1.patched/smtpd/parse.y
2−--- opensmtpd-5.7.1p1/smtpd/parse.y 2015-06-30 10:13:34.000000000 +0200
3−+++ opensmtpd-5.7.1p1.patched/smtpd/parse.y 2015-09-26 08:41:17.012472516 +0200
4−@@ -2519,13 +2519,19 @@
1+diff --git a/smtpd/parse.y b/smtpd/parse.y
2+index ab02719..c1c77d9 100644
3+--- a/smtpd/parse.y
4++++ b/smtpd/parse.y
5+@@ -2534,13 +2534,19 @@ create_filter_proc(char *name, char *prog)
56 {
67 struct filter_conf *f;
78 char *path;
8−+ const char *proc_path;
9++ const char *proc_path;
910
1011 if (dict_get(&conf->sc_filters, name)) {
1112 yyerror("filter \"%s\" already defined", name);
@@ -13,64 +14,71 @@ diff -Naur opensmtpd-5.7.1p1/smtpd/parse.y opensmtpd-5.7.1p1.patched/smtpd/parse
1314 }
1415
1516- if (asprintf(&path, "%s/filter-%s", PATH_LIBEXEC, prog) == -1) {
16−+ proc_path = getenv("OPENSMTPD_PROC_PATH");
17−+ if (proc_path == NULL) {
18−+ proc_path = PATH_LIBEXEC;
19−+ }
17++ proc_path = getenv("OPENSMTPD_PROC_PATH");
18++ if (proc_path == NULL) {
19++ proc_path = PATH_LIBEXEC;
20++ }
2021+
2122+ if (asprintf(&path, "%s/filter-%s", proc_path, prog) == -1) {
2223 yyerror("filter \"%s\" asprintf failed", name);
2324 return (0);
2425 }
25−diff -Naur opensmtpd-5.7.1p1/smtpd/smtpd.c opensmtpd-5.7.1p1.patched/smtpd/smtpd.c
26−--- opensmtpd-5.7.1p1/smtpd/smtpd.c 2015-06-30 10:13:34.000000000 +0200
27−+++ opensmtpd-5.7.1p1.patched/smtpd/smtpd.c 2015-09-26 08:41:16.998472557 +0200
28−@@ -854,6 +854,7 @@
26+diff --git a/smtpd/smtpd.c b/smtpd/smtpd.c
27+index afc8891..9b0a80f 100644
28+--- a/smtpd/smtpd.c
29++++ b/smtpd/smtpd.c
30+@@ -795,6 +795,7 @@ fork_proc_backend(const char *key, const char *conf, const char *procname)
2931 char path[PATH_MAX];
3032 char name[PATH_MAX];
3133 char *arg;
32−+ char *proc_path;
34++ char *proc_path;
3335
3436 if (strlcpy(name, conf, sizeof(name)) >= sizeof(name)) {
3537 log_warnx("warn: %s-proc: conf too long", key);
36−@@ -864,7 +865,12 @@
38+@@ -805,7 +806,12 @@ fork_proc_backend(const char *key, const char *conf, const char *procname)
3739 if (arg)
3840 *arg++ = '\0';
3941
4042- if (snprintf(path, sizeof(path), PATH_LIBEXEC "/%s-%s", key, name) >=
41−+ proc_path = getenv("OPENSMTPD_PROC_PATH");
42−+ if (proc_path == NULL) {
43−+ proc_path = PATH_LIBEXEC;
44−+ }
43++ proc_path = getenv("OPENSMTPD_PROC_PATH");
44++ if (proc_path == NULL) {
45++ proc_path = PATH_LIBEXEC;
46++ }
4547+
4648+ if (snprintf(path, sizeof(path), "%s/%s-%s", proc_path, key, name) >=
4749 (ssize_t)sizeof(path)) {
4850 log_warn("warn: %s-proc: exec path too long", key);
4951 return (-1);
50−diff -Naur opensmtpd-5.7.1p1/smtpd/table.c opensmtpd-5.7.1p1.patched/smtpd/table.c
51−--- opensmtpd-5.7.1p1/smtpd/table.c 2015-06-30 10:13:34.000000000 +0200
52−+++ opensmtpd-5.7.1p1.patched/smtpd/table.c 2015-09-26 08:41:17.005472536 +0200
53−@@ -201,6 +201,7 @@
52+diff --git a/smtpd/table.c b/smtpd/table.c
53+index 21ee237..95b5164 100644
54+--- a/smtpd/table.c
55++++ b/smtpd/table.c
56+@@ -193,6 +193,7 @@ table_create(const char *backend, const char *name, const char *tag,
5457 struct table_backend *tb;
5558 char buf[LINE_MAX];
5659 char path[LINE_MAX];
57−+ const char *proc_path;
60++ const char *proc_path;
5861 size_t n;
5962 struct stat sb;
6063
61−@@ -215,8 +216,14 @@
64+@@ -207,11 +208,16 @@ table_create(const char *backend, const char *name, const char *tag,
6265 if (name && table_find(name, NULL))
6366 fatalx("table_create: table \"%s\" already defined", name);
6467
65−+ proc_path = getenv("OPENSMTPD_PROC_PATH");
66−+ if (proc_path == NULL) {
67−+ proc_path = PATH_LIBEXEC;
68−+ }
68++ proc_path = getenv("OPENSMTPD_PROC_PATH");
69++ if (proc_path == NULL) {
70++ proc_path = PATH_LIBEXEC;
71++ }
6972+
7073 if ((tb = table_backend_lookup(backend)) == NULL) {
71−- if ((size_t)snprintf(path, sizeof(path), PATH_LIBEXEC "/table-%s",
74+- if ((size_t)snprintf(path, sizeof(path), PATH_LIBEXEC"/table-%s",
75+- backend) >= sizeof(path)) {
76+- fatalx("table_create: path too long \""
77+- PATH_LIBEXEC"/table-%s\"", backend);
7278+ if ((size_t)snprintf(path, sizeof(path), "%s/table-%s",
73−+ proc_path,
74− backend) >= sizeof(path)) {
75− fatalx("table_create: path too long \""
76− PATH_LIBEXEC "/table-%s\"", backend);
79++ proc_path, backend) >= sizeof(path)) {
80++ fatalx("table_create: path too long \"%s/table-%s\"",
81++ proc_path, backend);
82+ }
83+ if (stat(path, &sb) == 0) {
84+ tb = table_backend_lookup("proc");