Closed Bug 303271 Opened 19 years ago Closed 18 years ago

NS_ERROR_INVALID_POINTER in nsIMsgIdentity.fccFolder (then "place a copy in:" option does not work)

Categories

(Thunderbird :: General, defect)

x86
Windows XP
defect
Not set
major

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 327108

People

(Reporter: coiledchico, Assigned: Bienvenu)

References

Details

(Keywords: dataloss)

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

hello,

i upgraded to thunderbird 1.0.6 and i realized that my emails have not been
saved to my sent folder.  i have a pop3 account and when i go into Account
Setting > coiledchico@comcast.net > Copies & Folders - I see that no box or dot
options are selected. so i click the "place a copy in:", "Sent Folder on:",
"Drafts Folder on:", "Templates Folder on:", and "show confirmation..... when i
press ok to save the settings I went back into the same menu to see if my
changes took.  to my surprise i did not.  thinking it was a bad installation i
reinstalled thunderbird 1.0.6, but the same result happened.  this is a big deal
for me and help would be greatly appriciated.  also if you can point me to a
place where i can install previous 1.0.5 and 1.0.4 versions i would like to test
which version have this problem. thank you.

-scott

Reproducible: Always

Actual Results:  
no options selected

Expected Results:  
selected options stay selected
can you open the javascript console and see if there are any errors listed there?
in the JS console i get this:

"Error: uncaught exception: [Exception... "Component returned failure code:
0x80004003 (NS_ERROR_INVALID_POINTER) [nsIMsgIdentity.fccFolder]"  nsresult:
"0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame ::
chrome://messenger/content/AccountManager.js :: getAccountValue :: line 906" 
data: no]"
ok, somehow your prefs.js got messed up - could you paste its contents into an
e-mail and send it to me and I'll try to see how it's broken? It's in your user
profile dir, c:\documents and settings\<user name>\application
data\thunderbird\profiles...
*** Bug 303272 has been marked as a duplicate of this bug. ***
do you see a Sent mail folder when you look at the coiledchico account in the
folder pane? I wonder if the problem is related to the fact that you've set the
server directory for this account to a directory outside the user profile
directory. Or the fact that the hostname for both server2 and server3 is
"127.0.0.1", though that's less likely to be a factor.

Have you tried a 1.1a2 build?
ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/1.1a2
i do see a sent folder in the pane.

my pop mail directory is on another partician, but i have had no problems with
that for a year before this became an issue.

i am running apache.  would that spike an error with "127.0.0.1"?
i installed 1.1a and the same problem still occurs with the sent mail preferences

also, i dont know if it's a build thing but "<!DOCTYPE overlay SYSTEM
"chrome://imagezoom/locale/imageZoom.dtd"> shows up on the bottom of the main
window in thunderbird 1.1a
do you have any extensions installed? I'd also suggest 1.1a2 instead of 1.a1,
but I doubt this was fixed between 1.1a1 and 1.1a2. Do you get the same error on
the js console with 1.1a1?

the "127.0.0.1" is not a problem by itself - I just thought that having two
hosts with the same name might somehow be an issue, though it's highly unlikely.
OK, the problem is that the uri for the server's root folder is
"mailbox://user@"127.0.0.1" and the uri for the sent folder is
mailbox://user@mail.comcast.net - somehow, either the code to create the root
folder uri changed, or you changed the server name, and the fcc pref didn't get
changed accordingly. Do you remember when you changed the host name? I'll try to
fix the code so that it allows you to fix the fcc folder through the ui...
Assignee: mscott → bienvenu
Status: UNCONFIRMED → NEW
Ever confirmed: true
to be honest i have had the same settings for over two years now and i havent
really changed them so im kind of stuck scratching my head at this.  i did have
the dictionary extension on thunderbird, but i did install it to see if that
would fix it.  after the uninstall it still preforms the way it has with not
being about to save the sent folder options.
OK, that makes it sound like something changed in 1.06 - I wouldn't have
expected that since the .0x releases are mostly intended for security fixes.
I'll look into it - it'll probably turn out to be something I broke :-( In the
meantime, you can edit your prefs.js by hand, after shutting down thunderbird
and making a backup - try replacing the "mail.comcast.net" with "127.0.0.1" in
the fcc pref for that server.
Related to/duplicate of (the bugs mentioned in) Core bug 302960?
I changed 
user_pref("mail.identity.id2.fcc_folder",
"mailbox://coiledchico@mail.comcast.net/Sent");
to
user_pref("mail.identity.id2.fcc_folder", "mailbox://coiledchico@127.0.0.1/Sent");
for both accounts and the problem still remains 

:-(
fyi - i got so tired of this that i just uninstalled thunderbird - deleted the
apps data and the program file files and then re-installed it from scratch and
now it works like a charm
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
ok, thx. But that doesn't make the bug fixed...I'm working on dealing with the
exception that gets thrown...
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
you would have had to edit all three of those prefs (fcc, drafts, and templates)
for the problem to have been fixed - that's what I tried and it worked fine for
me. Sorry I didn't say that earlier.
no problem sir - thank you for all the effort
Status: REOPENED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → FIXED
re-opening to attach fix.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch proposed fix (obsolete) — Splinter Review
The problem was that the user had renamed the host on an account so we had a
.hostname pref and a .realhostname pref. The whole point of these two prefs is
so that a a user can rename a host w/o invalidating all the uri's for that
host. Somehow, the special folder prefs for the identity associated with the
server had uri's that referred to the realhostname, not the host name. I'm not
sure how that happened. In any case, that completely breaks the ui that allows
you to pick the special folders, because exceptions get thrown that break the
loading of the page. So I had to catch exceptions, *and* make
nsMsgIdentity::getFolderPref not return an error when the uri didn't contain a
valid server. I'm open to better suggestions as to how to fix this, but this is
what I came up with.
Attachment #191742 - Flags: superreview?(mscott)
Attachment #191742 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 191742 [details] [diff] [review]
proposed fix

What about am-identity-edit.js ?

>+    try {
>     if (source) {
>       if (isGeneric) {
>         if (!(type in gGenericAttributeTypes))
>@@ -919,6 +920,10 @@ function getAccountValue(account, accoun
>       accountValues[type][slot] = null;
>     }
>   }
>+    catch (ex) {
>+      dump(ex);
>+    }
>+  }
Should you ensure accountValues[type][slot] is set to null somewhere?
(Currently it seems to rely on lots of else's which only adds to the
confusion.)

>+    try
>+    {
>     var msgFolder = GetMsgFolderFromUri(uri, false);
>     SetFolderPicker(msgFolder.server.serverURI, accountPickerId);
>+    }
>+    catch (ex) { dump (ex);}
GetMsgFolderFromUri already uses try/catch, so you just need to check that
msgFolder is not null.
Attached patch proposed fixSplinter Review
this addresses two of your comments, Neil (about nulling out accountValues[type][slot], and checking for a null msgFolder instead of using try catch. am-identity-edit.js is OK because it doesn't do a get of the special folders, only a set.

This patch extends the previous patch with a couple more try/catches that make it so I don't have to change nsMsgIdentity.cpp to not return an error when it has an error. Instead, I catch the exceptions in the js.
Attachment #191742 - Attachment is obsolete: true
Attachment #203024 - Flags: review?
Attachment #191742 - Flags: superreview?(mscott)
Attachment #191742 - Flags: review?(neil.parkwaycc.co.uk)
Keywords: dataloss
David, your workaround worked for me. Thanks a lot. :-)  Here is what I did:

1. lookup your default account in prefs.js, e.g.

   user_pref("mail.accountmanager.defaultaccount", "account5");

2. lookup the corresponding identity, e.g.

   user_pref("mail.account.account5.identities", "id3");

3. for all _folder values corresponding to this id,

   (e.g. mail.identity.id3.draft_folder
         mail.identity.id3.fcc_folder
         mail.identity.id3.stationary_folder)

   edit the hostname in the uri so that it is the correct one
I'm seeing the same regression in the mozilla suite 1.7.12 in mozilla mail . This worked fine in 1.7.0 . I haven't found a way to fix it even with all the suggestions here. Any idea ?
(In reply to comment #19)
> Somehow, the special folder prefs for the identity associated with the
> server had uri's that referred to the realhostname, not the host name. I'm not
> sure how that happened.

David, see Bug 213300.

Many of problems(INVALID bugs) were generated by anti-virus softwares, by changing hostname instead of adding/replacing realhostname when automatic modification of prefs.js for their proxy type mail scanning.
These anti-virus softwares don't update mail folder related URI's in prefs,js, even though change hostname.

If user changes server name back from 127.0.0.1 to original thru UI after change of hostname to 127.0.0.1 by anti-virus software, hostaname is kept as 127.0.0.1 and realhostname of original server name is generated by UI.
Isn't this the case?

Note:
Some of anti-virus softwares already resolved their bug by adding/replacing realhostname instead of changing hostname.
And some of them resolved problem by transfering from proxy type(need to change prefs.js) to port scan type(no need to change prefs.js).
Symantec's Norton Internet Security 2005 or later is latter one.
(In reply to comment #22)
> David, your workaround worked for me. Thanks a lot. :-)  Here is what I did:
> 
> 1. lookup your default account in prefs.js, e.g.
> 
>    user_pref("mail.accountmanager.defaultaccount", "account5");
> 
> 2. lookup the corresponding identity, e.g.
> 
>    user_pref("mail.account.account5.identities", "id3");
Doesn't work on Thunderbird 1.5.0.1 on Linux(FC3/GNOME 2.6).

> 3. for all _folder values corresponding to this id,
> 
>    (e.g. mail.identity.id3.draft_folder
>          mail.identity.id3.fcc_folder
>          mail.identity.id3.stationary_folder)
> 
>    edit the hostname in the uri so that it is the correct one
> 

(In reply to comment #23)
> I'm seeing the same regression in the mozilla suite 1.7.12 in mozilla mail.
> This worked fine in 1.7.0 . I haven't found a way to fix it even with all the
> suggestions here. Any idea ?
(In reply to comment #25)
> Doesn't work on Thunderbird 1.5.0.1 on Linux(FC3/GNOME 2.6).

Julien Pierre and Hiroshi Iwatani, your problem is Exception itself? Or somehow saving to a folder doesn't work?
As you see in comment #19 and comment #20, developers are trying to resolve exception issue when inconsistency was made by some others in this bug.
So, if latter, join in Bug 312180.
We are trying to find who made prefs.js inconsistency which will produce exception in Bug 312180.
 
Changing summary for ease of search.
Summary: "place a copy in:" option does not work → NS_ERROR_INVALID_POINTER in nsIMsgIdentity.fccFolder (then "place a copy in:" option does not work)
the fix in bug 327108 should fix this as well.

*** This bug has been marked as a duplicate of 327108 ***
Status: REOPENED → RESOLVED
Closed: 19 years ago18 years ago
Resolution: --- → DUPLICATE
Attachment #203024 - Flags: review?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: