Closed Bug 215620 Opened 21 years ago Closed 21 years ago

imap.myrealbox.com never sends FLAGS for FETCH BODY[]

Categories

(MailNews Core :: Networking: IMAP, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: neil, Assigned: Bienvenu)

Details

Attachments

(1 file, 2 obsolete files)

RFCs 1730 and 2060 say that a FETCH BODY[] sets the \Seen flag and SHOULD notify
the UA that it has done so. However Mozilla only updates its internal database
when the flags are sent, it does not assume that the flag is set. On some
servers this means that a biff occuring after having read mail appears to mark
the messages unread, although they are marked as read on the server.
Attached patch Possible patch (obsolete) — Splinter Review
Not sure that I've followed the RFC correctly, but it suggests that any FETCH
BODY[ will set \Seen so I thought it best to fetch the FLAGS on every BODY[
I'd rather not always fetch the flags. It's just making more work for the
server, especially in the case where the /SEEN flag is already set. My thought
was just to update the /SEEN flag in the client uid-flag state array when we've
finished a BODY FETCH command. I'll try to attach a patch this weekend for you
to try. But first of all, does your patch fix the problem you were seeing?
Status: NEW → ASSIGNED
Well, the reason I did it that way is because I couldn't figure out how else to
distinguish between a FETCH BODY[] and a FETCH BODY.PEEK[] as the response from
imap.myrealbox.com is the same either way.

I won't be able to test this until Monday at the earliest.
the imap code knows what it's fetching. I have a patch coded up that I'll attach
tomrrow.
Well, my patch does work so far as I don't see any messages becoming unread,
even when checking for new mail every minute.
Comment on attachment 129495 [details] [diff] [review]
Possible patch

No, this is no good. My second IMAP server doesn't set the \Seen flag if you
explicitly fetch the flags at the same time :-(
Attachment #129495 - Attachment is obsolete: true
Comment on attachment 129495 [details] [diff] [review]
Possible patch

No, this is no good. My second IMAP server doesn't set the \Seen flag if you
explicitly fetch the flags at the same time :-(
Attached patch possible fix (obsolete) — Splinter Review
this is roughly what I had in mind - I'm probably going to have to move the
code that actually stores the seen flag in the flag and uid state but it should
fix the problem for you in most cases.
Attached patch proposed fixSplinter Review
this is my proposed fix - when we're fetching a single message for display,
update our flag state to store the seen flag, in case the server doesn't do
what it "should" :-)
Attachment #129593 - Attachment is obsolete: true
Don't you have to do a check for nsImapMsgFetchPeek?

Of course, if you only want to mark messages read when you display them, you
could peek all messages, and then get the display to mark the message as read
once it's completed loading, or perhaps 5 seconds after, for ex-Outlook users...
where I put the code, we're never peeking.

re your second comment, yes, we could do that, if we ever felt it was high
enough priority :-)
Well, possibly due to some very bad indentation in that file, I can't figure out
why you're never peeking, so I'll just have to try it for myself tommorrow.
I've fixed all the indentation, but I attached a -uw diff.
Comment on attachment 129600 [details] [diff] [review]
proposed fix

r/sr/a=sspitzer for 1.5 beta

bienvenu says he won't check in the change to src/nsImapUtils.cpp (it is part
another bug).
Attachment #129600 - Flags: superreview+
Attachment #129600 - Flags: review+
Attachment #129600 - Flags: approval1.5b+
Comment on attachment 129600 [details] [diff] [review]
proposed fix

Just tried this... so far, so good!
fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: