Closed Bug 23416 Opened 25 years ago Closed 24 years ago

IMAP-to-IMAP copy sets \Seen flags

Categories

(MailNews Core :: Backend, defect, P3)

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jgmyers, Assigned: Bienvenu)

References

Details

(Whiteboard: Fix in hand)

Select a range of IMAP messages in one account, where some messages are not
\Seen.  Select "Message/Copy Message" and select a folder on a different IMAP
server.

The messages are marked as \Seen in both the source and destination folders.
They should be left as unseen in both places.
Jeff, I think this means you should use peek to fetch the message body from the
first server (which is what the downloading for offline use code did in 4.5).
Not sure why the \Seen flag is getting set on the second server.
QA Contact: lchiang → huang
Assignee: phil → jefft
Reassign to jefft
Status: NEW → ASSIGNED
Target Milestone: M13
Assignee: jefft → bienvenu
Status: ASSIGNED → NEW
Reassign to David...
Target Milestone: M13 → M14
moving to m14 - lot of work involved in reworking imap message copying.
Status: NEW → ASSIGNED
Accepting. I'm mostly finished coding this, but I have a lot of testing to do.
I've fixed this for copying to local folders, but I don't know if it fixes it
for copying to other imap servers. I think that goes through some special imap
code and a temp file.
In other words, it marks the original messages in the source folder read, even 
though you haven't read them.
Keywords: beta1
Whiteboard: [pdt-]
To me, this is data loss. It would suck to ship a beta that lost data this way.
If you want this revisited, David, clear the white board status field.
Target Milestone: M14 → M17
*** Bug 40678 has been marked as a duplicate of this bug. ***
moving to M18 and nominating for beta3.
Keywords: nsbeta3
Target Milestone: M17 → M18
I just lost the read status on 900+ messages due to this, which will cost me a
lot of time.  Going to another IMAP server, it marks them all read on the source
and destination. I think it is dogfood, but I'm nominating for nsbeta2
Keywords: nsbeta2
Whiteboard: [pdt-]
Putting on [nsbeta2-] radar. Not critical to beta2. 
Whiteboard: [nsbeta2-]
I've investigated this a bit.  The \Seen flags are not being set on the source 
IMAP server, they're just being set in the thread pane and in the destination 
IMAP server.  If you switch to some other folder and then come back to the 
source folder, the original flag state appears.

I suspect something in the IMAP-to-IMAP copy code is not handling the lack of a 
FLAGS attribute in the source server's FETCH response.
Keywords: beta1, nsbeta2correctness
Whiteboard: [nsbeta2-]
I fixed the \SEEN flag problem a long time ago when I rewrote the imap move/copy
stuff to do all the messages at once instead of one at a time. The apparent
marking read business is because the code that we use to mark a message read in
the local database when the user reads a message is also getting called when we
move/copy imap messages to a local folder or another imap server. So, the msg
gets marked read in the local db, and this is reflected in the thread pane. But
if you shut down and restart, the folder flags will be resynchronized with the
server, and the unreadness will be correct.
The incorrect \Seen status is also getting copied to the destination, thus data 
loss.  In an IMAP client, there should be no code to so mark a message read in 
the local database.  The client should let the server do this (by the server's 
sending a FETCH FLAGS response).

the problem here is that the code that uploads a msg from a file and appends it
to an imap folder ALWAYS marks the message as \Seen. It does this, I believe, to
make sure that messages appended to the sent folder or the drafts folder are
marked read. For the general case of moving/copying messages, we want to
maintain the read/seen state. Unfortunately, this is very difficult since at the
point we're marking these messages \Seen, we've long since forgot whether the
original message was seen; in fact, we have no idea what the original message was.
Whiteboard: Fix in hand
fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
This bug should be verified long time ago....
Verified copying messages are left as unseen in both the source and destination 
folders for different IMAP servers. (10-17-18-0.9.4 build)

Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.