Closed Bug 1769270 Opened 2 years ago Closed 2 years ago

Unexpected prompt for IMAP passwords saved in Password Manager on upgrade

Categories

(Thunderbird :: General, defect)

defect

Tracking

(thunderbird_esr91 unaffected)

RESOLVED FIXED
102 Branch
Tracking Status
thunderbird_esr91 --- unaffected

People

(Reporter: kevin, Assigned: rnons)

References

Details

Attachments

(1 file)

Upon starting Thunderbird Daily build 20220513100342, I was prompted for the password to each of my configured IMAP mail accounts, which were previously saved in Password Manager. If I re-enter the passwords and check "Use Password Manager to remember this password." the passwords are used on subsequent launches of build 20220513100342, suggesting that the issue is with using passwords saved from previous builds.

Pushlog: https://hg.mozilla.org/comm-central/pushloghtml?fromchange=a4378aaa8c1416ef42fe533b57eb54ac0f01ce37&tochange=90cd14f0f40667853b6dea83b4da6bf7bd1a4320

Possibly regressed by Bug 1483485?

Blocks: 1483485

I think this is expected if you have changed hostname/username before, the old code was inconsistent. When changing hostname/username, password is cleared first https://searchfox.org/comm-esr91/rev/52d381b0b0e38dacf1fb250326193967a466ba65/mailnews/base/src/nsMsgIncomingServer.cpp#1125,
then new password is asked, but old hostname/username is still used to save the password https://searchfox.org/comm-esr91/rev/52d381b0b0e38dacf1fb250326193967a466ba65/mailnews/base/src/nsMsgIncomingServer.cpp#703,713

After bug 1483485, the old hostname/username is gone, so the password could not be found in the LoginManager.

I don't have a good solution for this, maybe we can add some code to migrate entries in LoginManger, but I don't know if that's good.

Good to know. Thanks :rnons. I think the server hostname has changed since I first saved the password, so that's consistent with expectations. It's a minor issue for me, but it may be a bigger deal for some of my less tech savvy colleagues. Not sure whether it's worth the effort to migrate. If not, feel free to close.

Assignee: nobody → remotenonsense
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Also migrate passwords in MailnewsMigrator when removing realhostname/realusername.

I don't know if your patch fixes it yet, but I have the problem with NNTP as well.

But there the newly entered credentials are not accepted for saving.
I get the exception:

10:11:11.443 NS_ERROR_FAILURE: This login already exists. 2 LoginHelper.jsm:1752
    createLoginAlreadyExistsError resource://gre/modules/LoginHelper.jsm:1752
    addLogin resource://gre/modules/LoginManager.jsm:323
    promptUsernameAndPassword resource:///modules/MsgAsyncPrompter.jsm:334
    _promiseAuthPrompt resource:///modules/MsgAsyncPrompter.jsm:54
    _promiseAuthPrompt resource:///modules/MsgAsyncPrompter.jsm:52
    run resource:///modules/MsgAsyncPrompter.jsm:77
    InterpretGeneratorResume self-hosted:1472
    AsyncFunctionNext self-hosted:682

If I then select another article in the same group, I get a login dialog without a "save option" and can then work temporarily.
But if I select another group I always get the first dialog with "Save" option. With the same result. Even after a restart of the TB.

What helps is to delete the userName entry manually from the Prefs.js.

If the problem persists there, I can also create a new bug for it.

My patch only work if you still have the realhostname/realusername prefs.

What helps is to delete the userName entry manually from the Prefs.js.

Open the password manager and edit there should be easier.

Also, I don't think MsgAsyncPrompter.jsm is used by nntp-js, did you disabled nntp-js?

(In reply to Ping Chen (:rnons) from comment #6)

My patch only work if you still have the realhostname/realusername prefs.

What helps is to delete the userName entry manually from the Prefs.js.

Open the password manager and edit there should be easier.

Deleting the entry will help only once. Since the userName pref is not deleted, the problem is back after the next restart.

Also, I don't think MsgAsyncPrompter.jsm is used by nntp-js, did you disabled nntp-js?

Yes. But nntp-js doesn't change much either:

11:20:14.582 NS_ERROR_FAILURE: This login already exists. 3 LoginHelper.jsm:1752
    createLoginAlreadyExistsError resource://gre/modules/LoginHelper.jsm:1752
    addLogin resource://gre/modules/LoginManager.jsm:323
    promptUsernameAndPassword resource:///modules/MsgAsyncPrompter.jsm:334
    _actionAuthUser resource:///modules/NntpClient.jsm:644
    _nextAction resource:///modules/NntpClient.jsm:409
    _onData resource:///modules/NntpClient.jsm:154

Since the userName pref is not deleted, the problem is back after the next restart.

I don't get it, the error is This login already exists, if the entry is deleted, then the error should be gone.

Target Milestone: --- → 102 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/5ab12ec62b43
Migrate password when changing hostname/username. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
OS: Linux → All
See Also: → 1770594
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: