commit 8e46768

grunfink  ·  2025-04-28 04:12:29 +0000 UTC
parent be796d6
Changed email notifications: use SMTP only if configured.
1 files changed,  +4, -2
+4, -2
 1@@ -2570,7 +2570,10 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
 2 int send_email(const xs_dict *mailinfo)
 3 /* invoke curl */
 4 {
 5-    if (xs_is_true(xs_dict_get(srv_config, "spawn_sendmail"))) {
 6+    const char *url = xs_dict_get(srv_config, "smtp_url");
 7+
 8+    if (!xs_is_string(url) || *url == '\0') {
 9+        /* revert back to old sendmail pipe behaviour */
10         const char *msg = xs_dict_get(mailinfo, "body");
11         FILE *f;
12         int status;
13@@ -2599,7 +2602,6 @@ int send_email(const xs_dict *mailinfo)
14     }
15 
16     const char
17-        *url  = xs_dict_get(srv_config, "smtp_url"),
18         *user = xs_dict_get(srv_config, "smtp_username"),
19         *pass = xs_dict_get(srv_config, "smtp_password"),
20         *from = xs_dict_get(mailinfo, "from"),