IMAP append does not include message ID

Issue Description

see:

and

Expected Behavior

IMAP append emails should contain the same data as a normal notification

Actual Behavior

“Stalwart’s push for an APPENDed message carries no message id, so there’s nothing to fetch the subject from.”

Stalwart Version

v0.16.x

Installation Method

Docker

Database Backend

PostgreSQL

Blob Storage

Filesystem

Search Engine

PostgreSQL

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

Path prefix seems different.

In the v1.0 source, an IMAP APPEND already sends the same kind of push as a normal delivery. That push has never carried a message ID. I couldn’t find a way to get one from it.

What the source shows. crates/imap/src/op/append.rs builds a StateChange for the account with Email, Mailbox and EmailDelivery changes. JMAP-side imports and Email/set do the same. A JMAP StateChange (RFC 8620) only carries a new state string for each data type, such as Email or EmailDelivery. It doesn’t carry email IDs or subjects, for any delivery path. So the push for an APPENDed message doesn’t have a message ID, and neither does the push for a normally delivered one.

What a client should do. After it receives the state change, it should call Email/changes with its last known Email state. That returns the IDs of the new messages. It can then fetch the subject and other fields with Email/get. A client that expects the push itself to contain the subject will fail for every message source, so this looks like a client-side assumption. I can’t see how the Bulwark client behaves, so I can’t say for sure.

Version note. You’re on v0.16.x, and I can only check v1.0. The v1.0 changelog mentions a fix where APPEND and COPY/MOVE into another account’s mailbox did not change the JMAP EmailDelivery state. If your problem is that the push doesn’t arrive at all, that fix may be relevant. I’d recommend upgrading, using the guide at Overview | Stalwart. Then test again.

For how push works in v1.0, see Push notifications | Stalwart.

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

I am using 0.16.27, in earlier versions there was no notification at all. Now, the notification contains no info/subject/body. I can re check upon upgrade to v1 if we think it is fixed there

Hi Zeus,

The fix from your earlier topic only added the EmailDelivery state change to IMAP APPEND. That’s enough to wake the client, but clients using Email Delivery Push (Bulwark included) build the notification from an EmailPush object, and Stalwart only sent one of those for mail delivered over SMTP. So your appended messages produced a push with nothing in it, hence the blank notification.

APPEND now sends an EmailPush for every appended message (MULTIAPPEND included), so the push carries the subject, sender and whatever other properties the subscription asks for. JMAP Email/import gets the same treatment. The change ships in the next weekly Stalwart release.