Open Bug 588772 Opened 14 years ago Updated 2 years ago

Cannot prevent TB from checking new email at startup

Categories

(MailNews Core :: Account Manager, defect)

x86_64
Windows 7
defect

Tracking

(Not tracked)

People

(Reporter: tossit, Unassigned)

References

()

Details

(Whiteboard: [gs])

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 GTB5 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6

For all my accounts, I uncheck "Check for new messages at startup", "Check for new messages every...minutes", and "Automatically download new messages".

I use Config Editor to change the value of "mail.startup.enabledMailCheckOnce" to FALSE.

I close TB and reopen and "Check for new messages at startup" for my default account is CHECKED, and value of "mail.startup.enabledMailCheckOnce" has been magically reset to TRUE.

I check prefs.js and do not see 'user_pref("mail.startup.enabledMailCheckOnce", false);' so I close TB and add this setting to prefs.js, reopen TB, and once again "Check for new messages at startup" for my default account was CHECKED, and value of "mail.startup.enabledMailCheckOnce" has been magically reset to TRUE. Plus, 'user_pref("mail.startup.enabledMailCheckOnce", false);' still appears in prefs.js but is totally ignored.

I try adding 'user_pref("mail.startup.enabledMailCheckOnce", false);' to user.js, but I get the same behavior. 

I try adding 'user_pref("mail.startup.enabledMailCheckOnce", false);' to user.js AND to prefs.js, but I get the same behavior. 


Reproducible: Always

Steps to Reproduce:
1. For all my accounts, I uncheck "Check for new messages at startup", "Check for new messages every...minutes", and "Automatically download new messages".

2. I use Config Editor to change the value of "mail.startup.enabledMailCheckOnce" to FALSE.

3. I close TB and reopen and "Check for new messages at startup" for my default account is CHECKED, and value of "mail.startup.enabledMailCheckOnce" has been reset to TRUE.

4. I check prefs.js and do not see 'user_pref("mail.startup.enabledMailCheckOnce", false);' so I close TB and add this setting to prefs.js, reopen TB, and once again "Check for new messages at startup" for my default account was CHECKED, and value of "mail.startup.enabledMailCheckOnce" has been reset to TRUE. The setting 'user_pref("mail.startup.enabledMailCheckOnce", false);' still appears in prefs.js but is ignored.

5. I try adding 'user_pref("mail.startup.enabledMailCheckOnce", false);' to user.js, but I get the same behavior. 

6. I try adding 'user_pref("mail.startup.enabledMailCheckOnce", false);' to both user.js AND to prefs.js, but I get the same behavior. 
Actual Results:  
"Check for new messages at startup" for my default account is CHECKED, and value of "mail.startup.enabledMailCheckOnce" has been reset to TRUE.

TB checks for new emails and downloads them to my computer.

Expected Results:  
TB should not check for new emails and download them to my computer.
SO when you edit your file is TB running ?
When you close TB does it really closes ?

what happens if you start TB in safemode (http://support.mozillamessaging.com/en-US/kb/Safe+Mode) ?
@Ludovic: 
When I edit the file, TB is definitely closed and not running (confirmed by Task Manager).

When I then open TB in Safe Mode, I find the same results as opening in Normal Mode: "Check for new messages at startup" for my default
account is CHECKED, and value of "mail.startup.enabledMailCheckOnce" has been
reset to TRUE

As I close Safe Mode TB (without changing the settings to Off/False through the dialog boxes), TB edits prefs.js, changing the setting 'user_pref("mail.startup.enabledMailCheckOnce", false);' to 'user_pref("mail.startup.enabledMailCheckOnce", true);'.

If I open in Normal Mode, TB is not as kind. It immediately deletes 'user_pref("mail.startup.enabledMailCheckOnce", false);' from the prefs.js file and doesn't even bother to write 
'user_pref("mail.startup.enabledMailCheckOnce", true);' as it closes.

One final note: the 'user_pref("mail.server.server7.check_new_mail", false);' setting in prefs.js (for my default account, server 7) is consistently present throughout all these various tests (Safe Mode and Normal Mode) and is always set to 'false', even when the dialog box in TB's GUI is showing 'checked'.
Adding aureliano to see if he has ideas.
One clarification about my observations:

On further testing it appears that opening TB in Normal Mode DOES NOT delete 'user_pref("mail.startup.enabledMailCheckOnce", false);' from prefs.js.

However, closing TB in Normal Mode has two different effects on prefs.js:

1. If I DO NOT change the GUI settings to "Unchecked/False" the setting 'user_pref("mail.startup.enabledMailCheckOnce", false);' is set to 'true'

2. If I DO change the GUI settings to "Unchecked/False", the setting 'user_pref("mail.startup.enabledMailCheckOnce", false);' is deleted.

This is the same behavior as Safe Mode. In other words Safe and Normal mode have the same effect on the setting I add to prefs.js.
vexiing problem
(In reply to Wayne Mery (:wsmwk) from comment #5)
> vexiing problem

What did you mean?
(In reply to :aceman from comment #6)
> (In reply to Wayne Mery (:wsmwk) from comment #5)
> > vexiing problem
> 
> What did you mean?

I mean that it is a frequently reported issue, and that it eludes fixing.
Oh, now i checked that 'vex' is a proper English word . I supposed it was a typo :)

Ok, I can confirm the strange behaviour:
1. when "mail.server.serverX.login_at_startup"=FALSE in all accounts and "mail.startup.enabledMailCheckOnce"=TRUE then TB DOES NOT check mail for me.
2. When I set "mail.startup.enabledMailCheckOnce"=FALSE, on the next start TB really DOES check mail on the default account.
3. When going to account manager, there is a check at "Check for new messages at startup". And in prefs.js there is now "mail.server.server1.login_at_startup"=TRUE.
4. If I uncheck that setting, prefs.js contains 
"mail.server.server1.login_at_startup"=FALSE again.
And now I am back at step 1. where NOT checking is working fine.


Question to pros:
What is the purpose of the mail.startup.enabledMailCheckOnce pref?
I'll look into the source how it is used. Maybe it is some leftover from the suite? Does Seamonkey have the same problem?

Reporter, have you tried leaving mail.startup.enabledMailCheckOnce on TRUE? Did it not work?
It seems the pref 'mail.server.serverX.login_at_startup is the pref for "Check for new messages at startup", not "mail.server.serverX.check_new_mail" (that one is for the periodic checking).
Status: UNCONFIRMED → NEW
Component: Preferences → Account Manager
Ever confirmed: true
Product: Thunderbird → MailNews Core
QA Contact: preferences → account-manager
Whiteboard: [gs]
Version: unspecified → Trunk
(In reply to :aceman from comment #8)
> 2. When I set "mail.startup.enabledMailCheckOnce"=FALSE, on the next start
> TB really DOES check mail on the default account.
>(snip)
> And in prefs.js there is now "mail.server.server1.login_at_startup"=TRUE.

Tb is working as coded, as intended.
http://mxr.mozilla.org/comm-central/source/mail/base/content/msgMail3PaneWindow.js#68
http://mxr.mozilla.org/comm-central/source/mail/base/content/msgMail3PaneWindow.js#787
> 906             if (!pref.getBoolPref(kMailCheckOncePrefName))
> 907             {
> 908                 pref.setBoolPref(kMailCheckOncePrefName, true);
> 909                 defaultServer.loginAtStartUp = true;
> 910             }

> What is the purpose of the mail.startup.enabledMailCheckOnce pref?

Regardless of actual login is done or not, if mail.startup.enabledMailCheckOnce=false, defaultServer.loginAtStartUp is set to true and mail.startup.enabledMailCheckOnce is set to true.
It looks to force login of at least default account at least once after first account definition. Meaning of true seems "enabledMailCheckOnce is already executed" and meaning of false seems "enabledMailCheckOnce is not executed yet". 
This seems reason why report like "login of default account is always executed" existed.

Bug opener, what is purpose of your intentional setting of enabledMailCheckOnce=false?
Removing myslef on all the bugs I'm cced on. Please NI me if you need something on MailNews Core bugs from me.
Severity: major → normal
Summary: Cannot prevent TB from checking email at startup → Cannot prevent TB from checking new email at startup
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.