Closed Bug 229817 Opened 21 years ago Closed 20 years ago

smart-identity when composing message also for Local Folders

Categories

(MailNews Core :: Composition, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ch.ey, Assigned: ch.ey)

References

Details

Attachments

(1 file, 1 obsolete file)

With the patch from bug 18906, replying to a message chooses the From: out of the recipients if an identities address for this folder matches one. That works for all accounts folders - except for Local Folders. But I think it should also work here (e.g. because some people collect all messages in this special folder resp. its subfolders). I guess extending getIdentityForServer() in mailCommands.js with something like @@ -100,6 +1668,10 @@ function getIdentityForServer( server, optionalHint ) if (identities.Count() > 0 ) { identity = getBestIdentity(identities, optionalHint); } + else { + identities = accountManager.GetAllIdentities(); + identity = getBestIdentity(identities, optionalHint); + } } return identity; would help. This catches the case where GetIdentitiesForServer(server) returns no identities which is the case for the "server" Local Folders. The reason why I don't make a real patch and test it is, that I can't get identities = accountManager.GetAllIdentities() to work. But maybe I'm on the right way and someone else can help.
Keywords: helpwanted
Assignee: mscott → ch.ey
Keywords: helpwanted
Attached patch proposed patch (obsolete) — Splinter Review
Ok, the solution was to easy ... So here's the patch I wrote about in comment #0.
Attachment #138509 - Flags: review?(mscott)
Attachment #138509 - Flags: review?(mscott)
Attached patch patch v2Splinter Review
I guess that's better. Another test for identities.Count() > 0 after getting allIdentities should be unnecessary.
Attachment #138509 - Attachment is obsolete: true
Attachment #138510 - Flags: review?(mscott)
one thing that worries me about this patch Christian is that it adds a lot of risk I think. With my initial change, we only iterate over identities you have specifically added for an account. This change causes us to iterate over all the identities for all accounts for any account that does not have any identities. What if you reply to a message in local folders and your email address is the same for your mail account and say a news account. Well now we accidentally pick your news account identity when you are really trying to reply to mail. That's the kind of thing that worries me.
Yes, I know this potential problems. Part 1 could be solved by only loading more identities when having Local Folders selected. But what's the right and reliable way to determine this? Although it's very unlikely that other accounts without any identity exists. Part 2 - Should we exclude identities assigned to news accounts? But what if a identity is assigned to a mail account and a news account? It would be quite complicated anyway. What are the alternatives? I'm not one of the persons using Local Folders as main folder, but know that's an often asked feature.
This has now become interesting again. With patches from bug 30057, mails from any account can be inserted into Local Folders/Inbox. And the new X-Account-Key header in these messages can be used to get the server for the call of getIdentityForServer().
Christian, do we need a new version of the patch that looks for X-Account-Key and leverages that? Or should we wait until David's finished with that bug and then modify this to work with the new feature.
I think a complete new patch with another approach is necessary. And yes, I'd wait until David's work is (nearly) finished.
this is on my list of things to think about as part of the global inbox work...
*** Bug 201176 has been marked as a duplicate of this bug. ***
Closing this since Davids global inbox code (bug 30057) also takes the originating accounts identities into account when searching for the right one.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
*** Bug 260097 has been marked as a duplicate of this bug. ***
Product: MailNews → Core
Attachment #138510 - Flags: review?(mscott)
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: