Closed Bug 350075 Opened 18 years ago Closed 12 years ago

IMAP forward flag not noticed when set by another client

Categories

(MailNews Core :: Networking: IMAP, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 561292
Thunderbird 3.0b3

People

(Reporter: tschafer, Assigned: amantia)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6

Using and instance of TB I forward a message.
The forward flag is set, and displays on the messages.
The flag does not show up on the message in another instance of TB.
Restarting the second instance does not load the flag.
Recreating the account on the second instance will download the headers again, and the flag will be picked up.
Also moving the message to another folder, with the second TB instance, will pick up the flag.

Thunderbird version 1.5.0.5 (20060719)

Reproducible: Always




This happens with both courier-imap and dovecot as the IMAP server.
I experienced the same with Cyrus 2.3.7 as imap server. When a shared mailbox is used and the users with access (ACL = lrswipted, "w" bit is for storing flags) forward a message then the $Forwarded flag is set on the message. A telnet session to imap with a different user verifies that the forwarded flag is set:

a fetch 1:* flags
* 3 FETCH (FLAGS (\Recent $MDNSent $Forwarded))
<output truncated>

However, thunderbird 1.5.0.9 does not update the Flags of the shared mailbox. It looks like thunderbird maintains it's own local flags list per user which isn't synced with the message flags of the messages on the imap server.
Ideally TB should pick up the unsolicited fetch response which contains the new flags of a message when client one sets the flag and client2 has the same mailbox in selected state. 



Reporters, does this issue still occur in the latest supported 2.0.0.14 / trunk nightlies?
Whiteboard: CLOSEME 2008-06-05
Yes it does, at least in Thunderbird 2.0.0.14.

In my tests, the forward flag is set on the message on the IMAP server: I'm using a Maildir with Dovecot, and the forwarded messages receive Sa as a flag. Rebuilding the folder index in another client loads the forward flag.
Also present in Version 3.0a2pre (2008060403). Rebuilding the index also loads the forward flags there.
Confirming based on comments #3 and #4. Moving to Core -> IMAP.
Assignee: mscott → bienvenu
Status: UNCONFIRMED → NEW
Component: General → Networking: IMAP
Ever confirmed: true
Product: Thunderbird → Core
QA Contact: general → networking.imap
Whiteboard: CLOSEME 2008-06-05
This proposed patch fixed the problem. It is against the latest 2.x release, but the same problem is in 3.0 alphas and the same solution fixes the bug there as well.
Thanks for the patch, Andras!

Please ask review from a suitable reviewer
See http://developer.mozilla.org/en/docs/Getting_your_patch_in_the_tree

One note, the patch contains tabs - Mozilla code should be all spaces. Also, the branch is mostly for security and crash fixes, so primarily patches should apply to hg tip (this patch does, but i had to use --fuzz=4).

For review it's easier to read if you use more context, something like diff -U 8)
Assignee: bienvenu → amantia
OS: Windows XP → All
Hardware: PC → All
Comment on attachment 350339 [details] [diff] [review]
Patch to fix the issue

the problem is that not all imap servers support the kImapMsgForwarded flag, so you would be clearing that flag for users whose servers don't. (unlike replied, marked, and deleted, which are mandated by the rfc).
I tried with two different servers and it worked. Isn't it possible to check if the server supports the flag or not? And if it does, use that line to make it work as it should. Or if it isn't possible to query, build a list of servers that support it, and use it for those servers.
Yes, we do that check in other places in the code - see kImapMsgSupportForwardedFlag and this code:

    PRUint32 supportedFlags;
    GetSupportedUserFlags(&supportedFlags);
    if (supportedFlags & kImapMsgLabelFlags)
      mDatabase->SetLabel(msgKey, 0);

thx for working on this!
In that case the correct solution is straightforward. :)

You're welcome!
Product: Core → MailNews Core
Andras: can you attach an updated patch?
Status: NEW → ASSIGNED
Flags: wanted-thunderbird3+
Target Milestone: --- → Thunderbird 3.0b3
Unfortunately I don't have time in the next weeks to port it, but I'm sure it is easy to do for any developer from Mozilla. :)
This was fixed in bug 561292.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: