diff options
| -rw-r--r-- | sandbox.c | 9 |
1 files changed, 4 insertions, 5 deletions
| @@ -107,9 +107,9 @@ LL_BEGIN(sbox_enter_linux_, const char* basedir, const char *address, int smtp_p | |||
| 107 | 107 | ||
| 108 | void sbox_enter(const char *basedir) | 108 | void sbox_enter(const char *basedir) |
| 109 | { | 109 | { |
| 110 | const xs_val *v; | ||
| 111 | const char *errstr; | 110 | const char *errstr; |
| 112 | const char *address = xs_dict_get(srv_config, "address"); | 111 | const char *address = xs_dict_get(srv_config, "address"); |
| 112 | const char *smtp_url = xs_dict_get(srv_config, "smtp_url"); | ||
| 113 | int smtp_port = -1; | 113 | int smtp_port = -1; |
| 114 | 114 | ||
| 115 | if (xs_is_true(xs_dict_get(srv_config, "disable_sandbox"))) { | 115 | if (xs_is_true(xs_dict_get(srv_config, "disable_sandbox"))) { |
| @@ -117,11 +117,10 @@ void sbox_enter(const char *basedir) | |||
| 117 | return; | 117 | return; |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | if ((v = xs_dict_get(srv_config, "email_notifications")) && | 120 | if (xs_is_string(smtp_url) && *smtp_url != '\0') { |
| 121 | (v = xs_dict_get(v, "url"))) { | 121 | smtp_port = parse_port(smtp_url, &errstr); |
| 122 | smtp_port = parse_port((const char *)v, &errstr); | ||
| 123 | if (errstr) | 122 | if (errstr) |
| 124 | srv_debug(0, xs_fmt("Couldn't determine port from '%s': %s", (const char *)v, errstr)); | 123 | srv_debug(0, xs_fmt("Couldn't determine port from '%s': %s", smtp_url, errstr)); |
| 125 | } | 124 | } |
| 126 | 125 | ||
| 127 | if (sbox_enter_linux_(basedir, address, smtp_port) == 0) | 126 | if (sbox_enter_linux_(basedir, address, smtp_port) == 0) |