aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2025-06-04 06:35:39 +0200
committergrunfink <grunfink@comam.es>2025-06-04 06:35:39 +0200
commitc2cac572e9e51fc91296e0aa86ed3e165a75dd2d (patch)
treea65fbc8bb63094852ad75170ac54cd8099a45650
parentee35e7d78931759989e3329962dc1899e6b05f76 (diff)
Don't enable unveil() and pledge() for sendmail spawn if "smtp_url" is set.
-rw-r--r--sandbox.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sandbox.c b/sandbox.c
index 9e06155..a172f46 100644
--- a/sandbox.c
+++ b/sandbox.c
@@ -15,6 +15,11 @@ void sbox_enter(const char *basedir)
int smail = !xs_is_true(xs_dict_get(srv_config, "disable_email_notifications"));
+ const char *url = xs_dict_get(srv_config, "smtp_url");
+
+ if (xs_is_string(url) && *url)
+ smail = 0;
+
srv_debug(1, xs_fmt("Calling unveil()"));
unveil(basedir, "rwc");
unveil("/tmp", "rwc");