commit aa15f84
grunfink
·
2025-04-27 03:23:39 +0000 UTC
parent 3dec740
Changed server SMTP settings.
1 files changed,
+9,
-6
+9,
-6
1@@ -34,7 +34,7 @@ const char *susie_cool =
2 "+ZcgN7wF7ZVihXkfSlWIVzIA6dbQzaygllpNuTX"
3 "ZmmFNlvxADX1+o0cUPMbAAAAAElFTkSuQmCC";
4
5-const char *susie_muertos =
6+const char *susie_muertos =
7 "iVBORw0KGgoAAAANSUhEUgAAAEAAAABAAQAAAAC"
8 "CEkxzAAAAV0lEQVQoz4XQsQ0AMQxCUW/A/lv+DT"
9 "ic6zGRolekIMyMELNp8PiCEw6Q4w4NoAt53IH5m"
10@@ -2570,14 +2570,17 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
11 int send_email(const xs_dict *mailinfo)
12 /* invoke curl */
13 {
14- const xs_dict *smtp_cfg = xs_dict_get(srv_config, "email_notifications");
15- const char
16- *url = xs_dict_get_def(smtp_cfg, "url", "smtp://localhost"),
17- *user = xs_dict_get(smtp_cfg, "username"),
18- *pass = xs_dict_get(smtp_cfg, "password"),
19+ const char
20+ *url = xs_dict_get(srv_config, "smtp_url"),
21+ *user = xs_dict_get(srv_config, "smtp_username"),
22+ *pass = xs_dict_get(srv_config, "smtp_password"),
23 *from = xs_dict_get(mailinfo, "from"),
24 *to = xs_dict_get(mailinfo, "to"),
25 *body = xs_dict_get(mailinfo, "body");
26+
27+ if (url == NULL || *url == '\0')
28+ url = "smtp://localhost";
29+
30 int smtp_port = parse_port(url, NULL);
31
32 return xs_smtp_request(url, user, pass, from, to, body, smtp_port == 465 || smtp_port == 587);