Open Bug 1936274 Opened 2 months ago Updated 2 months ago

Leftover EWS configuration breaks account manager (cannot remove account)

Categories

(Thunderbird :: Account Manager, defect)

defect

Tracking

(Not tracked)

People

(Reporter: KaiE, Unassigned)

References

(Blocks 1 open bug)

Details

Using 128.5.1 I cannot use account manager to remove accounts.
Cliing the "Account Actions" button gives me a disabled "Remove Account" button for all accounts.

I have currently 4 accounts.

I get an error in error console:

Uncaught NS_ERROR_NOT_INITIALIZED: Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMsgOutgoingServer.serverURI]
    loadSMTPServerList chrome://messenger/content/am-identity-edit.js:544
    onPreInit chrome://messenger/content/am-main.js:98
    restorePage chrome://messenger/content/AccountManager.js:1477
    onPanelLoaded chrome://messenger/content/AccountManager.js:1290
    <anonymous> chrome://messenger/content/am-main.js:15
2 am-identity-edit.js:544

On the linux terminal I get:

[ERROR ews_xpcom::outgoing] tried retrieving a URI for the server before initializing it with an EWS URL

I currently don't have any EWS account configured.

It looks like I had previously used this profile to test the state of EWS in the 128 version, before learning that support on the 128 branch is incomplete.

So, I must have previously added an EWS account, and afterwards I must have deleted it.

However, despite that, I still have references to EWS in my settings, in particular:
grep -i ews1 prefs.js

user_pref("mail.smtpserver.ews1.clientid", "d4ef960b-01c8-4781-b896-7bb36938d18a");
user_pref("mail.smtpserver.ews1.type", "ews");
user_pref("mail.smtpservers", "smtp1,smtp2,smtp3,ews1,ews2,smtp4");

In loadSMTPServerList(), inside the looping of the servers, I added
console.log(server);

Manually inspecting the results, I confirm the exception is shown for the SMTP server with key "ews1".

In account settings, when looking interactively at the list of SMTP servers I have configured, (lower left, outgoing smtp servers), I get a list of three regular SMTP servers, only. No reference to EWS.

Apparently the GUI removal of the EWS account had not removed the reference to the EWS server.
Could you please check that going forward this cleanup will be complete?

I see that the statement that breaks was added in bug 1882574,

    serverName += server.serverURI.host;

Maybe you can add some checks in that function, to skip over invalid SMTP server entries in that list.

I manually edited prefs.js to remove the ews1 and ews2 entries from mail.smtpservers

After that and restarting, my list of outgoing servers in the GUI has 4 entries, so the consequences of that entry are more widespread, it also prevents proper init of these sections.

It looks like there might be a bug in our implementation of nsIMsgOutgoingServerService::deleteServer (defined here) or whatever called it when you deleted your EWS account - it should definitely have at least removed the ewsX keys from mail.smtpservers.

I don't think the underlying bug is specific to EWS, but I'll add it to the EWS bugs pile so we can investigate how trying to access bogus outgoing servers might impact account deletion (since EWS might be a bit strict when being used with an invalid config).

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