From 3d96c576287736ebdf87e4a7b956842a6c6e055f Mon Sep 17 00:00:00 2001 From: shtrophic Date: Fri, 24 Jan 2025 22:24:05 +0100 Subject: enforce tls when supported && add tests --- activitypub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activitypub.c') diff --git a/activitypub.c b/activitypub.c index 4cb779a..f3b2bae 100644 --- a/activitypub.c +++ b/activitypub.c @@ -2538,8 +2538,9 @@ int send_email(const xs_dict *mailinfo) *from = xs_dict_get(mailinfo, "from"), *to = xs_dict_get(mailinfo, "to"), *body = xs_dict_get(mailinfo, "body"); + int smtp_port = parse_port(url, NULL); - return xs_smtp_request(url, user, pass, from, to, body); + return xs_smtp_request(url, user, pass, from, to, body, smtp_port == 465 || smtp_port == 587); } -- cgit v1.2.3