diff options
| author | 2025-04-27 05:23:39 +0200 | |
|---|---|---|
| committer | 2025-04-27 05:23:39 +0200 | |
| commit | aa15f84b34e51ae8121a8174ea68f105d295699c (patch) | |
| tree | e852e6fc34534b8fc2548357240a2eb4c5fef362 | |
| parent | Fixed memory leak. (diff) | |
| download | penes-snac2-aa15f84b34e51ae8121a8174ea68f105d295699c.tar.gz penes-snac2-aa15f84b34e51ae8121a8174ea68f105d295699c.tar.xz penes-snac2-aa15f84b34e51ae8121a8174ea68f105d295699c.zip | |
Changed server SMTP settings.
| -rw-r--r-- | activitypub.c | 15 |
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 | ||
| 37 | const char *susie_muertos = | 37 | const 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) | |||
| 2570 | int send_email(const xs_dict *mailinfo) | 2570 | int 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); |