Mozilla does not set or recognize the \Draft flag on IMAP messages



17 years ago
10 years ago


(Reporter: dewb, Assigned: Bienvenu)


(Blocks: 1 bug, {fixed1.8.1, imap-interop, polish})

Windows 2000
fixed1.8.1, imap-interop, polish
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)



(2 attachments)



17 years ago
MailNews does not appear to set the "Draft" IMAP flag (defined in section 2.3.2 
of RFC 2060 - IMAP v4r1) on drafts saved to a folder on the IMAP server (or to 
a local folder.)

What I did:
1) Logged into my IMAP account with Mozilla Mail.
2) Composed a new message in Mozilla.  Saved it but did not send it.  Mozilla 
is configured to save drafts to INBOX\Drafts on the IMAP server.  Message 
successfully saved.
3) Logged into my IMAP account with Outlook Express.
4) Composed a new message in OE.  Saved it but did not send it.  OE saved draft 
to local folder, dragged it to INBOX\Drafts on server.
5) Logged into my IMAP account using Horde/IMP-based webmail client.
6) Composed a new message using IMP.  Saved it but did not send it.  IMP saved 
draft to INBOX\webmail-drafts.  Dragged it to INBOX\Drafts.

There are now three drafts in INBOX\Drafts.  The two drafts created by OE and 
IMP show the "draft" icon when the folder is viewed in IMP or OE.  Clicking on 
either message in IMP or OE will bring the message up in "compose" mode.

The draft created by Mozilla does not show the "draft" icon, and clicking on 
the message brings up the standard message display rather than the compose 

Mozilla does not appear to respect the "draft" flag when it is set by other 
clients -- clicking any of the three messages in Mozilla brings up the message 
in the standard rather than the compose window.  You have to choose "Edit as 
New..." instead.

It would be nice if Mozilla went directly to the compose window when clicking 
messages flagged as drafts, but that's probably a separate bug.

Comment 1

17 years ago
This is probably dependent on 81340.  I don't think it's a duplicate because 
Mozilla isn't creating the Draft flag locally, either.
Depends on: 81340


16 years ago
QA Contact: huang → gchan

Comment 2

15 years ago
Marking New; confirmed here:
I don't think this depends on Bug 81340: I see this bug but not that one.
Reassigning to defaults, as Scott's gone. :(
Assignee: mscott → bienvenu
Ever confirmed: true
Summary: Mozilla does not set or recognize the Draft flag on IMAP messages → Mozilla does not set or recognize the \Draft flag on IMAP messages

Comment 3

14 years ago
Any chance that Thunderbird dislpays the IMAP \Draft flag soon ? This is a kind
of major oversight.
Product: MailNews → Core
Keywords: interop


14 years ago
Blocks: 253255

Comment 4

14 years ago
IMHO, keywords on this bug be changed to:
interop mail1 mail6 mailtrack polish


13 years ago
No longer blocks: 253255
*** Bug 253255 has been marked as a duplicate of this bug. ***

Comment 6

13 years ago
Duplicate Bug 253255 links to trace logs and pinpoints around where in the code the problem appears to be. I see calls to Store; ProcessStoreFlags and SetupMessageFlagsString will flagString.Append("\\Draft ") if told to.

Rolfe: Adding keywords: mail6, polish; mailtrack is only to be added by the "Mail Team", whomever that is.  mail1 doesn't seem to apply; this isn't about speed/performance optimization.
Keywords: mail1, mail6, mailtrack, polish

Comment 7

12 years ago
Created attachment 243289 [details] [diff] [review]
Unified diff for propose solution to but 156347

This patch checks to see if the ImapUrl currently being run was appending a draft from a file.  If so, it sets the kImapMsgDraftFlag, such that the \Draft IMAP flag is set on the message.

Comment 8

12 years ago
Comment on attachment 243289 [details] [diff] [review]
Unified diff for propose solution to but 156347

--- ../../../../new/mozilla/mailnews/imap/src/nsImapProtocol.cpp        2006-08-10 13:24:08.000000000 -0700
+++ nsImapProtocol.cpp  2006-10-23 21:51:15.000000000 -0700
@@ -5276,6 +5276,11 @@
       // convert msg flag label (0xE000000) to imap flag label (0x0E00)
       if (msgFlags & MSG_FLAG_LABELS)
         flagsToSet |= (msgFlags & MSG_FLAG_LABELS) >> 16;
+      // If the message copied was a draft, flag it as such
+      nsImapAction imapAction;
+      rv = m_runningUrl->GetImapAction(&imapAction);
+      if (NS_SUCCEEDED(rv) && (imapAction == nsIImapUrl::nsImapAppendDraftFromFile))
+               flagsToSet |= kImapMsgDraftFlag;
       UploadMessageFromFile(fileSpec, mailboxName, flagsToSet);
       PR_Free( mailboxName );

Comment 9

12 years ago
very nice, Greg, thx for the patch. I'll try it out.

Comment 10

12 years ago
Created attachment 243535 [details] [diff] [review]
Greg's patch
Attachment #243535 - Flags: superreview+

Comment 11

12 years ago
I checked the patch in on the trunk - marking fixed. As the reporter says, we can open a new bug for recognizing the drafts flags. Thx again, Greg.
Last Resolved: 12 years ago
Resolution: --- → FIXED

Comment 12

12 years ago
fixed on 2.0 branch
Keywords: fixed1.8.1
Blocks: 360390
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.