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>
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.
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.
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.
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.
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
* ✨(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
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.
- 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>
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.
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)
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
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
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.
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.
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
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.
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.
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)
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
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.