Last Comment Bug 187798 - Recipient column in Drafts (and Template) folder contains Sender for message with no recipient
: Recipient column in Drafts (and Template) folder contains Sender for message ...
Status: RESOLVED FIXED
[gs]
: helpwanted
Product: MailNews Core
Classification: Components
Component: Backend (show other bugs)
: Trunk
: All All
: -- minor with 1 vote (vote)
: Thunderbird 24.0
Assigned To: Suyash Agarwal (:sshagarwal)
:
:
Mentors:
http://gsfn.us/t/ow17
: 318100 542261 (view as bug list)
Depends on:
Blocks: tb-drafts
  Show dependency treegraph
 
Reported: 2003-01-05 10:33 PST by Jean-Pierre Matsumoto
Modified: 2013-06-25 05:18 PDT (History)
10 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Patch (1.17 KB, patch)
2013-06-12 15:11 PDT, Suyash Agarwal (:sshagarwal)
acelists: feedback+
Details | Diff | Splinter Review
Patch (1.15 KB, patch)
2013-06-15 13:47 PDT, Suyash Agarwal (:sshagarwal)
neil: review+
Details | Diff | Splinter Review

Description Jean-Pierre Matsumoto 2003-01-05 10:33:23 PST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030105
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030105

If you compose a message with no recipient and if you save it as draft, the
recipient column in Draft folder contains Sender (your name) instead of nothing
(or something like "no recipient").

Reproducible: Always

Steps to Reproduce:
1.Open Mail module
2.Click on button Compose
3.Write some words in the body of mail
4.Write anything in Subject
5.Save it as draft (File > Save As > Draft)
6.Go to your Drafts folder


Actual Results:  
Recipient column for your draft mail contains your name.

Expected Results:  
Recipient column for your draft mail should contain nothink (blank) or something
like "no recipient".

Does this bug has a link with bug 36488 ?
Comment 1 Mike Cowperthwaite 2003-11-01 12:11:51 PST
This is true in
  Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007

Couldn't find a dupe, confirming.
Comment 2 Serge Gautherie (:sgautherie) 2004-04-18 11:51:56 PDT
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7b) Gecko/20040316] (W98SE)

I tracked the folder loading code to
{{
<http://lxr.mozilla.org/mozilla/source/mailnews/base/resources/content/threadPane.js>
406 function RerootThreadPane()
407 {
408   var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView);
409   if (treeView)
410   {
411     var tree = GetThreadTree();
412    
tree.boxObject.QueryInterface(Components.interfaces.nsITreeBoxObject).view =
treeView;
413   }
414 }
}}

The tree rows load in the UI after line 412 execution.

Wild-guessing, I suspect 'Recipient' value is non-existent, then something
defaults to 'From' value !??

neil:
Where (file) and How (DomI/JS.D./ or is it Cpp) can I see the actual data
feeding (code) ?
(to see why 'From' value is displayed in 'Recipent' column)
Comment 3 neil@parkwaycc.co.uk 2004-04-18 16:59:52 PDT
Sorry, this is a difficult one... it's actually stored like this in the summary
file, you'd have to find the code that summarizes messages and remove the bit
that substitutes the author if no recipients are specified, wherever that might
be, somewhere in the dark C++ depths no doubt.
Comment 4 Wayne Mery (:wsmwk, NI for questions) 2005-09-29 09:05:54 PDT
visible on Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1)
Gecko/20050913 SeaMonkey/1.1a
Comment 5 Mike Cowperthwaite 2005-11-29 08:36:12 PST
Moving to Core per comment 3 (dupe from TB forthcoming).
Comment 6 Mike Cowperthwaite 2005-11-29 08:36:20 PST
*** Bug 318100 has been marked as a duplicate of this bug. ***
Comment 7 Thomas D. (needinfo?me) 2010-08-12 10:37:46 PDT
7 years later, still found in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2
Comment 8 Ludovic Hirlimann [:Usul] 2010-08-13 01:30:28 PDT
*** Bug 542261 has been marked as a duplicate of this bug. ***
Comment 9 Thomas D. (needinfo?me) 2013-06-09 11:55:47 PDT
Suyash Agarwal (:sshagarwal), I think your excellent work patch in Bug 522886 (implementing all-recipients column) must be touching the very same areas of C++ code where this little bug is located. Perhaps you have even seen this when doing your code. So I thought this might be interesting for you, and perhaps you can shine a light into the "dark C++ depths" mentioned in comment 3:

(In reply to neil@parkwaycc.co.uk from comment #3)
> Sorry, this is a difficult one... it's actually stored like this in the
> summary file, you'd have to find the code that summarizes messages and remove
> the bit that substitutes the author if no recipients are specified, wherever
> that might be, somewhere in the dark C++ depths no doubt.
Comment 10 :aceman 2013-06-09 14:45:29 PDT
From our tests it seems the Recipient being 'me' is not seen in the message itself (no To: field), but stored in the .msf database of the folder.
When the Recipient value is displayed in http://mxr.mozilla.org/comm-central/source/mailnews/base/src/nsMsgDBView.cpp#488, unparsedRecipient in that function gets the 'me' value.

Mkmelin, do you have an idea where this is coming from when saving as draft?
Comment 11 Magnus Melin 2013-06-11 11:26:54 PDT
No idea, sorry.
Comment 12 Suyash Agarwal (:sshagarwal) 2013-06-12 15:11:45 PDT
Created attachment 761739 [details] [diff] [review]
Patch

This patch makes the recipients field blank if no recipients are specified. If you want me to display some sort of string like "no-recipients" etc, please let me know.
Comment 13 :aceman 2013-06-12 16:21:37 PDT
Comment on attachment 761739 [details] [diff] [review]
Patch

Review of attachment 761739 [details] [diff] [review]:
-----------------------------------------------------------------

So this seems to work. I just wonder if there wasn't a reason this was intentionally filled with the sender instead of nothing. Maybe some other code will break now? Have you run tests with this?

Credits go to Neil for finding the right code spot ;)
Comment 14 :aceman 2013-06-12 16:35:37 PDT
Oh, just fix the patch description line.
Comment 15 Suyash Agarwal (:sshagarwal) 2013-06-15 13:47:13 PDT
Created attachment 763144 [details] [diff] [review]
Patch

Fixed the patch description. And there seems to be no breakage because of my patch.
Comment 16 neil@parkwaycc.co.uk 2013-06-16 03:01:49 PDT
Comment on attachment 763144 [details] [diff] [review]
Patch

This looks as if it should work for POP accounts. Anyone tried IMAP yet? (It might not even have the bug.)
Comment 17 neil@parkwaycc.co.uk 2013-06-16 03:12:44 PDT
Comment on attachment 763144 [details] [diff] [review]
Patch

Actually it looks like IMAP converts the ENVELOPE into dummy headers which it then eventually sends through this function, so that's already covered.
Comment 18 Ryan VanderMeulen [:RyanVM] 2013-06-18 08:27:09 PDT
https://hg.mozilla.org/comm-central/rev/4590ee122e96

Note You need to log in before you can comment on or make changes to this bug.