summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--activitypub.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/activitypub.c b/activitypub.c
index 10e5776..fd2d81a 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -34,7 +34,7 @@ const char *susie_cool =
34 "+ZcgN7wF7ZVihXkfSlWIVzIA6dbQzaygllpNuTX" 34 "+ZcgN7wF7ZVihXkfSlWIVzIA6dbQzaygllpNuTX"
35 "ZmmFNlvxADX1+o0cUPMbAAAAAElFTkSuQmCC"; 35 "ZmmFNlvxADX1+o0cUPMbAAAAAElFTkSuQmCC";
36 36
37const char *susie_muertos = 37const char *susie_muertos =
38 "iVBORw0KGgoAAAANSUhEUgAAAEAAAABAAQAAAAC" 38 "iVBORw0KGgoAAAANSUhEUgAAAEAAAABAAQAAAAC"
39 "CEkxzAAAAV0lEQVQoz4XQsQ0AMQxCUW/A/lv+DT" 39 "CEkxzAAAAV0lEQVQoz4XQsQ0AMQxCUW/A/lv+DT"
40 "ic6zGRolekIMyMELNp8PiCEw6Q4w4NoAt53IH5m" 40 "ic6zGRolekIMyMELNp8PiCEw6Q4w4NoAt53IH5m"
@@ -2570,14 +2570,17 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
2570int send_email(const xs_dict *mailinfo) 2570int send_email(const xs_dict *mailinfo)
2571/* invoke curl */ 2571/* invoke curl */
2572{ 2572{
2573 const xs_dict *smtp_cfg = xs_dict_get(srv_config, "email_notifications"); 2573 const char
2574 const char 2574 *url = xs_dict_get(srv_config, "smtp_url"),
2575 *url = xs_dict_get_def(smtp_cfg, "url", "smtp://localhost"), 2575 *user = xs_dict_get(srv_config, "smtp_username"),
2576 *user = xs_dict_get(smtp_cfg, "username"), 2576 *pass = xs_dict_get(srv_config, "smtp_password"),
2577 *pass = xs_dict_get(smtp_cfg, "password"),
2578 *from = xs_dict_get(mailinfo, "from"), 2577 *from = xs_dict_get(mailinfo, "from"),
2579 *to = xs_dict_get(mailinfo, "to"), 2578 *to = xs_dict_get(mailinfo, "to"),
2580 *body = xs_dict_get(mailinfo, "body"); 2579 *body = xs_dict_get(mailinfo, "body");
2580
2581 if (url == NULL || *url == '\0')
2582 url = "smtp://localhost";
2583
2581 int smtp_port = parse_port(url, NULL); 2584 int smtp_port = parse_port(url, NULL);
2582 2585
2583 return xs_smtp_request(url, user, pass, from, to, body, smtp_port == 465 || smtp_port == 587); 2586 return xs_smtp_request(url, user, pass, from, to, body, smtp_port == 465 || smtp_port == 587);