Subaddressing Doc of v.16 is wrong

Issue Description

Subaddressing Doc of v.16 is wrong

in the doc it told :

"match": [{"if": "matches('^([^.]+)\\.([^.]+)$', rcpt)", "then": "$2"}],

but it should be

"match": [{"if": "matches('^([^.]+)\.([^.]+)$', rcpt)", "then": "$2"}],

Stalwart Version

v0.16.x

Installation Method

Docker

Database Backend

RocksDB

Blob Storage

RocksDB

Search Engine

Internal

Directory Backend

Internal

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

The doc is actually correct as written. That block is a JSON object (submitted via the JMAP API or WebUI, not a raw expression string), so the regex has to be JSON-escaped: to represent a single backslash character (for \. in the regex) inside a JSON string you need \\.. If you used the single-backslash version you posted, the JSON parser would interpret \. as an invalid escape sequence.

So "matches('^([^.]+)\\.([^.]+)$', rcpt)" in the JSON snippet does correctly encode the regex ^([^.]+)\.([^.]+)$ once JSON-decoded, matching a local part like alias.user and capturing user as group 2. You can see this pattern on the Subaddressing docs page.

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

Can’t follow the bot if I try the current Doc example it do not work.

If you remove the / it work.

The docs show examples for the CLI which require escaping, on the WebUI they don’t. I just added a note to the documentation explaining this.

Perfect thanks a lot :slight_smile: