Server-side copy sent items for group mailboxes

Before anything else, thank you for building Stalwart

When a group member sends mail using the group’s address (From: shared@mailbox,com), the message is currently saved only in the submitting user’s /Sent. Other group members never see it. Add a per-Account flag that makes Stalwart APPEND a copy of every send-as-group message to the group’s /Sent server-side, so the behaviour is consistent across every JMAP/IMAP/OWA-like client without any client-side work.

This mirrors Microsoft Exchange’s MessageCopyForSentAsEnabled (shipped Exchange 2013 CU9 / Exchange Online ~2015), which is the de-facto reference UX for shared mailboxes.

Group accounts are already 90 % there: members share Inbox, and after #485 they can submit From: group@. The remaining gap, sent visibility, is what makes shared mailboxes operationally useful: audit, continuity, “who replied to that customer last week”. Without it the feature is half-baked and every operator hits the same wall.

Stalwart is the only layer with all the context: from header, authenticated principal, Group ACL, and putting the logic anywhere else means re-implementing it in every JMAP and IMAP client with all the subtle drift that brings; the audit trail comes along for free since X-Authenticated-User is already stamped on outgoing mail; and the per-user Sieve workaround people reach for today bakes the target mailbox’s id into each member’s script (silently breaks on rename) and turns “add a member” into a three-step ACL + Sieve + identity dance, which the server-side flag collapses back to a single ACL change.

Also, adding bulwarkmail/webmail#61 for reference

3 Likes

this would be also very helpful for my organization, I’d also be happy to help :slight_smile:
one could also think of adding a new configuration setting for every user and group account customizable in the management web interface whether to copy/move sent emails also into the shared folders /Sent which should(?) default to true

This is a really important feature for organizations looking to migrate from a Microsoft/Google environment: without this, there’s a significant regression in terms of managing shared inboxes. Right now, the best alternative I can think of is distributing app passwords on regular mailboxes so that each user accesses the shared mailbox without sharing a password, but that means we can’t use an IdP such as Keycloak and can’t really enforce two-factor authentication.

For my organization I have setup a LDAP server (Authentik in this case) to manage the users and groups.

I solved the copying into the right shared folders by creating a MTA Hook in the DATA stage which then does some JMAP calls to put the mails to the correct folders.

It’s working fine for me, but I s think that it’d be good to provide an in-built mechanism (:

Do you mind sharing your setup? I’m currently trying to implement Stalwart in our non-profit, and that would be very useful to us.

of course, here it is: GitHub - Stadt-Land-Klima/stalwart-group-sent-hook · GitHub

Please let me know if you have any trouble or any recommendations/issues you find :slight_smile:

1 Like