andyedinborough/aenetmail — Issue #28: Flags add vs replace
Author: AndyClaw
Created: 2012-02-09 03:19:51+00:00
State: open

The store method of the ImapClient looks like it will replace flags when it is supposed to add and add when it is supposed to replace.

There is a ternary expression in the code as follows: replace ? "+" : ""

Yet the plus sign is intended for adding flags, whereas no sign is intended for replacing flags.

From the RFC:

FLAGS
Replace the flags for the message (other than \Recent) with the
argument. The new value of the flags is returned as if a FETCH
of those flags was done.

FLAGS.SILENT
Equivalent to FLAGS, but without returning a new value.

+FLAGS
Add the argument to the flags for the message. The new value
of the flags is returned as if a FETCH of those flags was done.

+FLAGS.SILENT
Equivalent to +FLAGS, but without returning a new value.

-FLAGS
Remove the argument from the flags for the message. The new
value of the flags is returned as if a FETCH of those flags was
done.

-FLAGS.SILENT
Equivalent to -FLAGS, but without returning a new value.