Skip to content

IMAP: send Atom/Flag objects as command parameters - #2158

Merged
the-djmaze merged 1 commit into
the-djmaze:masterfrom
filippogiuliani:fix/imap-flags-not-sent
Nov 26, 2026
Merged

the-djmaze merged 1 commit into
the-djmaze:masterfrom
filippogiuliani:fix/imap-flags-not-sent

Conversation

@filippogiuliani

Copy link
Copy Markdown

On master no flag is saved any more. Since 49c4151 the flags passed to STORE and APPEND are
\MailSo\Imap\Flag objects, but ImapClient::prepareParamLine() writes strings and arrays only and silently
skips anything else:

C: UID STORE 1 +FLAGS.SILENT ()         ← now
C: UID STORE 1 +FLAGS.SILENT (\Seen)    ← with this change

The server answers OK, so there is no error: read, flagged and tags are not saved, a deleted message stays,
emptying a folder leaves everything in it, and an appended message loses its flags. v3.1.4 is not affected.

prepareParamLine() now also writes Atom objects (Flag extends it).

Tested with the IMAP classes alone, against Dovecot 2.4.5 and GreenMail 2.1.5: STORE, APPEND with flags,
MessageDelete() and FolderClear() fail before and work after.

🤖 Generated with Claude Code

Since 49c4151 the flags are \MailSo\Imap\Flag objects, but
prepareParamLine() writes strings and arrays only and skips anything
else. Every flag was lost without an error: "UID STORE 1 +FLAGS.SILENT ()"
instead of "(\Seen)". Read, flagged and tags were not saved, deleted
messages were not removed, and APPEND lost its flags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@the-djmaze the-djmaze added the bug Something isn't working label Nov 26, 2026
@the-djmaze
the-djmaze merged commit 7dea327 into the-djmaze:master Nov 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants