Commit Graph
89 Commits
Author SHA1 Message Date
jbpenrath db7631fd67 👽️(openapi) fix thread access serializer type and update schema and api
The `accesses` property into the Thread object was not propertly typed so we
update the serializer to fix the type by using dedicated sub serializers then we
run `make api-update` to update schema and api client.
2025-05-26 15:54:37 +02:00
jbpenrath e4c67558e3 👽️(api) complete openapi schema and regenerate
Improve the description of the blob api endpoint then regenerate
schema and client api through `make api-update`. Furthermore we
also update FetchApi interface to manage boundary multipart content type
2025-05-22 15:59:17 +02:00
Jean-Baptiste PENRATHandGitHub 7ddcc668f3 💚(ci) add job check-api-state (#111)
Add a job to ensure that api schema and client
are up-to-date.
2025-05-21 22:22:27 +02:00
Sylvain ZimmerandGitHub 3259eb07a6 ✨(admin) add maildomainaccess model, api route and backend tests (#102)
* ✨(admin) add maildomainacess model, api route and backend tests

* ♻️(drf) simplify API code
2025-05-21 22:21:45 +02:00
Sabrina Demagny 3e98509dcc ✨(api) add endpoint to search Mailboxes
Allow to search Mailboxes from same domain of a context Mailbox.
2025-05-20 01:25:49 +02:00
Sabrina Demagny 7d8500ac22 ✨(backend) link a Mailbox to a Contact instance
Add FK to Contact on Mailbox model.
Display name of mailbox contact into list accesses of a thread
2025-05-19 20:24:22 +02:00
Sabrina Demagny 2c2eb3a39b Revert "✨(backend) enhance Mailbox model to add a display name"
This reverts commit c5d1ee220e.
2025-05-19 14:45:26 +02:00
Sabrina Demagny c5d1ee220e ✨(backend) enhance Mailbox model to add a display name
Add an optional name field
2025-05-19 13:04:26 +02:00
Sabrina Demagny 65db4fddad ✨(api) enhance Thread serializer to return thread accesses
Add list of thread accesses into Thread serializer
2025-05-19 12:55:05 +02:00
jbpenrath c61ba946fa 👽️(api) add thread_id property to Message resource
Frontend needs to be able to retrieve the thread_id of a message
so we tweak the MessageSerializer to bind this information. Then we run
`make api-update` to update api schema and client.
2025-05-19 11:16:03 +02:00
Sabrina Demagny eca469e666 ✨(api) add endpoint to manage ThreadAccess
Allows creating, updating, and deleting access to threads based on
user role.
2025-05-16 12:18:14 +02:00
Sylvain ZimmerandGitHub 87a949d4d2 ✨(attach) add initial attachments support in in/outbound & api (#93) 2025-05-15 13:45:52 +02:00
Sabrina Demagny a99b2a0fae 🐛(backend) fix bcc lost after updated draft
Enhance and fix check to allow bcc displaying. Fix #85
2025-05-14 20:35:49 +02:00
Sabrina Demagny 11ffc48ead 🐛(backend) update thread stats after message hard delete
Call update_stats after delete one of thread's messages. Fixes #84.
2025-05-14 18:16:10 +02:00
jbpenrath 37d689bcb0 ✨(frontend) add search input in the header
Allow the user to search in their email through a search input
2025-05-14 16:58:43 +02:00
jbpenrath a6427059ca 👔(frontend) manage QueueMessage timeout
Previously we expect the task retrieve endpoint could return a 404 when a task
does not exist but it is not possible (dce87f8) so instead we put a timeout to
stop to poll the task after a given delay.
2025-05-14 09:54:41 +02:00
Sylvain Zimmer dce87f864f ✅(task) add test for task API and confirm unkown task behaviour
According to Celery's author here:
https://github.com/celery/celery/issues/3596#issuecomment-262102185

There is no way to check if a task ID exists. It will just return
"PENDING" indefinitely. Add tests for this accordingly.

Closes #91
2025-05-13 23:14:57 +02:00
jbpenrath a79cfde5c4 👽️(api) update schema and api client
Fix task api schema (use enum for `status`) then run `make api-update`
2025-05-13 17:28:21 +02:00
Sylvain ZimmerandGitHub 1f4047a061 ✨(celery) add Celery worker, search, recipient statuses, better build (#88)
Before, sending was done synchronously on the api/send POST call. Now
we just build the MIME message and mark the message for sending, and
queue the actual SMTP (or internal) sending for the worker. We use
this opportunity to add fine-grained delivery statuses for each
recipient, something that traditional email systems are unable to do!

Expanding on that, this (too large) PR adds an initial Elasticsearch
index of threads. It also overhauls the build and CI system, using
Poetry instead of Pip.
2025-05-13 00:52:48 +02:00
Sabrina DemagnyandGitHub 84f95bf52a ✨(backend) use ThreadAccess instead of direct mailbox link (#80)
* ✨(backend) use ThreadAccess instead of direct mailbox link

Remove the direct link to a mailbox on Thread model. It is now possible to
define two types of roles for each thread (Reader and Editor) for a mailbox.
When creating a new thread, a new access to the sender's mailbox is created
with the Editor role.
It is now possible to delegate a thread to another mailbox with the Reader or
Editor role. So it is possible to forward a thread to another internal user
and avoid mail forwarding.

* ✨(backend) change MailboxAccess permission into roles

Enhance access on mailbox and thread with role everywhere!

* improve doc

* enhance tests

* lint
2025-05-12 21:29:06 +02:00
jbpenrath f99b6f2a66 👽️(api) update schema and api client
Fix thread stats api schema (use enum for `stats_fields`)
 then run `make api-update`
2025-05-12 16:30:37 +02:00
jbpenrath b83a6ef631 ✨(frontend) use dynamic views through thread counters
The api allows us to filter threads through filters. We are using this new
feature to build dynamic folders (All threads, Drafts, Send and Trash).
Furthermore we update the MessageForm logic to stick with the new draft
logic (First create a draft message then send the message)
2025-04-30 22:06:29 +02:00
jbpenrath 715f040123 👽️(api) update schema and api client
Run `make api-update`
2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 869ec6187a ✨(api) add parent_id in message serializer 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 2b02f88161 ✨(mda) differentiate local and external delivery of messages 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 5bad9de255 ✨(threads) add new api/thread/stats/ route 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 81a8718cc5 🐛(drafts) add draftBody in message view 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH fed2d52c72 ♻️(thread) continue improving thread stats 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 134470e16b ♻️(flags) change IDs format to use post body JSON 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH ef5bd60509 💡(delete) restore commented bulk_delete, to be discussed 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH baa6ff8964 🚨(lint) fix lint 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH bf3df3a658 ✨(api) add threads.count_messages and messaged_at 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 17b86ad5db ♻️(flags) refactor "read" and "thread.delete" feature in a single flag route 2025-04-30 22:06:29 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 183d152f2c ♻️(mda) refactor large parts of the MDA with thinner views 2025-04-30 22:06:29 +02:00
Sabrina DemagnyandJean-Baptiste PENRATH 54fa808bb1 wip 2025-04-30 22:06:29 +02:00
Sabrina DemagnyandJean-Baptiste PENRATH 3df94cd80f ✨(api) add draftBody 2025-04-30 22:06:29 +02:00
Sabrina DemagnyandJean-Baptiste PENRATH 9d72a787b7 ✨(backend) allow to create draft message then send it
Add flag for draft message.
Split API view to create draft message, update it then allow to
send it.
2025-04-30 22:06:29 +02:00
jbpenrath b40497ce0b 👽️(api) update schema and api client
Run `make api-update`
2025-04-28 19:36:18 +02:00
jbpenrath eb3ac46b83 🐛(backend) fix ThreadViewset list ordering
We are ordering threads list by message creation date.
The current queryset was ordering on all thread messages so if a thread
had the two latest message it was returned twice in the queryset.
Instead we annotate the queryset with the latest message creation date
 for each thread then order threads through this property
2025-04-28 15:33:15 +02:00
Sabrina Demagny 4abc817628 ✨(api) allow to delete a batch of threads
Add an endpoint to allow deleting a list of threads by passing a
list of thread IDs.
2025-04-28 02:44:23 +02:00
Sabrina Demagny 301680d744 ✨(api) allow to delete thread
A thread can be delete with its messages
2025-04-28 01:02:07 +02:00
Sabrina Demagny 2de5699b4e ✨(api) allow to delete message
Allow to delete message and if the message is the last of a thread,
delete the thread too.
2025-04-28 00:29:01 +02:00
Sabrina Demagny 9c66c895ea 🐛(api) change the display order of threads
Display thread by last created message first.
2025-04-25 12:28:27 +02:00
Sabrina Demagny 207ffe47f3 ✨(api) messages in a thread display the oldest first
Change the display order of messages in a thread.
2025-04-24 19:37:27 +02:00
Sabrina Demagny 55d71f1b67 🐛(api) fix /threads endpoint
Return only mailbox thread if mailbox_id is given
2025-04-24 12:43:25 +02:00
Sylvain ZimmerandGitHub 58226a7822 ✨(threads) implement better threading algorithm (#53)
* 🚧(threads) implement first threading algorithm

* ✨(threads) improve threading algorithm and add tests
2025-04-23 19:53:43 +02:00
Sabrina Demagny 64a3f8cc3a ✨(backend) enhance Contact model
Add owner field to link Contact to a mailbox.
Remove now useless user field.
2025-04-23 17:05:05 +02:00
Sylvain Zimmer d2176559ce 🔒️(rfc5322) use longer Message-IDs 2025-04-23 01:55:56 +02:00
Sylvain Zimmer bbedb394dd ✨(rfc5322) generate unique Message-IDs 2025-04-23 01:19:19 +02:00
Sylvain Zimmer 5bdc8ccf48 🐛(dkim) fix invalid DKIM signature and add verify test
There was an extra \r\n added, that broke validation. We now test
the source of the received message on the mailcatcher, and validate
that DKIM header. Should be much more robust even if it adds a new
dependency for tests.
2025-04-23 00:19:20 +02:00