commit aa15f84b34e51ae8121a8174ea68f105d295699c
parent 3dec7404bf59397452f3cc32fdf33b379f2546fc
Author: grunfink <grunfink@comam.es>
Date: Sun, 27 Apr 2025 05:23:39 +0200
Changed server SMTP settings.
Diffstat:
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/activitypub.c b/activitypub.c
@@ -34,7 +34,7 @@ const char *susie_cool =
"+ZcgN7wF7ZVihXkfSlWIVzIA6dbQzaygllpNuTX"
"ZmmFNlvxADX1+o0cUPMbAAAAAElFTkSuQmCC";
-const char *susie_muertos =
+const char *susie_muertos =
"iVBORw0KGgoAAAANSUhEUgAAAEAAAABAAQAAAAC"
"CEkxzAAAAV0lEQVQoz4XQsQ0AMQxCUW/A/lv+DT"
"ic6zGRolekIMyMELNp8PiCEw6Q4w4NoAt53IH5m"
@@ -2570,14 +2570,17 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
int send_email(const xs_dict *mailinfo)
/* invoke curl */
{
- const xs_dict *smtp_cfg = xs_dict_get(srv_config, "email_notifications");
- const char
- *url = xs_dict_get_def(smtp_cfg, "url", "smtp://localhost"),
- *user = xs_dict_get(smtp_cfg, "username"),
- *pass = xs_dict_get(smtp_cfg, "password"),
+ const char
+ *url = xs_dict_get(srv_config, "smtp_url"),
+ *user = xs_dict_get(srv_config, "smtp_username"),
+ *pass = xs_dict_get(srv_config, "smtp_password"),
*from = xs_dict_get(mailinfo, "from"),
*to = xs_dict_get(mailinfo, "to"),
*body = xs_dict_get(mailinfo, "body");
+
+ if (url == NULL || *url == '\0')
+ url = "smtp://localhost";
+
int smtp_port = parse_port(url, NULL);
return xs_smtp_request(url, user, pass, from, to, body, smtp_port == 465 || smtp_port == 587);