Issue Description
The built-in MailingList object only fans a message out to its recipients. The original envelope sender (MAIL FROM) and the From: header are kept as they were. As a result, list mail to external members fails authentication at strict receivers, most notably Gmail, which makes the integrated mailing lists unusable for lists with Gmail members.
Expected Behavior
RFC 5321 section 3.9.2 says that when a list is expanded, the return address in the envelope should be changed so that errors go to the list administrator rather than the originator. Established list software (Mailman, Sympa, etc.) also generally does the following when delivering to strict receivers:
- Envelope sender: use a list-owned address on the list’s domain (e.g. list-bounces@domain, ideally VERP), so SPF is evaluated against a domain the server controls and bounces reach the list owner.
- Optional From rewrite (for DMARC alignment): From: “Original Sender via listname” list@domain, with the original author in Reply-To.
- DKIM-sign list mail with the list domain’s key, so DKIM alignment is possible.
Actual Behavior
Delivery works for some recipients, but Gmail rate-limits the message:
421 Your email has been rate limited because it is unauthenticated.
Gmail requires all senders to authenticate with either SPF or DKIM.
Authentication results: DKIM = did not pass
SPF [<sender's address>] with ip: [<my server IP>] = did not pass
This is expected given how the list currently works. The list server’s IP is not authorized in the original sender’s SPF record, and the sender’s DKIM signature either doesn’t survive or isn’t aligned. Since the envelope sender is the original author’s address, SPF is evaluated against a domain the list server has no control over. Messages from authors whose domains publish p=quarantine or p=reject also fail DMARC.
Reproduction Steps
- Create mailing list with external addresses, one of which is a gmail address.
- Send mail to list from an external address
Stalwart Version
v0.16.x
Installation Method
NixOS
Database Backend
PostgreSQL
Blob Storage
PostgreSQL
Search Engine
PostgreSQL
Directory Backend
OIDC
Additional Context
I tried rewriting the envelope with a sieve script, but I couldn’t get it to work.
There is a reply to a different issue that suggests that the envelope is in fact rewritten, but that is not what I experience on my setup:
A MailingList object holds bare addresses with no link back to an account, and it only rewrites the recipient side
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on