Only first redirect in sieve script works

Issue Description

I created a simple sieve script for a user via webgui. The idea is to have all incoming email forwarded to two different external adresses:

#require ["redirect"];

redirect "[email protected]";
redirect "[email protected]";

discard;

Expected Behavior

incoming email being sent to both recipients.

Actual Behavior

only the first recipient receives email, I can switch them, then the other one on top receives the mail (so recipient addresses are correct and receiving mailserver works).

Reproduction Steps

just add sieve script from above for a standard user via webgui then send mail to the users’ mailadress.

Relevant Log Output

No relevant output in DEBUG-Level, the second recipient never shows up.

But: when activating the require ["redirect"] line, I get:

Capability ‘redirect’ not supported

My expectation was that it would be redundant, but not lead to an error?!

Stalwart Version

v0.16.x

Installation Method

Docker

Database Backend

RocksDB

Blob Storage

RocksDB

Search Engine

Internal

Directory Backend

OIDC

Additional Context

caddy reverse proxy

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 limit is in the untrusted (user) Sieve interpreter settings: maxRedirects defaults to 1, so user-created scripts can only issue one redirect per execution by default. That’s why only the first redirect works, regardless of order.

To allow two redirects, an administrator needs to raise maxRedirects on the SieveUserInterpreter singleton (WebUI: Settings › Sieve › User Interpreter), e.g.:

{
  "maxRedirects": 2
}

Separately, the Capability 'redirect' not supported error when adding require ["redirect"] is expected: redirect is a core Sieve action defined in RFC 5228, not a registered extension, so it isn’t a valid name to put in a require list at all (only extension names like fileinto, copy, envelope, etc. belong there). You can safely omit the require line, or use the extensions actually needed.

Reference: Untrusted Interpreter | Stalwart

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

Works. Unexpected layer of complexity, sorry.