component email gateway: Add basic disco policy:

rel 460
This commit is contained in:
Goffi 2025-06-26 17:01:41 +02:00
commit 6c95b3bec8

View file

@ -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 []