Commit Graph
46 Commits
Author SHA1 Message Date
jbpenrath c7dbb73ccc ✨(backend) add new endpoint to reset password
Add a new admin endpoint to reset user password if
domain oidc sync is enabled.
2025-09-16 17:02:44 +02:00
Stanislas Bruhiere 647abfb2eb 🚨(backend) run make api-update 2025-09-04 17:16:29 +02:00
Stanislas BruhièreandGitHub 02bce211ea ✨(frontend) add a button and modal to create maildomains (#313)
* ✨(feat) create modal, serializer and add button

* ✨(frontend) refetch on domain creation

* 🚨(frontend) fix linter

* ✅(backend) add domain creation test

* ✨(frontend) add toaster for domain creation

* 💬(frontend) add translation and fix small typo

* ✨(front+back) add custom_attributes on domain creation

* 💄(frontend) add style for create domain modal

* 💬(frontend) add missing translations + add end of file line breaks

* 🎨(frontend) move toaster to admin layout

* 🦺(frontend) validate domain name in frontend

* 💄(frontend) remove unused css

* ✅(backend) add more tests

* 🎨(backend) improve maildomain structure

* 🎨(frontend) follow nitpicks
2025-09-02 20:13:11 +02:00
Sabrina Demagny 67a7c4e9c0 ✨(api) add placeholders endpoint
This endpoint will be used for Signature and other message templates.
Update Dockerfile to include gettext for i18n compilation
2025-08-20 12:10:16 +02:00
Fabian ArfireandJean-Baptiste PENRATH cdb4e207e5 ✨(backend) add auto labelling ai feature
When a message is received, if the auto labelling feature is enabled,
we try to add all relevant labels that are flagged for auto labelling to this
message.

Co-authored-by: jbpenrath <jb.penrath@gmail.com>
2025-08-19 23:48:03 +02:00
jbpenrath 53110862d6 ✨(front) manage abilities
Improve openapi schema to pass abilities to frontend properly.
Then through the useAbility hook, hide/disable actions.
It concerns actions to send messages, write messages, share
thread access, crud labels, crud maildomain mailboxes.
2025-08-07 10:39:23 +02:00
jbpenrath d0b2a66f08 🐛(frontend) draftBody can be null
There was an error in the openapi schema and we are not aware that
message.draftBody could be null so when it was the case, the frontend
throws an error when rendering the `MessageForm` component.
2025-08-06 10:12:36 +02:00
jbpenrath 4a311e5b3c ✨(backend) define custom_attributes through env vars json schema string
User and MailDomain have both `custom_attributes` json field. Those fields
aims to store extra data about those models specific to an instance. In order
to fulfill those fields with consistency and without requiring to fork the
project, we add two new settings `SCHEMA_CUSTOM_ATTRIBUTES_*`.
Those 2 settings expects a JSON Schema string defined through env vars.
Then on model save, those schema are used to validate data saved into
custom attributes.
2025-08-06 10:12:36 +02:00
jbpenrath 7c07711489 👽️(openapi) improve user definition with or without abilities
The OpenAPI Schema does not embedded abilities property.
We fix that and make two serializers for User model in order to get proper
openapi definition for User instance with abilities and without abilities.
2025-07-31 17:19:23 +02:00
jbpenrath a56ca6b113 ✨(backend) add settings to configure drive external service
We want to add ability to Messages to interop with our Drive application.
First, we want to be able to set the Drive base url through environment
variable then pass down Drive configuration to frontend through the config
api endpoint.

https://github.com/suitenumerique/drive
2025-07-30 13:57:04 +02:00
Sabrina Demagny c7fb77b737 ✨(frontend) remove max_messages and folder fields on imap import
Run 'make api-update'
2025-07-28 11:18:28 +02:00
Mathis ROUGETandJean-Baptiste PENRATH e08acda852 ✨(ai) setup ai service 2025-07-24 11:45:07 +02:00
Sylvain ZimmerandGitHub 9b4ba9ba09 ✨(dns) add admin page for DNS records (#283)
* ✨(dns) add admin page for DNS records. Fixes #177

* 👷(dockerflow) add a flag to disable Dockerflow

* 💚(ghactions) fix check-api-update that was missing Orval

* 💚(ci) fix tests that depended on Keycloak

* ♻️(admin) refactor CopyableInput into a separate component

* 🎨(dns) improve code style
2025-07-21 14:41:08 +02:00
Sylvain ZimmerandGitHub cc858e75e4 ✨(admin) improve Admin mailbox management page (#284)
This fixes a few small anoyances and adds a new field Mailbox.is_identity
to the models so that we can save what type of mailbox the admin created.
2025-07-21 10:47:06 +02:00
jbpenrath 0c79a169aa 🔊(front) setup posthog
Setup posthog and create a feedback button that is displayed
if a posthog survey id is provided through envvars
2025-07-16 22:22:25 +02:00
jbpenrath 7bd5a42e38 🏷️(openapi) types properly the ConfigViewset
Decorate ConfigViewset to be typed properly then regenerate
openapi schema and client.
2025-07-16 22:22:25 +02:00
jbpenrath 97c55bd7f0 🏷️(global) fix openapi schema and typescript types
Enhance the `IntegerChoicesField` to be well interpreted by drf
spectacular to generate a clean OpenAPI Schema then fix Typescript
issues once the api types have been fixed.
2025-07-16 15:04:26 +02:00
jbpenrath 3c8bb9f6a3 👽️(api) update openapi schema and api client
Run `make api-update`
2025-07-10 18:05:00 +02:00
jbpenrathandSylvain Zimmer 0c44e7803a ✨(backend) complete admin maildomain api
- Create user (if needed) and mailbox access on mailbox creation
- If identify provider is keycloak, generate a one time password
at mailbox creation
- At nested endpoint to search users related to a maildomain

Co-authored-by: Sylvain Zimmer <sylvain@sylvainzimmer.com>
2025-07-10 18:05:00 +02:00
jbpenrath 6beac632b6 ✨(front) list labels in left panel and allow to edit them
Load and display labels in left panel. Add also a modal to
create/edit/delete labels.
2025-06-20 00:58:11 +02:00
jbpenrath 95f78e4a02 ✨(front) upload mailbox archive as blob
To import old messages from an archive we must now upload the archive file
as a blob then provide the blobId to endpoint to import messages.
2025-06-20 00:13:50 +02:00
jbpenrath e263c56450 ♻️(frontend) update thread stats and thread panel after api refactoring
We recently refactor the way we process thread stats and the filters to list
threads. We have to update the front to work with this new behavior.
2025-06-19 02:05:41 +02:00
jbpenrath 0d4e4f3536 💄(front) clean a little bit label badges
We recently display label badges into thread-item. We revamp that
a little bit to improve code structure and prepare the layout
for further improvements.
2025-06-19 02:05:41 +02:00
Sabrina Demagny ad179ee258 ✨(api) allow to list threads by label
Add the ability to filter threads by label slug in the thread list endpoint. This feature
enables users to view all threads associated with a specific label.

Changes:
- Add label_slug query parameter to ThreadViewSet list endpoint
- Implement label-based filtering with proper permission checks
- Add OpenAPI documentation for the new label_id parameter
- Add comprehensive test suite for label filtering

Technical details:
- Filter threads by label while ensuring user has access to the label's mailbox
- Support combining label filter with existing filters (mailbox, search, etc.)
- Add proper error handling for invalid or inaccessible labels
- Add test coverage for various filtering scenarios:
  - Single label filtering
  - Combined label and mailbox filtering
  - Invalid label handling
  - Permission checks
  - Combined filters (label + unread/starred status)
2025-06-16 15:54:41 +02:00
Sylvain ZimmerandGitHub 460068b5d3 ✨(identity) add MailDomain management with Keycloak identity provider (#136)
This allows user creation, passwords reset and listing users from
Keycloak, plus a new MailDomainAccess model for admins.

* ✨(admin) add maildomainacess model, api route and backend tests

* ♻️(drf) simplify API code

* ✨(keycloack) add deployable keycloak to PaaS

* ✨(keycloak) add integration via API, upgrade to 26.x

* 🗑️(settings) remove invitation setting

* 🐛(tests) fix failing tests after rebase

* 🚨(all) fix lint
2025-06-16 10:03:40 +02:00
Sabrina Demagny 2ff790afb1 ✨(api) add endpoints to manage labels
This commit implements a complete label management system with the following features:

- Add CRUD operations for labels with hierarchical support (using slash-based naming)
- Implement label-thread associations (add/remove threads to/from labels)
- Add comprehensive permission checks (ADMIN/EDITOR roles required for management)
- Support hierarchical label structure with automatic parent creation
- Add color customization for labels
- Implement proper slug generation for label names
- Add extensive test coverage for all label operations

Technical details:
- New LabelViewSet with list, create, update, delete operations
- Custom actions for thread management (add-threads, remove-threads)
- Hierarchical label structure with parent-child relationships
- Automatic parent label creation when creating nested labels
- Proper permission handling based on mailbox access roles
- Comprehensive test suite covering all edge cases
- OpenAPI documentation for all endpoints
2025-06-15 18:18:31 +02:00
jbpenrath 328c1616eb 👽️(frontend) update api client
Run `make api-update`
2025-06-15 16:05:35 +02:00
Sabrina Demagny c297137bf4 ✨(backend) improve MBOX file import compatibility
Enhance support for MBOX files from various email export tools by handling
both extensionless files and text/plain MIME type. This improves compatibility
with different export formats while maintaining security through proper
validation.

Changes:
- Add support for files named "mbox" without extension
- Allow text/plain MIME type for MBOX files (common in webmail exports)
- Keep application/mbox as the primary MIME type for MBOX files
- Update validation to check both MIME types and file extensions
- Add test cases for extensionless files and text/plain MIME type
- Update error messages to be more descriptive about supported formats

The validation now handles:
- Files with .mbox extension (application/mbox or text/plain MIME type)
- Files named "mbox" without extension
- Maintains strict validation to ensure text/plain is only accepted for MBOX files

This change improves compatibility with various email export tools and webmail
services while maintaining security through proper file validation.
2025-06-15 15:13:38 +02:00
Sabrina Demagny 761784e91c ✨(backend) use a celery task for eml import
Unify the import implementations to use celery task (eml, mbox, imap)
Same returns for all import tasks.
Update openapi schema.
2025-06-11 23:53:48 +02:00
Sabrina Demagny 55c3f2a081 👽️(api) fix openapi schema for import message
Fix and re-generate schema
2025-06-11 23:32:51 +02:00
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
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
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
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
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
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
jbpenrath b40497ce0b 👽️(api) update schema and api client
Run `make api-update`
2025-04-28 19:36:18 +02:00
jbpenrath f3792b3a59 🏷️(backend) decorate MessageCreateView for OpenAPISchema
As the MessageCreateView is using a MessageCreateView drf_spectacular
is not able to guess the request details. So we had to decoreate this APIView
to precise mainly the expected request body
2025-04-22 15:56:42 +02:00
jbpenrath 94f2a2abe9 👽️(api) update api
- make api-update
2025-04-22 11:59:10 +02:00
Sabrina Demagny 211f7ffb6f 👽️(backend) update open api schema
run: bin/update_openapi_schema
2025-04-17 11:54:31 +02:00
jbpenrath 7bfb81a878 👽️(global) update open api schema and api client
- bin/update_openapi_schema
 - npm run generate_api
2025-04-17 11:37:01 +02:00
jbpenrath e9be9071ac 👽️(global) update open api schema and api client
- bin/update_openapi_schema
- npm run generate_api
2025-04-17 10:50:18 +02:00
jbpenrath b51a70f979 🔧(backend) generate openapi json file in core app root
Currently we generate openapi json file only for test purpose so it was relevant
to create it within test folders but now we want frontend be able to consume
this file so we decide to move it into core root folder.
2025-04-16 17:10:56 +02:00