Discovered pref.js errors while trying to get OAuth2 to work

User Help for Mozilla Thunderbird
Post Reply
markfilipak
Posts: 143
Joined: September 27th, 2014, 1:54 pm
Location: Ohio

Discovered pref.js errors while trying to get OAuth2 to work

Post by markfilipak »

Preface:
27 June, 2022.
I'm adding a preface to the preface: Save yourself some time and go directly here:
viewtopic.php?p=14932025#p14932025
It serves as a good synopsis of the problem with profiles in VBox shared folders for both TBird and FFox.

The original problem was unable to get OAuth2 to work with a Gmail POP account. That got resolved, but whenever Thunderbird is restarted, OAuth2 setup runs again because prefs.js is flaky and the tokens appear to have NOT been saved in 'prefs.js' -- that proved to be false, but initially, that's what appeared to happen. This probably has something to do with the VirtualBox VM being used to run Thunderbird under Linux.

=====
Howdy,

Getting new mail fails.

"Email or phone". That's what TBird asks now with oauth2.

No matter what I type into the text box, TBird apparently rejects it. I've tried the account's email address. I've tried my alternate (ISP, non-Gmail) address. I've tried the word "Email". Nothing works.

There's a [_Help_] button. Pushing it does nothing.

Help. Thanks.

PS: I use my ISP-supplied email for sending, Gmail as POP. Gmail has my ISP email as an alternate, recovery email.
PPS: Using gmail as webmail works. I just need to know what to put into the text box: "Email or phone".
PPPS: Both POP and SMTP are configured to use oauth2. I just need to know what to put into the text box: "Email or phone".
Last edited by markfilipak on June 27th, 2022, 10:27 am, edited 4 times in total.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Email or phone

Post by tanstaafl »

You enter the email address. Perhaps you disabled cookies in Thunderbird in the privacy & security settings. The popup needs to create a accounts.google.com cookie and if it can't do that it fails in weird ways. Note that is a Thunderbird popup, not one from your system browser.

It also helps to delete the saved "password from "normal passwords", exit and restart. Several people have reported that if you don't do that the saved password (which you would expect to be ignored) causes problems.

You might also need to stop/disable any other software that uses localhost (127.0.0.1). A local web server , XMPP , AVG mail shield definitely cause problems. Some others such as a dns server cache don't seem to cause a problem.

Its aggravating because there are unexpected dependencies that the software doesn't warn you about.

https://support.mozilla.org/en-US/kb/au ... ts-oauth20
markfilipak
Posts: 143
Joined: September 27th, 2014, 1:54 pm
Location: Ohio

Re: Email or phone

Post by markfilipak »

Hi tanstaafl. Thanks for replying.
tanstaafl wrote:You enter the email address. Perhaps you disabled cookies in Thunderbird in the privacy & security settings. The popup needs to create a accounts.google.com cookie and if it can't do that it fails in weird ways. Note that is a Thunderbird popup, not one from your system browser.
Okay, thanks. I've done that. There's no change. Whatever I put into the "Email or phone" box is rejected.
It also helps to delete the saved "password from "normal passwords", exit and restart...
Sorry, I don't know what this:
the saved "password from "normal passwords"
means. Are you suggesting I delete passwords?

--Mark.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Email or phone

Post by tanstaafl »

Yes.

The popup window for OAuth2 will ask you for a password but if it succeeds what it stores is a token , not the password. If the password wizard still has the password from when you used to use "normal password" authentication you need to delete it before trying to create the token.
markfilipak
Posts: 143
Joined: September 27th, 2014, 1:54 pm
Location: Ohio

Re: Email or phone

Post by markfilipak »

tanstaafl wrote:It also helps to delete the saved "password from "normal passwords", exit and restart. Several people have reported that if you don't do that the saved password (which you would expect to be ignored) causes problems.
Well, people will come up with all sorts of notions when they're not given any guidance. Good thing I've got you! With your guidance, I stumbled my way to success.

No, I didn't have to remove any passwords.
You might also need to stop/disable any other software that uses localhost (127.0.0.1). A local web server , XMPP , AVG mail shield definitely cause problems. Some others such as a dns server cache don't seem to cause a problem.
Programmers just can't wean themselves from using sockets, can they? Sockets and RPC are the cause of all the security flaws -- In Windows, add rootkits to the 'by design' flaws.
Its aggravating because there are unexpected dependencies that the software doesn't warn you about.
<cynical=on>Gee, why would the TBird developers want to warn us, eh?<cynical=off>
Thanks for the link. It said that javascript must be enabled. I stumbled my way to enabling javascript. Then I went through a very tedious string of setups, one per account. Each wanted my password when TBird already knew my passwords... so much for this: "Automatic Conversion of Google mail accounts to OAuth 2.0 Authentication"

Oauth seems to be working for all my accounts, now.

Hahaha...! All this to supplement my passwords with a new set of passwords given out by Google. What a joke! Now, I'm going to close TBird and relaunch.

What are the odds that it will all work when TBird is relaunched?

Thanks for your help. You saved me.
markfilipak
Posts: 143
Joined: September 27th, 2014, 1:54 pm
Location: Ohio

Re: Email or phone

Post by markfilipak »

markfilipak wrote:... Thanks for your help. You saved me.
Oops! Too soon.

It worked one time. Then, I relaunched TBird and nothing I had done stuck. It appears that TBird is not saving into my profile.

This is cruel and unusual punishment. All, so Google can gather more info about me, more control over me, more ownership of me.

PS: Yup! I just checked the passwords in preferences. None of the oauth 'tokens' (passwords, actually) are there. So, the new TBird is not updating my profile. Seems like a pretty serious bug to me.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Email or phone

Post by tanstaafl »

Try modifying some innocuous setting in tools -> preferences, exiting, restarting and see if the modification is gone. There might be some file permission problem.

With a normal password you have the option of whether or not to save it for the password manager. But my impression was you don't have any option with OAuth2, it always saves the token, and the main concern is if you disable cookies later on it will eventually have problems refreshing the token.

I have free outlook, yahoo, and gmail accounts so that I can keep up with problems with them. But my main account is a email account I pay for from a company whose only business is email, so they have no conflict of interest.
markfilipak
Posts: 143
Joined: September 27th, 2014, 1:54 pm
Location: Ohio

Re: Email or phone

Post by markfilipak »

TBird has a bug. Bear with me. There are a few moving parts...

My TBird is installed as a portable app on a virtual disk drive mounted in Linux here: '/media/mark/TBird Linux'.
My TBird profile is in a shared folder mapped via VirtualBox from Windows to Linux here: '/media/sf_email/0ysydkep.default'.

The bug: TBird accesses the email store as normal and stores newly received email as normal, so it is using the profile above for email.
But TBird does not update settings and passwords in the very same profile.
When I checked the profiles in "About Profiles", there was no default profile! '/media/sf_email/0ysydkep.default' was listed, but it wasn't default. There was no default. How does such a thing happen?

As of today, I'm running version 91.10.0 (64-bit). Prior to today I was running version 52.7.0 (64-bit).
markfilipak
Posts: 143
Joined: September 27th, 2014, 1:54 pm
Location: Ohio

Re: Email or phone

Post by markfilipak »

The bug is even worse, Though I now have '/media/sf_email/0ysydkep.default' as the default profile, changes to TBird -- setting '[X} Unified Folders', unselecting Quick Filter, putting Calendar away -- none of them are sticky, so TBird is not storing settings but it is storing email.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Email or phone

Post by tanstaafl »

VirtualBox complicates things. Did you create any symlinks in the profile?

See if you can use something like System Monitor to see what files the thunderbird.exe process has opened. That should tell you which prefs.js file it uses.

Portable Thunderbird uses a different launcher than the official Mozilla build, bypassing profiles.ini. By default it only supports one profile, so there is no need to set it as default. "To use a second profile, install the Thunderbird Portable 2nd Profile 2.0 app in the same PortableApps directory that ThunderbirdPortable is in"

I wouldn't trust about:profiles in Portable Thunderbird since you don't have a profiles.ini file. I suspect its replacement launcher does the rough equivalent of the -profile command line argument to specify the profiles location (which totally ignores profiles.ini).

https://portableapps.com/support/thunde ... nd_profile
http://kb.mozillazine.org/Running_from_ ... hunderbird
markfilipak
Posts: 143
Joined: September 27th, 2014, 1:54 pm
Location: Ohio

Re: Email or phone

Post by markfilipak »

tanstaafl wrote:Try modifying some innocuous setting in tools -> preferences, exiting, restarting and see if the modification is gone. There might be some file permission problem.
As you can see from my progress (or lack of progress), I've already done that.
With a normal password you have the option of whether or not to save it for the password manager. But my impression was you don't have any option with OAuth2, it always saves the token, and the main concern is if you disable cookies later on it will eventually have problems refreshing the token.
Yes, cookies are also being affected. So not only are the oauth 'tokens' not being stored, the vital cookie is not being stored.
I have free outlook, yahoo, and gmail accounts so that I can keep up with problems with them. But my main account ...
... is a email account I pay for from a company whose only business is email, so they have no conflict of interest.
Care to share that company's name?

I really miss Eudora Mail. I've learned to hate TBird. TBird's architecture, built around accounts, is awful -- totally unnecessarily complicated and almost unworkable. I've also become thoroughly disillusioned with FOSS. FOSS has killed shareware. All my primary Windows apps were bought as shareware.
markfilipak
Posts: 143
Joined: September 27th, 2014, 1:54 pm
Location: Ohio

Re: Email or phone

Post by markfilipak »

tanstaafl wrote:VirtualBox complicates things. Did you create any symlinks in the profile?
Nope. I have no idea how to create a symlink. Should I?
See if you can use something like System Monitor to see what files the thunderbird.exe process has opened. That should tell you which prefs.js file it uses.
'prefs.js' is not listed.
Portable Thunderbird uses a different launcher than the official Mozilla build, bypassing profiles.ini. By default it only supports one profile, so there is no need to set it as default. "To use a second profile, install the Thunderbird Portable 2nd Profile 2.0 app in the same PortableApps directory that ThunderbirdPortable is in"
Profile: Mark = '/media/sf_email/0ysydkep.default'
Profile: default-release = '/home/mark/.thunderbird/fwa1ftxo.default-release' or '/home/mark/.cache/thunderbird/fwa1ftxo.default-release' -- there are 2 listed.
I wouldn't trust about:profiles in Portable Thunderbird since you don't have a profiles.ini file. I suspect its replacement launcher does the rough equivalent of the -profile command line argument to specify the profiles location (which totally ignores profiles.ini).
My menu command line is ' "/media/mark/TBird Linux/thunderbird" --profile /media/sf_email/0ysydkep.default '.
markfilipak
Posts: 143
Joined: September 27th, 2014, 1:54 pm
Location: Ohio

Re: Email or phone

Post by markfilipak »

Those both look like Windows. Windows is the Host. Linux Mint 18.3 is the Guest. I'm running TBird in the Linux Guest.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Email or phone

Post by tanstaafl »

* "Care to share that company's name?"

Fastmail, at https://www.fastmail.com. I was on a legacy plan so when I was recently forced to upgrade to the new plan (basic) they grandfathered support for POP/IMAP/SMTP. That lets me avoid the more expensive standard plan. After one year you can pay for multiple years at a time, at a discount, if you want to.

Beside the ticket based support system there is a unofficial forum at https://www.emaildiscussions.com/forumdisplay.php?f=27 that I've found useful. For example you have the option of using the Sieve mail filtering language in your custom rules. I had no problem getting answers to my questions about how to do certain things in Sieve.

If you've been using a free email provider I suspect you don't want to pay $50/year (standard plan, which has 30GB storage). You might take a look at mailo.com, mailbox.org , polarismail.com and https://posteo.de/en . I've been reading good things about purelymail.com in the forums at emaildiscussions.com , but its a one man shop.

* Our KB articles assume you're using Windows but the same command line arguments apply to Linux. You just need to adapt as needed for different file systems and profile locations.

* I was not suggesting you create a symlink. I was wondering if you had used one because it might explain the "missing" prefs.js file.

* "My menu command line is ' "/media/mark/TBird Linux/thunderbird" --profile /media/sf_email/0ysydkep.default '."

There should only be one dash in front of profile unless something has recently changed. Is that a typo or do you use a double dash? The only double dash prefix I'm used to seeing with Thunderbird is --allow-downgrade

* "prefs.js' is not listed." by System Manager.

If it doesn't open prefs.js or the optional user.js your accounts are undefined and you only have the default settings stored in omni.ja. You need to find that file somehow. If you have accounts it should exist.

FYI I'm running Windows 11Pro but also using Windows Subsystem for Linux (WSL2) with a Ubuntu distro. I use it to run the Ubuntu Thunderbird package, and play around with some other Linux software. WSL2 uses a Hyper-V VM. I can access all of my Windows files and vice versa without having to setup shared folders.

https://docs.microsoft.com/en-us/windows/wsl/install
markfilipak
Posts: 143
Joined: September 27th, 2014, 1:54 pm
Location: Ohio

Re: Email or phone

Post by markfilipak »

tanstaafl wrote:* "Care to share that company's name?"

Fastmail, at https://www.fastmail.com. ... If you've been using a free email provider I suspect you don't want to pay $50/year (standard plan, which has 30GB storage).
That's trivial. I'll ask for a zeroGB storage plan, POP only.
You might take a look at mailo.com, mailbox.org , polarismail.com and https://posteo.de/en . I've been reading good things about purelymail.com in the forums at emaildiscussions.com , but its a one man shop.
Thanks for the references.
There should only be one dash in front of profile ...
One dash or two, they both work.
* "prefs.js' is not listed." by System Manager.
Well, I'm dead in the water unless I can get this solved. There is a 'prefs.js'. And it's just where it's supposed to be. But for some reason, TBird is not opening it, so it doesn't show up in System Manager as a TBird open file. Permissions can't be a problem for 2 reasons: 1, the email in the profile works, and 2, the Windows permissions on the shared folder are, Full Access: 'Everyone', and Owner: 'Everyone'.

TBird 52 had no problems, TBird 91 has this problem. I'm mystified.
Post Reply