From 6c95b3bec82fb3170e99f4121a8c9d879d11f13e Mon Sep 17 00:00:00 2001 From: Goffi Date: Thu, 26 Jun 2025 17:01:41 +0200 Subject: [PATCH] component email gateway: Add basic disco policy: rel 460 --- .../plugin_comp_email_gateway/__init__.py | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/libervia/backend/plugins/plugin_comp_email_gateway/__init__.py b/libervia/backend/plugins/plugin_comp_email_gateway/__init__.py index b0b270de..fa42bdb3 100644 --- a/libervia/backend/plugins/plugin_comp_email_gateway/__init__.py +++ b/libervia/backend/plugins/plugin_comp_email_gateway/__init__.py @@ -1090,7 +1090,49 @@ class EmailGatewayComponent(GetDataHandler): class EmailGatewayHandler(XMPPHandler): def getDiscoInfo(self, requestor, target, nodeIdentifier=""): - return [] + return [ + data_form.Form( + "result", + formNamespace="urn:xmpp:data-policy:0", + fields=( + data_form.Field( + "list-single", + "auth_data", + "plain" + ), + data_form.Field( + "list-single", + "data-transmission", + "encrypted" + + ), + data_form.Field( + "text-single", + "encryption_algorithm", + "TLS" + + ), + data_form.Field( + "text-single", + "data_retention", + "0", + + ), + ), + ), + data_form.Form( + "result", + formNamespace="urn:xmpp:data-policy:identity:gateway:smtp:0", + fields=( + data_form.Field( + "text-multi", + "extra_info", + "This gateway acts as a relay to external IMAP/SMTP servers. Data policies depend entirely on the external server chosen by the user. This gateway does not store or process user data.", + + ), + ), + ), + ] def getDiscoItems(self, requestor, target, nodeIdentifier=""): return []