Closed Bug 1483485 Opened 6 years ago Closed 2 years ago

Changing IMAP server name in Server Settings does has no effect on IMAP folder address/location/URI in Inbox folder Properties

Categories

(Thunderbird :: Account Manager, defect)

defect
Not set
normal

Tracking

(thunderbird_esr91 wontfix)

RESOLVED FIXED
102 Branch
Tracking Status
thunderbird_esr91 --- wontfix

People

(Reporter: mail, Assigned: rnons)

References

Details

(Keywords: ux-implementation-level)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0
Build ID: 20100101

Steps to reproduce:

* add a mail account using the assistant
* in account settings: change its IMAP server from old.example.com to new.example.com
* right-click on my inbox folder, click properties, look at the folder address


Actual results:

"imap://foo%40example.org@old.example.com/INBOX"


Expected results:

"imap://foo%40example.org@new.example.com/INBOX"
Component: Folder and Message Lists → Account Manager
We keep track of old server and new server internally. It's really confusing and leads to a few bugs. We need to revise that whole area.
See Also: → 1414607
Blocks: 1573690

This may or may not be a bug in technical terms, but it's a bug in terms of UX at least (UX-implementation-level).
Even if perhaps we're still using the original/old server name internally (so the Location property might still be technically correct, don't know), exposing that to the user without some in-place explanation appears pretty irritating.

Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Unspecified → All
Hardware: Unspecified → All
Summary: Changing IMAP server does not update IMAP folder address → Changing IMAP server name in Server Settings does not update IMAP folder address/location/URI in Inbox folder Properties
Summary: Changing IMAP server name in Server Settings does not update IMAP folder address/location/URI in Inbox folder Properties → Changing IMAP server name in Server Settings does has no effect on IMAP folder address/location/URI in Inbox folder Properties

My e-mail provider changed the IMAP server address, so I changed it accordingly in Thunderbird settings for this account.
When trying to retrieve new messages from this account, it still tries to connect to the outdated IMAP server address and fails therefore.

Thomas D. wrote, "This may or may not be a bug in technical terms...". If it is so: how can I change the IMAP server address, if the intial set one is outdated (no more in use)?

Two changes:

  • On server/user name change, save to temporary .pendinghostname/.pendinguserName pref
  • On start up, replace the value of .hostname/.userName with .pendinghostname/.pendinguserName or .realhostname/.realuserName

With this change, .realhostname and .realuserName becomes obsolete, related code will be removed in a follow-up patch.

Assignee: nobody → remotenonsense
Status: NEW → ASSIGNED

Skip and fix a few tests.

Depends on D144790.

Target Milestone: --- → 102 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/3b683e321528
Require a restart after changing server or user name. r=mkmelin
https://hg.mozilla.org/comm-central/rev/e7602ee8cf16
Remove realHostName/realUsername from nsIMsgIncomingServer. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Depends on: 1769270
Regressions: 1769732
See Also: → 1770594
Regressions: 1773511
Regressions: 1773618

I haven't read the full patch but does changing the name (by the user) now also modify Folder URIs?

Internal / silent Folder URI modification can have breaking consequences on my side (QuickFolders Add-on) because it uses them to persist folder locations. see https://github.com/RealRaven2000/QuickFolders/issues/281

It would be great if any circumstances that can modify folder URIs (apart from the obvious which is renaming / moving a folder) based on server settings / modification were documented in some place.

Just an update on this - here is how I remedy the problem from an Add-ons writer's perspective. QuickFolders now also stores the account id (e.g. "account1" together with the URI to store its folder shortcuts; once the upgrade to Thunderbird 102 happens (or a server is renamed), Thunderbird can detect invalid URIs and tries to rebuild the URI with the new root and fixes them quietly. Note that when you use Services.io.newURIto generate a new valid uri from the old one, you cannot use "imap" unless the folder exists for certain - POP3 and Local host have no such problem (hence the replacement with http)

    function reconstructUri(e) {
      let ac = MailServices.accounts.getAccount(e.account), acType = "N/A";
      if (ac && ac.incomingServer) {
        acType = ac.incomingServer.type || "unknown";
        if (acType!="im") { // do not reconnect to chat accounts - these are not supported.
          let oldUri = e.uri.replace("imap://", "http://"); // non-existent imap URIs throw!!
          let tempUri = Services.io.newURI(oldUri); // generate a fresh URI to retrieve path portion
          // or oldUri.filePath - not sure whether query params make sense or are allowed for  folder URIS
          return ac.incomingServer.serverURI + tempUri.pathQueryRef; 
        }
      }
      throw new Error(`Failed to reconstruct URL for ${e.uri} of account ${e.account} - account type ${acType}`);
    }
See Also: → 381708
Duplicate of this bug: 381708
Duplicate of this bug: 608710
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: