Commit graph

4,350 commits

Author SHA1 Message Date
Goffi
2a0f4e28f8 component email gateway: convert autocrypt header:
Autocrypt header must be transmitted in both directions to allow opportunistic end-to-end
encryption with this protocol.

Moved email validation regex to `tools/common/regex.py`, as it can be used in other
locations.

rel 456
2025-02-28 09:23:35 +01:00
Goffi
5681435532 plugin XEP-0131: update triggers priority + add headers to MessageDataExtra:
- Lower priority is used for triggers so other plugins can add headers before the XML is
  generated.
- Added `headers` to `MessageDataExtra` type.

rel 456
2025-02-28 09:23:35 +01:00
Goffi
55e4d0bc48 doc (component): document use of Gateway Relayed Encryption:
fix 455
2025-01-13 01:23:22 +01:00
Goffi
906ade1894 component email gateway: implement Gateway Relayed Encryption:
MIME and OpenPGP are used.

rel 455
2025-01-13 01:23:22 +01:00
Goffi
ea6ecb3c91 plugin gre encrypter: implement GRE Encrypter: OpenPGP:
rel 455
2025-01-13 01:23:22 +01:00
Goffi
a76a9d9e23 plugin GRE formatter MIME: implements GRE Formatter: MIME:
rel 455
2025-01-13 01:23:22 +01:00
Goffi
bbebdc6f94 plugin GRE: implements Gateway Relayed Encryption:
rel 455
2025-01-13 01:23:22 +01:00
Goffi
759ffc443b plugin XEP-0050: fix allowed_magics arg and calls to add_ad_hoc_command. 2025-01-13 01:23:22 +01:00
Goffi
54654b65ed core (types): improve SatXMPPEntity core type and type hints. 2025-01-13 01:23:10 +01:00
Povilas Kanapickas
4326d01956 remove uses of twisted.internet.defer.returnValue
This function has been deprecated in Twisted 24.7.0.
2024-12-11 01:17:09 +02:00
Goffi
67208fb87e doc (components): Update Email Gateway documentation:
A section has been added to explain how attachments are handled.

fix 453
2024-12-03 00:53:18 +01:00
Goffi
b7f4202a78 tests (unit/email gateway): add tests for pubsub service:
rel 453
2024-12-03 00:52:06 +01:00
Goffi
edad2c1064 component email gateway: Add a pubsub service:
a pubsub service is implemented to retrieve and manage attachments using XEP-0498.

rel 453
2024-12-03 00:13:23 +01:00
Goffi
9d5de6b61b component email gateway: attachments handling:
attachments are now stored, and metadata are created in database.

rel 453
2024-12-03 00:13:23 +01:00
Goffi
ef49768c31 plugin XEP-0498: "Pubsub File Sharing" implementation:
Partial implementation of XEP-0498, necessary to implement the service part in email
gateway.

rel 453
2024-12-03 00:13:23 +01:00
Goffi
7509323137 plugin XEP-0358: "Publishing Available Jingle Sessions" implementation:
rel 453
2024-12-03 00:13:07 +01:00
Goffi
319c607f39 plugins XEP-0300, XEP-0446, XEP-0447, XEP0448 and others: Refactoring to use Pydantic:
Pydantic models are used more and more in Libervia, for the bridge API, and also to
convert `domish.Element` to internal representation.

Type hints have also been added in many places.

rel 453
2024-12-03 00:12:38 +01:00
Goffi
1f3c6f0329 core (main): Let plugins have several handlers + various improvements:
`get_handler` can now return several handlers, which is notably useful for component with
several included services.

Various improvements such move to `async` method, docstring/type hints update, and slight
improvment of SatXMPPComponent.

rel 453
2024-12-03 00:11:00 +01:00
Syndace
1ec2b29854 XEP-0373 (OX): Adjust to gpgme updates: generate with explicit algorithm and subkeys 2024-07-13 18:28:28 +02:00
Goffi
e161ff2d57 plugin URI finder: make the regex ignore case. 2024-11-20 15:29:47 +01:00
Goffi
534dd0163c README: Put tickets and MR data on a single line:
if the line is cut, the regex from `plugin_misc_uri_finder` won't work.
2024-11-20 15:29:16 +01:00
Goffi
254554de99 plugin blog import dotclear: repalce deprecated cgi by html 2024-11-20 14:35:09 +01:00
Goffi
33edd87271 doc (cli/bookmarks): move old bookmarks doc to bookmarks_legacy, and add new bookmarks doc. 2024-11-20 11:49:46 +01:00
Goffi
06a1eef720 plugin XEP-0048, XEP-0402; CLI (bookmarks): implement XEP-0402 (PEP Native Bookmarks):
- Former bookmarks implementation is now labeled as "legacy".
- XEP-0402 is now used for bookmarks when relevant namespaces are found, and it fallbacks
  to legacy XEP-0048/XEP-0049 bookmarks otherwise.
- CLI legacy bookmark commands have been moved to `bookmarks legacy`
- CLI bookmarks commands now use the new XEP-0402 (with fallback to legacy one
  automatically used if necessary).
2024-11-20 11:43:27 +01:00
Goffi
0c27fef2ac cli (output/std): use rich to output JSON. 2024-11-20 11:38:44 +01:00
Goffi
8443ddac65 plugin text syntaxes: update exception message to be more explicit when lxml_html_clean is missing. 2024-11-20 11:30:43 +01:00
Goffi
9173aa104e core (models/types): add types for domish.Element. 2024-11-20 11:29:36 +01:00
Goffi
f1e1793cad core (memory/params): set default resource priority to 0:
Priority was historically set to 50 to follow behaviour of other clients at the time, but
it's nowadays a legacy feature, and a non zero value can cause trouble if message carbon
is not used.
2024-11-20 11:28:23 +01:00
Goffi
da51288c7a tools (common/template), cli (call/gui): use font-awesome instead of fontello:
following change in Libervia Media, code has been updated to use font-awesome now instead
of fontello.
2024-10-26 22:42:17 +02:00
Goffi
91447d0c88 tests (unit): fix tests:
- test_ap-gateway: fix missing implementation of `client.is_local`
- test_plugin_xep_0215: fix missing return value of `has_feature`
2024-09-30 14:15:47 +02:00
Goffi
b9088dff79 plugin XEP-0215, XEP-0376: fix bad calls to hasFeature:
`hasFeature` was called like blocking code, missing the `await`. This has been fixed, and
is now using the `memory.disco.has_feature` version.
2024-09-30 14:14:38 +02:00
Goffi
3a5f1b5cd4 doc (components): update doc to show headers support:
fix 451
2024-09-28 16:00:16 +02:00
Goffi
03e1357401 tests (unit/email gateway): add test for XEP-0131 handling:
rel 451
2024-09-28 15:59:48 +02:00
Goffi
08cd3fd587 component email gateway: Add support for XEP-0131 headers:
Some email headers (`Keywords` and `Importance` for now) are converted between XMPP and
email.

rel 451
2024-09-28 15:59:12 +02:00
Goffi
5ccec8f755 cli (message/send): add arguments to send keywords and headers:
rel 451
2024-09-28 15:57:31 +02:00
Goffi
5226323cae tests (unit): add XEP-0131 tests:
rel 451
2024-09-28 15:57:03 +02:00
Goffi
80ec968740 plugin XEP-0131: Stanza Headers and Internet Metadata implementation:
- SHIM is now supported and put in `msg_data["extra"]["headers"]`.
- `Keywords` are converted from and to list of string in `msg_data["extra"]["keywords"]`
field (if present in headers on message sending, values are merged).
- Python minimal version upgraded to 3.11 due to use of `StrEnum`.

rel 451
2024-09-28 15:56:04 +02:00
Goffi
bf0515378a plugin XEP-0033: formatting. 2024-09-28 15:52:14 +02:00
Goffi
03f8421e84 doc (components): update doc to indicate support of addressing metadata.
fix 450
2024-09-26 16:12:01 +02:00
Goffi
c1ed8306ae doc (cli/message): add documentation for new addressing commands:
rel 450
2024-09-26 16:12:01 +02:00
Goffi
a81612f0f1 test (unit): add test for email gateway:
rel 450
2024-09-26 16:12:01 +02:00
Goffi
15b29444a7 component email gateway: add multicasting:
XEP-0033 multicasting is now supported both for incoming and outgoing messages. XEP-0033
metadata are converted to suitable Email headers and vice versa.
Email address and JID are both supported, and delivery is done by the gateway when
suitable on incoming messages.

rel 450
2024-09-26 16:12:01 +02:00
Goffi
ba8ba26636 cli (message/send): add arguments for message addressing:
commands have been added to add `to`, `cc` and `bcc` metadata for sending copy of the
message to several entities. Metadata such as `reply-to` `reply-room` and `no-reply` are
also supported.

rel 450
2024-09-26 16:12:01 +02:00
Goffi
49a1cfe974 test (unit): add test for plugin XEP-0033:
those replace the legacy XEP-0033 test from libervia/backend/test/test_plugin_xep_0033.py.

rel 450
2024-09-26 16:12:01 +02:00
Goffi
489eed2540 plugin XEP-0033: code modernisation, improve delivery, data validation:
- Code has been rewritten using Pydantic models and `async` coroutines for data validation
  and cleaner element parsing/generation.
- Delivery has been completely rewritten. It now works even if server doesn't support
  multicast, and send to local multicast service first. Delivering to local multicast
  service first is due to bad support of XEP-0033 in server (notably Prosody which has an
  incomplete implementation), and the current impossibility to detect if a sub-domain
  service handles fully multicast or only for local domains. This is a workaround to have
  a good balance between backward compatilibity and use of bandwith, and to make it work
  with the incoming email gateway implementation (the gateway will only deliver to
  entities of its own domain).
- disco feature checking now uses `async` corountines. `host` implementation still use
  Deferred return values for compatibility with legacy code.

rel 450
2024-09-26 16:12:01 +02:00
Goffi
5005ca346b tests: reformat tests using black. 2024-09-26 16:11:56 +02:00
Goffi
42263d05f9 doc (components): new Email gateway documentation:
fix 449
2024-09-06 18:07:44 +02:00
Goffi
73a08f5c91 component email-gateway: first draft:
Initial implementation of the Email Gateway.

This component uses XEP-0100 for registration. Upon registration and subsequent startups,
a connection is made to registered IMAP services, and incoming emails (in `INBOX`
mailboxes) are immediately forwarded as XMPP messages.

In the opposite direction, an SMTP connection is established to send emails on incoming
XMPP messages.

rel 449
2024-09-06 18:07:17 +02:00
Goffi
cf0363a3af doc (cli): documentation for new gateway command:
rel 449
2024-09-06 18:03:36 +02:00
Goffi
057a8ebadf CLI: add commands to handle gateways:
rel 449
2024-09-06 18:03:01 +02:00