[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Important marks don't seem to be synced on IMAP folders



Hi David,

Thank you for the response! You have explained the situation far
better than I did.

At Tue, 21 Jun 2011 21:15:50 +0200,
David Maus wrote:
>
> […]
>
> For IMAP folders WL additionally pushes the flags of a message to
> the server as permanent flags (rfc3501, 2.3.2). If you now open the
> IMAP folder and `wl-summary-auto-sync-marks' is set, WL iterates
> over the list of registered global flags, searches for messages in
> the mailbox with this flag set -- and then adds or overlays the list
> of messages with information from the flag folder (the merging
> behavior).
> 
> Benefit of the flag folder: You can conveniently use flags even if the
> folder type or the IMAP server does not support (permanent) flags.

Yes, I agree this is convenient.
 
> Now the problem at hand is, that WL puts messages in the flag folder
> but does not remove a message from the flag folder when syncing marks
> in Summary.
> 
> Overlaying the messages happens in the luna method
> `elmo-folder-list-flagged' in elmo.el.
> 
> […]
> 
> Creating the uniq-list is the culprit, at least for IMAP folders
> with permanent flags. Problem: At this point we do not know if the
> lack of flagged messages in the folder response means that the
> folder supports permanent flags but does not contain messages with
> the flag -or- the folder does not support flags at all.
> 
> What about a customization variable that tells
> `elmo-folder-list-flagged' to rather update the flag folder with the
> folder information than overlaying?

You can check for the presence of \* in the PERMANENTFLAGS repsonse to
see if the IMAP server supports keywords.

  (member "\\*" (elmo-imap4-session-flags-internal
                  (elmo-imap4-get-session wl-summary-buffer-elmo-folder)))

But there is still the merge problem. Without more metadata we can
never know if flags were deleted or were never present. [1]

I believe there are 4 possible strategies for merging two sets of
keywords, set A and set B. Setting A to B, setting B to A, setting to
the union of A and B, or setting to the intersection of A and B.

For user keywords, I think that WL should “trust IMAP” when keywords
are supported in the IMAP server. That is, WL should set the keywords
of a message in the msgdb to what IMAP says they are. This is the same
behavior that WL uses when messages are deleted or moved. If the IMAP
server does not support IMAP, then flags should of course be only
stored locally.

In the case where a number of messages in the msgdb are flagged with a
keyword but none in the IMAP server are (perhaps because the IMAP
server implementation changed recently to one that supports keywords),
then WL could prompt the user to copy the keywords to the IMAP server
or to delete all the flags in the msgdb.

Does that make sense as a strategy?

best, Erik

1. I don’t know how WL handles updating flags after they are marked in
disconnected mode. I assume this works separately from the sync marks
mechanism.
Sent from my free software system <http://fsf.org/>.