1diff --git a/smtpd/parse.y b/smtpd/parse.y
2index 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 }
26diff --git a/smtpd/smtpd.c b/smtpd/smtpd.c
27index 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;
34+ char *proc_path;
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
42- if (snprintf(path, sizeof(path), PATH_LIBEXEC "/%s-%s", key, name) >=
43+ proc_path = getenv("OPENSMTPD_PROC_PATH");
44+ if (proc_path == NULL) {
45+ proc_path = PATH_LIBEXEC;
46+ }
47+
48+ if (snprintf(path, sizeof(path), "%s/%s-%s", proc_path, key, name) >=
49 (ssize_t)sizeof(path)) {
50 log_warn("warn: %s-proc: exec path too long", key);
51 return (-1);
52diff --git a/smtpd/table.c b/smtpd/table.c
53index 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];
60+ const char *proc_path;
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
68+ proc_path = getenv("OPENSMTPD_PROC_PATH");
69+ if (proc_path == NULL) {
70+ proc_path = PATH_LIBEXEC;
71+ }
72+
73 if ((tb = table_backend_lookup(backend)) == NULL) {
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);
78+ if ((size_t)snprintf(path, sizeof(path), "%s/table-%s",
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");