Commit Graph
100 Commits
Author SHA1 Message Date
Sylvain ZimmerandGitHub 24f122945f 🔒️(security) create SECURITY.md for vulnerability reporting policy
Added a security policy document outlining vulnerability reporting and disclosure procedures.
2025-11-28 10:35:10 +01:00
Sylvain ZimmerandGitHub 85a8585323 (dkim) add an optional DKIM verification just before sending emails (#434)
This will catch the case where people try to send email before having
correctly configured their DNS, and would also avoid unwanted sends
of messages not supposed to go out.
2025-11-23 17:09:46 +01:00
Sylvain Zimmer b77f4aa3b5 🔧(mta-out) use MAX_OUTGOING_EMAIL_SIZE for mta-out 2025-11-21 15:26:42 +01:00
Sylvain Zimmer 2770221a13 🔧(mta-in) rename config var MESSAGE_SIZE_LIMIT to MAX_INCOMING_EMAIL_SIZE
This aligns with the config for the backend
2025-11-21 15:20:03 +01:00
Sylvain Zimmer b7d3ad6837 🐛(attachments) apply a 1.4x factor on the limit of outgoing emails
This takes into account the overhead of MIME encoding
2025-11-21 14:53:48 +01:00
670ba5699a (attachments) configurable size limits (#430)
Adds new config vars for incoming & outgoing attachment sizes, validated at draft stage
and when receiving emails.

---------

Co-authored-by: Riël Notermans <riel@mosa.cloud>
2025-11-21 13:55:26 +01:00
e89c2c179a 🩹(text rendering) fix plain text line breaks (#428)
Fix text/plain rendering while preserving newlines

---------

Co-authored-by: Riël Notermans <riel@zzapps.nl>
2025-11-20 22:00:31 +01:00
Sylvain Zimmer 0959fd4418 🐛(keycloak) assign users to subGroups if needed
Previously if a KEYCLOAK_GROUP_PATH_PREFIX with a parent folder name
was specified, users were not being added to the right subgroup
2025-11-20 18:45:15 +01:00
Sylvain Zimmer 4833968eb2 🐛(tests) fix failing tests after env var rename 2025-10-18 00:00:09 +02:00
Sylvain ZimmerandGitHub 54b14f9304 (features) add new feature flag env vars (#387)
Rename old AI_FEATURE env vars and add 2 new ones
2025-10-17 23:27:37 +02:00
Sylvain ZimmerandGitHub dfd2668c11 🐛(retries) make message send retries more reliable (#386)
Adds a comprehensive test and a fix for failing "send" tasks
2025-10-17 19:19:11 +02:00
Sylvain Zimmer 7660eb9d3a 🚑️(drafts) show draft replies in threads 2025-10-16 22:16:57 +02:00
Sylvain ZimmerandGitHub d9d3853252 (images) implement cid: image support (#378)
Parses the email and replaces cid: images with blob urls
2025-10-15 21:15:48 +02:00
Sylvain Zimmer 4b1d480d53 (download) add raw email download button 2025-10-14 23:53:02 +02:00
Sylvain Zimmer 7d4cd48669 🚚(widgets) move widgets to integration repository
Here: https://github.com/suitenumerique/integration/pull/33
2025-10-14 22:08:21 +02:00
Sylvain Zimmer d9a02a2451 🐛(gaufre) fix fill color not applied on firefox 2025-10-08 10:55:59 +02:00
Sylvain Zimmer 1e88671b82 🐛(crowdin) fix crowdin env file 2025-10-07 17:01:01 +02:00
Sylvain Zimmer e23845ba02 ️(gaufre) implement aria-expanded attribute + improve some translations 2025-10-07 14:29:00 +02:00
Sylvain Zimmer 816b438097 🐛(gaufre) fix anonymous mobile gaufre and missing strings 2025-10-07 12:28:33 +02:00
Sylvain Zimmer 4cfaa16c2a 🐛(gaufre) disable Gaufre button if not configured 2025-10-07 11:00:26 +02:00
Sylvain ZimmerandGitHub 1c316b7291 (widgets) add La Gaufre widget + improve accessibility (#360)
All other widgets benefit from focus trap, espace key binding, and overall linting
2025-10-07 10:19:14 +02:00
4db9b261b3 (inbound) store message metadata as custom headers (#354)
Co-authored-by: Jean-Baptiste PENRATH <jb.penrath@gmail.com>
2025-10-02 22:15:55 +02:00
Sylvain Zimmer d3d993b8f1 ️(widget) improve accessibility of the feedback widget
Credits to Sophie Drouvroy for early feedbacks on a11y
2025-09-29 23:41:24 +02:00
Sylvain Zimmer bcab071224 🐛(mta-in) change MDA_API_BASE_URL default value 2025-09-29 10:57:55 +02:00
Sylvain Zimmer 3b3535ec5b (api) add a route to download an email as EML 2025-09-29 10:38:28 +02:00
Sylvain Zimmer 227e46b976 📝(readme) update architecture image and include in README 2025-09-27 12:58:48 +02:00
Sylvain Zimmer 37df99dd00 🐛(dns) ignore trailing semicolon in TXT records 2025-09-27 01:22:43 +02:00
Sylvain Zimmer f622b5810d 🐛(dns) fix DKIM records check that wasn't normalized 2025-09-26 15:38:18 +02:00
Sylvain Zimmer 14ee52edb6 📝(readme) mention latest features in the README 2025-09-24 14:58:21 +02:00
Sylvain ZimmerandGitHub f4eac6dd8f (channels) add feedback widget and multiple inbound channels support (#301)
This PR adds a new build system for embeddable widgets and a first implementation of a "Feedback" popup widget.

It also refactors inbound message routes into channels, of which there are 2 for now: MTA (by default) and Widget. More to come!
2025-09-24 14:30:40 +02:00
Sylvain Zimmer 1b1beee5a9 🐛(tasks) fix run_task command argument name 2025-09-21 15:53:29 +02:00
Sylvain Zimmer 7823910eb3 🐛(search) fix failed tasks when indexing messages being deleted
This is triggered by the selfcheck process quite often
2025-09-20 20:45:23 +02:00
Sylvain Zimmer c964adb956 (outbound) add a lock around sending to avoid double sends by workers 2025-09-19 22:51:28 +02:00
Sylvain Zimmer ce333fd280 🐛(celery) add default queue to worker CLI 2025-09-19 14:12:45 +02:00
Sylvain Zimmer 86b24ecc12 (admin) improve admin columns, performance and filters 2025-09-19 14:12:19 +02:00
Sylvain ZimmerandGitHub 423bf50bc9 (smtp) implement smtp_tls_security_level, follow RFC more closely (#336)
This fixes delivery errors seen in the wild where:
 * Some servers advertise STARTTLS but have broken certificates.
   Because of this, we follow Postfix's recommentations to use
   opportunistic TLS by default.
 * As we are sending emails straight to other SMTPs in direct mode,
   we need to have stricter RFC compliance for our raw mime DATA, namely
   CRLF endings and maximum line length. This was transparently done
   by Postfix in relay mode.
Some env vars have also been renamed for clarity.
2025-09-19 12:28:38 +02:00
Sylvain Zimmer c6727d96b6 (celery) add new run_task command to run arbitrary tasks 2025-09-15 12:29:19 +02:00
Sylvain Zimmer 45ef7ebdb6 ⬆️(security) upgrade Django version 2025-09-10 16:07:43 +02:00
Sylvain Zimmer 3f4ccbd739 🐛(smtp) fix tests to expect smtp_ip 2025-09-05 14:44:24 +02:00
Sylvain Zimmer 8c7a080e39 🐛(dns) relax DNS record whitespace checks 2025-09-05 14:32:51 +02:00
Sylvain Zimmer b63d347adb 🐛(smtp) pass host to SSL context 2025-09-05 13:34:20 +02:00
d64679af5c (metrics) add prometheus metrics endpoint (#329)
* (backend) add base django-prometheus metrics

* (backend) add prometheus metrics, add the message by status metric

* (backend) Add more metrics on attachement + add 0 by default for statuses

* 🚨(backend) ignore import-outside-toplevel for collector

* 🚨(backend) add all docstring + don't access private properties

* 🔒️(backend) add basic auth to /metrics route

* 🚸(backend) use labels instead of hard-coding statuses in metric

* 📝(backend) document prometheus

* 🎨(backend) lint

* (backend) add first tests for prometheus

* 🚚(backend) move prometheus endpoint to api/<ver>/prometheus/metrics, change middlewarename

* (backend) add attachment tests for prometheus metrics

* 🐛(backend) actually allow disabling prometheus

* 🎨(backend) improve logic in mw

* 🎨(backend) small review fixes

* 🚨(backend) lint

* 🐛(backend) Remove sha256 from factory

* 🎨(backend) nitpicks + linter fixes

* 🐛(poetry) remove duplicate prometheus package in dev deps

* 🐛(poetry) add missing dep

* 🐛(prom) make tests more reliable, disable by default + misc fixes

* 📝(prom) fix docstring in tests

---------

Co-authored-by: Stanislas Bruhiere <stanislas@bruhiere.fr>
2025-09-05 12:22:54 +02:00
03a8dc743d (mta) add Direct mode for MTA out (#285)
This PR adds support for 2 MTA out modes : Direct-to-MX and SMTP-relay outbound delivery. Direct mode supports SOCKS5 proxies, and we bundle a new `src/socks-proxy` component to support it.

We also add an end-to-end self-check command plus scheduled health-check task with optional Prometheus metrics.

---------

Co-authored-by: Bastien Ogier <bastien.ogier@ext.anct.gouv.fr>
Co-authored-by: Stanislas Bruhiere <stanislas@bruhiere.fr>
2025-09-04 15:48:46 +02:00
Sylvain Zimmer 8f79390654 🐛(admin) allow editing full_name field 2025-09-01 22:59:23 +02:00
Sylvain Zimmer a0a7198a9b 🐛(swagger) move swagger to /api/v1.0/ like the rest 2025-08-30 19:23:20 +02:00
Sylvain Zimmer d31dfebdf2 🐛(readme) remove my personal email as contact ;) 2025-08-28 21:08:27 +02:00
Sylvain Zimmer 56a1ba69c8 🐛(blobs) delete Blobs and Attachments when Messages are deleted 2025-08-28 02:12:00 +02:00
Sylvain Zimmer 1e2f30e046 🐛(admin) use autocomplete fields instead of full dropdowns
This makes the admin usable with thousands of records in the DB
2025-08-28 00:14:29 +02:00
Sylvain Zimmer 956679e9b2 (dns) add button to copy all DNS records 2025-08-20 16:00:24 +02:00
Sylvain ZimmerandGitHub 5b9de7c4eb ♻️(services) refactor Services into a single directory (#304)
* 🐛(scalingo) add an env var to disable Celery beat scheduling

Deployments on fresh PaaS databases would fail because of this, without
giving the user the ability to create the database through a manual
run command.

* 🐛(nginx) fix error when no env vars configured

* ♻️(services) refactor Services into a single directory

I haven't done AI yet because there are pending patches but once done we'll also have core/services/ai/*.py
I used importer as a name to avoid using a Python keyword

* 🚨(lint) move imports to the top
2025-08-05 14:45:18 +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
Sylvain ZimmerandSabrina Demagny 9bef38c53a 💚(lint) fix lint GH action 2025-07-18 14:11:29 +02:00
Sylvain ZimmerandSabrina Demagny 4545f4ff48 (roles) implement MailboxAccessRole.SENDER 2025-07-18 14:11:29 +02:00
Sylvain Zimmer 8fc02cb948 🐛(admin) add email as fallback in access list when full_name is empty 2025-07-18 01:35:36 +02:00
Sylvain Zimmer cfb417d80b 🐛(admin) add the ability to add mailbox accesses by email
This fixes the admin panel where users searched among the same
maildomain could correctly be added by their uuid, but when entering
an arbitrary email, the email and not the uuid gets sent in the POST
mailbox access. This might get replaced later when we have a proper
invitation system for external emails.
2025-07-18 00:00:00 +02:00
Sylvain Zimmer 21ee4e9177 📈(posthog) add posthog.identify call to ID users' feedbacks 2025-07-17 22:32:47 +02:00
Sylvain ZimmerandGitHub 8319250fbb ♻️(dns) refactor DNS and Scaleway code to be simpler (#276) 2025-07-17 00:57:33 +02:00
Sylvain Zimmer f29ba226e6 🐛(drafts) fix concurrent updates of drafts with blob delete 2025-07-15 23:13:07 +02:00
Sylvain Zimmer d93f1a9e71 💚(actions) fix github action with dockerfile target stage 2025-07-15 11:29:20 +02:00
Sylvain ZimmerandGitHub f1a89a5bdb (all) refactor several areas before 0.1 release (#265)
We are going to release a 0.1 version soon, along with our first production deployment. Starting from there, migrations and a consistent developer experience will be officially supported. To make that easier, this large patch cleans up several areas:
 * Reset migrations one last time
 * Update models for storage efficiency (move textchoices to integerchoices on high-volume tables)
 * Use Blobs for mail mime data and draft bodies. Having them in a separate PG table is a first step, we will later start offloading them to object storage.
 * Add default ZSTD compression to blobs
 * Add per-domain DKIM Keys
 * Add DNS check and provisioning, with a first Scaleway provider
 * Fix Keycloak user provisioning
 * Fix Attachment storage, they are now stored individually only at the drafting stage. Afterwards they are extracted from the main blob. This may be optimized later but at least we only store once. For JMAP compatibility, this requires using fake IDs in the blob API route.
 * Add a management command and recurring task to retry unsent messages
 * Improve the local developer experience with new ports and make commands
 * Repackage MTA-in and MTA-out to be closer to Backend: Poetry, multi-step Dockerfile, move compose and makefile to the root
 * Migrate to OpenSearch
 * Improve overall documentation and add a self-hosting page

Contributes to #177 and #185
2025-07-15 10:41:55 +02:00
Sylvain ZimmerandGitHub e74ceaa66a (mta-in) move Postfix connection to the MDA in a Milter plugin (#248)
This replaces the two plugins we had (check recipients + delivery)
to a single Milter plugin. The real change is that now the delivery
happens during the SMTP session, and can result in a temporary
failure to the client. This makes the MTA-in entirely stateless.
2025-07-07 14:42:46 +02:00
Sylvain ZimmerandGitHub 3f5787b3a5 📝(readme) clean README 2025-07-07 11:08:33 +02:00
Sylvain Zimmer 74592513f3 (keycloak) add script to map group attributes to users 2025-07-06 16:10:01 +02:00
Sylvain Zimmer f0569eaa8d 📝(docs) add new architecture diagram and other misc content 2025-07-01 10:33:24 +02:00
Sylvain Zimmer 3e65a4a27c 💄(keycloak) add themes to Keycloak on Scalingo 2025-06-30 11:51:31 +02:00
Sylvain ZimmerandGitHub 486db8fed6 📝(roadmap) add public roadmap to the README 2025-06-26 15:47:09 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH 6fd271bed8 ♻️(flags) refactor Thread flags and stats
Migrate from counters to simple flags, because the frontend needs
counts of threads, not sums of counts of messages. Also prepare
for spam and archive features.
2025-06-19 02:05:41 +02:00
Sylvain Zimmer 805fdbabe3 🐛(settings) add missing environ_prefix for OIDC_CREATE_USER
Fixes #158
2025-06-18 13:35:22 +02:00
Sylvain Zimmer 0912f4f660 🐛(keycloak) fix Script issue with Keycloak realm import 2025-06-16 16:23:05 +02:00
Sylvain Zimmer 577ad703ca 👷(build) add optionalDependencies for rollup
This allows the same package.json to be used for arm64 and amd64
2025-06-16 10:34:52 +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
Sylvain ZimmerandGitHub 9f04ad4d4a 📝(readme) improve README, based on LaSuite Docs (#146) 2025-06-14 01:15:20 +02:00
Sylvain Zimmer 614fd5be84 🔒️(cors) disallow all CORS origins by default in Prod 2025-06-10 17:46:01 +02:00
Sylvain Zimmer c6b4e4334b 🔒️(frontend) hide Nginx server version in error responses 2025-06-05 19:36:11 +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
Sylvain Zimmer dc0c578e65 🚀(scalingo) deploy worker process on scalingo and fix ES scripts 2025-05-17 10:05:54 +02:00
Sylvain Zimmer 812afc211f (search) add profile switch to print debug of ES search 2025-05-16 14:55:24 +02:00
Sylvain Zimmer bd9f4057f2 🐛(search) fix #98 by improving ES analyzers and search logic 2025-05-16 14:45:58 +02:00
Sylvain ZimmerandGitHub 87a949d4d2 (attach) add initial attachments support in in/outbound & api (#93) 2025-05-15 13:45:52 +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
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
Sylvain Zimmer 2bf02d399d 🐛(threads) fix replies not threading when delivering internally 2025-05-05 00:51:10 +02:00
Sylvain Zimmer ca0eb72c51 🐛(contacts) fix possibly empty contact names 2025-04-30 22:32:17 +02:00
Sylvain ZimmerandJean-Baptiste PENRATH d95425cdd4 (mda) add a test for local message delivery 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
Sylvain Zimmer d7a422ff47 (threads) add test for multiple recipient mailboxes 2025-04-28 16:04:29 +02:00
Sylvain Zimmer 270d07b9b2 🔨(db) add a script to make a full reset of the database, including schema 2025-04-24 15:56:02 +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
Sylvain Zimmer d2176559ce 🔒️(rfc5322) use longer Message-IDs 2025-04-23 01:55:56 +02:00