Issue Description
When using sieve scripts, variables are expected to be valid inside the script. The following script is being used:
require “copy”;
require “mailbox”;
require [“fileinto”,“imap4flags”,“enotify”,“variables”];
set “addresses” “:test1.com:test2.com:test3.com:test4.com:test5.com:”;
if address :domain :matches “To” “*” { set “domain_to” “${1}”; }
fileinto "testdomainto/${domain_to}";
if string :contains "${addresses}" [":${domain_to}:" ]
{
if string :matches "${domain_to}" "*.*" { set "folder" "${1}"; fileinto "Folder-set/${folder}";}
fileinto "Result/${folder}";
stop;
}
with the email of:
From: [email protected]
To: [email protected]
Subject: Hello from Sievepad
Date: Mon, 14 Sep 2026 10:00:00 +0000
Message-ID: [email protected]
Content-Type: text/plain; charset=“utf-8”
Hello! This is a test message.
Expected Behavior
- mail will be filed into “testdomainto/test1.com”
- mail will be filed into “Folder-set/test1”
- mail will be filed into “Result/test1”
Actual Behavior
- mail will be filed into “testdomainto/”
Reproduction Steps
- create the user script as shown above
- run the sievpad.com testing environment
Stalwart Version
v0.16.x
Installation Method
Binary (Linux)
Database Backend
MySQL
Blob Storage
S3-compatible
Search Engine
MySQL
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