diff options
| author | 2025-04-28 06:12:29 +0200 | |
|---|---|---|
| committer | 2025-04-28 06:12:29 +0200 | |
| commit | 8e467684c2d6960d64af9ea3de74ddb30d82302f (patch) | |
| tree | 256fa0a9c4acf03ace7944511874a110bcb9aaa2 | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | penes-snac2-8e467684c2d6960d64af9ea3de74ddb30d82302f.tar.gz penes-snac2-8e467684c2d6960d64af9ea3de74ddb30d82302f.tar.xz penes-snac2-8e467684c2d6960d64af9ea3de74ddb30d82302f.zip | |
Changed email notifications: use SMTP only if configured.
| -rw-r--r-- | activitypub.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activitypub.c b/activitypub.c index 92e408b..98ed6da 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -2570,7 +2570,10 @@ 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 | if (xs_is_true(xs_dict_get(srv_config, "spawn_sendmail"))) { | 2573 | const char *url = xs_dict_get(srv_config, "smtp_url"); |
| 2574 | |||
| 2575 | if (!xs_is_string(url) || *url == '\0') { | ||
| 2576 | /* revert back to old sendmail pipe behaviour */ | ||
| 2574 | const char *msg = xs_dict_get(mailinfo, "body"); | 2577 | const char *msg = xs_dict_get(mailinfo, "body"); |
| 2575 | FILE *f; | 2578 | FILE *f; |
| 2576 | int status; | 2579 | int status; |
| @@ -2599,7 +2602,6 @@ int send_email(const xs_dict *mailinfo) | |||
| 2599 | } | 2602 | } |
| 2600 | 2603 | ||
| 2601 | const char | 2604 | const char |
| 2602 | *url = xs_dict_get(srv_config, "smtp_url"), | ||
| 2603 | *user = xs_dict_get(srv_config, "smtp_username"), | 2605 | *user = xs_dict_get(srv_config, "smtp_username"), |
| 2604 | *pass = xs_dict_get(srv_config, "smtp_password"), | 2606 | *pass = xs_dict_get(srv_config, "smtp_password"), |
| 2605 | *from = xs_dict_get(mailinfo, "from"), | 2607 | *from = xs_dict_get(mailinfo, "from"), |