Sieve script creates duplicate mailboxs

Issue Description

I configured the following sieve script in my mail account:

if header :contains "List-Id" "rust-for-linux.vger.kernel.org" {
    fileinto :create "R4L";
    stop;
}

Expected Behavior

It should create a single R4L mailbox and direct all emails whose List-Id matches rust-for-linux.vger.kernel.org into that folder.

Actual Behavior

It created 3 R4L mailboxes:

R4L	-	2	0
R4L	-	1	1
R4L	-	178	178

But in thunderbird, I could only see mails from the mailbox with 2 emails, other R4L mailboxes are inaccessible.

I think the number 3 here is not a coincidence. Perhaps each node in my cluster created one of them.

Reproduction Steps

  1. (Maybe) configure a 3 node stalwart cluster
  2. Configure a stalwart mail account to use the mentioned sieve script.
  3. Subscribe that account to Rust for Linux mailing list.
  4. Observe the number of mailboxes

Relevant Log Output

May 27 00:49:40 origin stalwart-mail[1063851]: 2026-05-27T00:49:40Z TRACE HTTP response body (http.response-body) listenerId = "http", localPort = 8080, remoteIp = 100.100.243.13, remotePort = 60898, contents = "{"methodResponses":[["Mailbox/query",{"accountId":"b","queryState":"s7qcq","canCalculateChanges":true,"position":0,"ids":["a","b","c","d","e","h","i","j","k","l","m"],"total":11},"0"],["Mailbox/get",{"accountId":"b","state":"s7qcq","list":[{"id":"a","name":"Inbox","role":"inbox","totalEmails":95,"unreadEmails":0},{"id":"b","name":"Deleted Items","role":"trash","totalEmails":0,"unreadEmails":0},{"id":"c","name":"Junk Mail","role":"junk","totalEmails":0,"unreadEmails":0},{"id":"d","name":"Drafts","role":"drafts","totalEmails":0,"unreadEmails":0},{"id":"e","name":"Sent Items","role":"sent","totalEmails":1,"unreadEmails":0},{"id":"h","name":"BPF","role":null,"totalEmails":222,"unreadEmails":219},{"id":"i","name":"R4L","role":null,"totalEmails":2,"unreadEmails":2},{"id":"j","name":"R4L","role":null,"totalEmails":1,"unreadEmails":1},{"id":"k","name":"R4L","role":null,"totalEmails":178,"unreadEmails":178},{"id":"l","name":"Alerts","role":null,"totalEmails":22,"unreadEmails":21},{"id":"m","name":"Sec","role":null,"totalEmails":2,"unreadEmails":0}],"notFound":[]},"1"]],"sessionState":"27af6e4d"}", code = 200, size = 1103

I didn’t find too much information in the logs. Could you provide some information about what to grep?

Stalwart Version

v0.16.x

Installation Method

Built from source

Database Backend

PostgreSQL

Blob Storage

PostgreSQL

Search Engine

PostgreSQL

Directory Backend

Internal

Additional Context

I am using a cluster of 3 nodes with zenoh coordinator.

On the client side, I am using Thunderbird.

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

Can you reproduce this consistently? How many messages are you delivering in parallel?