You misunderstand the intended meaning of "surprise".
The surprise here is that the server is, for some reason unknown to the
client, removing the flag that the client went to some effort to create.
That's only if the server autodeletes keywords.
The IMAP specification does not prohibit a server from autodeleting
keywords, but it does not permit or encourage it either. It is silent on
This is an example in which Postel's oft-quoted principle of "be liberal
in what you accept, and conservative in what you send" applies. Many
people incorrectly interpret Postel's principle as meaning that
implementations should accept arbitrary protocol syntax errors. The
correct interpretation is the robustness principle of avoiding unusual
behavior that is likely surprise existing deployed implementations.
That is a large presumption. A client that does a known workaround to
avoid a known problem is not necessarily "sloppy". In fact, the more
attentive the client is to being non-"sloppy", the more likely it is to
get itself into trouble.
I would recommend, as a robustness measure, that any server contemplating
implementing the autodelete of keywords assign a "last used" timestamp to
any unused keyword, and only autodelete unused keywords that are older
than a certain period of time.
-- Mark --
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.