Skip to content

feat(imp): expose user IMAP keywords as mail/msgflags - #126

Merged
ralflang merged 2 commits into
FRAMEWORK_6_0from
feat/mail-msgflags
Nov 13, 2026
Merged

ralflang merged 2 commits into
FRAMEWORK_6_0from
feat/mail-msgflags

Conversation

@TDannhauer

Copy link
Copy Markdown
Contributor

Summary

  • Expose mail/msgflags, a keyword-to-label map of flags the current user created.
  • Keep IMP flag class names inside IMP, so horde/core does not need a copy of the unserialize whitelist.

Motivation

ActiveSync reads IMP's msgflags preference from horde/core. Since that preference is unserialized with allowed_classes => false (ZDI-20-1051), user flag objects become __PHP_Incomplete_Class. Sync then warns for every message, and the labels never reach the device.

horde/Core#252 proposes copying IMP's class whitelist into Core. That list belongs to the application that defines the classes. The mail application should publish the finished map as an API capability.

Changes

  • IMP_Flags::msgflags() returns lowercase IMAP keyword to display label for IMP_Flag_User only. Built-in flags are omitted, including ones whose color or label was customized and stored in the same preference.
  • IMP_Api::msgflags() delegates to that method. The registry capability is mail/msgflags.

Test plan

  • phpunit test/Imp/Unit/FlagsMsgflagsTest.php — user keyword and label, exclusion of \answered, API delegation and method registration
  • Create a user flag in IMP and confirm mail/msgflags returns its keyword and label
  • Confirm a recolored built-in flag such as \answered is absent from the map

ActiveSync needs each user's flag labels without unserializing IMP flag objects in horde/core. Publish a keyword-to-label map from the mail API so the allowed class list stays inside IMP_Flags.
@TDannhauer

Copy link
Copy Markdown
Contributor Author

Pairs with horde/Core#257. That pull request consumes mail/msgflags and should merge after this one.

Comment thread lib/Api.php Resolved
@ralflang
ralflang merged commit 7e6b79e into FRAMEWORK_6_0 Nov 13, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants