tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
opensmtpd: 6.0.2p1 -> 6.0.3p1
obadz
7 years ago
6081f514
23f2dfd9
+12
-38
2 changed files
expand all
collapse all
unified
split
pkgs
servers
mail
opensmtpd
default.nix
proc_path.diff
+6
-7
pkgs/servers/mail/opensmtpd/default.nix
···
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 {
0
0
13
name = "opensmtpd-${version}";
14
-
version = "6.0.2p1";
15
16
nativeBuildInputs = [ autoconf automake libtool bison ];
17
buildInputs = [ libasr libevent zlib openssl db pam ];
18
19
src = fetchurl {
20
url = "https://www.opensmtpd.org/archives/${name}.tar.gz";
21
-
sha256 = "1b4h64w45hpmfq5721smhg4s0shs64gbcjqjpx3fbiw4hz8bdy9a";
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())' \
···
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
10
}:
11
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 {
15
name = "opensmtpd-${version}";
16
+
version = "6.0.3p1";
17
18
nativeBuildInputs = [ autoconf automake libtool bison ];
19
buildInputs = [ libasr libevent zlib openssl db pam ];
20
21
src = fetchurl {
22
url = "https://www.opensmtpd.org/archives/${name}.tar.gz";
23
+
sha256 = "291881862888655565e8bbe3cfb743310f5dc0edb6fd28a889a9a547ad767a81";
24
};
25
26
patches = [ ./proc_path.diff ];
27
28
postPatch = with builtins; with lib;
0
0
0
29
optionalString unpriviledged_smtpctl_encrypt ''
30
substituteInPlace smtpd/smtpctl.c --replace \
31
'if (geteuid())' \
+6
-31
pkgs/servers/mail/opensmtpd/proc_path.diff
···
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)
6
-
{
7
-
struct filter_conf *f;
8
-
char *path;
9
-
+ const char *proc_path;
10
-
11
-
if (dict_get(&conf->sc_filters, name)) {
12
-
yyerror("filter \"%s\" already defined", name);
13
-
return (NULL);
14
-
}
15
-
16
-
- if (asprintf(&path, "%s/filter-%s", PATH_LIBEXEC, prog) == -1) {
17
-
+ proc_path = getenv("OPENSMTPD_PROC_PATH");
18
-
+ if (proc_path == NULL) {
19
-
+ proc_path = PATH_LIBEXEC;
20
-
+ }
21
-
+
22
-
+ if (asprintf(&path, "%s/filter-%s", proc_path, prog) == -1) {
23
-
yyerror("filter \"%s\" asprintf failed", name);
24
-
return (0);
25
-
}
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)
31
char path[PATH_MAX];
32
char name[PATH_MAX];
33
char *arg;
···
35
36
if (strlcpy(name, conf, sizeof(name)) >= sizeof(name)) {
37
log_warnx("warn: %s-proc: conf too long", key);
38
-
@@ -805,7 +806,12 @@ fork_proc_backend(const char *key, const char *conf, const char *procname)
39
if (arg)
40
*arg++ = '\0';
41
···
50
log_warn("warn: %s-proc: exec path too long", key);
51
return (-1);
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,
57
struct table_backend *tb;
58
char buf[LINE_MAX];
59
char path[LINE_MAX];
···
61
size_t n;
62
struct stat sb;
63
64
-
@@ -207,11 +208,16 @@ table_create(const char *backend, const char *name, const char *tag,
65
if (name && table_find(name, NULL))
66
fatalx("table_create: table \"%s\" already defined", name);
67
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
diff --git a/smtpd/smtpd.c b/smtpd/smtpd.c
2
+
index e049f07c..a1bd03a0 100644
3
--- a/smtpd/smtpd.c
4
+++ b/smtpd/smtpd.c
5
+
@@ -1157,6 +1157,7 @@ fork_proc_backend(const char *key, const char *conf, const char *procname)
6
char path[PATH_MAX];
7
char name[PATH_MAX];
8
char *arg;
···
10
11
if (strlcpy(name, conf, sizeof(name)) >= sizeof(name)) {
12
log_warnx("warn: %s-proc: conf too long", key);
13
+
@@ -1167,7 +1168,12 @@ fork_proc_backend(const char *key, const char *conf, const char *procname)
14
if (arg)
15
*arg++ = '\0';
16
···
25
log_warn("warn: %s-proc: exec path too long", key);
26
return (-1);
27
diff --git a/smtpd/table.c b/smtpd/table.c
28
+
index 9cfdfb99..24dfcca4 100644
29
--- a/smtpd/table.c
30
+++ b/smtpd/table.c
31
+
@@ -201,6 +201,7 @@ table_create(const char *backend, const char *name, const char *tag,
32
struct table_backend *tb;
33
char buf[LINE_MAX];
34
char path[LINE_MAX];
···
36
size_t n;
37
struct stat sb;
38
39
+
@@ -215,11 +216,16 @@ table_create(const char *backend, const char *name, const char *tag,
40
if (name && table_find(name, NULL))
41
fatalx("table_create: table \"%s\" already defined", name);
42