email - Can I change the Thunderbird SMTP, POP3 and IMAP server setting editing some file?

25
2014-03
  • gsc-frank

    I'm right now in a massive email migration to Google Application (GMail). I must change all the server settings in each Thunderbird client of all my users. I have the Administrator password of each PC, but not the user password where the Thunderbird profiles are.

    Does there exist a way to edit a file inside Thunderbird profile using the Administrator rights and change SMTP-IMAP-POP3 setting of users accounts? Edit or execute a command, or replace a file.

  • Answers
  • Michał Sacharewicz

    There is a way, though it needs just a little bit of javascript knowledge. You have to:

    1. Apply two config files inside the installation dir
    2. Use them to change global configuration, applied to all users

    Now, in short:

    Step 1: Setting common config definition file

    Go to the the Thunderbird program folder (ie. %ProgramFiles%\Mozilla Thunderbird) and create a file: defaults\pref\local-settings.js

    Add a following content:

    pref("general.config.obscure_value", 0);
    pref("general.config.filename", "mozilla.cfg");
    

    This will tell Thunderbird to use %ProgramFiles%\Mozilla Thunderbird\mozilla.cfg file as a config template.

    Step 2: Configuring mailboxes

    Now, in mozilla.cfg you have to define mailbox settings. Basically, you will work with Mozilla config variables - the same that you see when you type about:config in the Firefox address bar or when you launch Settings Editor in Thunderbird.

    With this file and with following functions, you may affect Thunderbird config globally (that is, for each user running Thunderbird from the same install location). The functions are:

    • defaultPref( PrefName, Value ) - sets the default value (user can overwrite it)
    • lockPref( PrefName, Value ) - forces specific value (user cannot overwrite it)
    • pref( PrefName, Value) - forces specific value (user can overwrite for session duration)

    You can also read any pref:

    • getPref( PrefName ) - reads value

    You have almost full JavaScript capability. Server configuration is stored within mail.server.<servername>.* tree.

    You do not know the <servername> component. It's value is server#, with # being a consecutive number assigned at creation, though you do not know in what order did the user create his accounts and if he did not delete any of his accounts.

    But, using javascript, you may find the correct <servername> by:

    1. Looping throough all values stored in the mail.accountmanager.accounts variable (it contains comma-delimited list of all accounts, like: account1,account10,account3,account7,account2)
    2. For each account, checking if that's the account you want to fix (using one of the subparameters, like: mail.server.<servername>.hostname)
    3. Once you'll find correct <servername>, change it's config as desired.

    Sample code

    This is a simple algorithm for mozilla.cfg you may use to begin with:

    var allServersString = getPref( "mail.accountmanager.accounts" );
    var i, serverName, myServerConfig, allServers = allServersString.split(",");
    
    // For each account...
    for ( i = 0; i < allServers.length; i++ ) {
    
        // Get account number
        serverName = "server" + allServers[i].substr(7);
    
        // If hostname of account matches our hostname, we found our `servername`
        if ( getPref( "mail.server." + serverName + ".hostname" ) == "imap.myOldServer.com" )
            myServerConfig = "mail.server." + serverName;
    
    }
    
    // Change parameters at your discretion...
    pref( "aaa." + myServerConfig + ".hostname", "imap.myNewServer.com" );
    // ...
    

    Notes

    • You may have to experiment a little with choosing right pref/lockPref function that will best suite your needs
    • You will have to do the same thing for SMTP servers, but it's a little bit more tricky. Once you know correct <servername> you need to use the # from <servername>, then get list of identities identifiers idXXX from mail.account.account#.identities, and change parameters of each identity assigned to account (stored in mail.identity.idXXX.*. Voila! :D

  • Related Question

    email - Set up Gmail IMAP on Thunderbird 3
  • Bart B

    I can't seem to get Thunderbird 3 and Gmail to work together. I've been a Thunderbird user for years, and I have a different Google mail account set up and working already which successfully migrated in from Thunderbird 2.

    I'm not even sure at what end the problem is. I think I have the client set up right, and I think the strange cryptic error message I get is from Thunderbird:

    Alert
    Web login required (Failure)

    On the Gmail side I have logged in to my account and enabled IMAP. The settings I see in their how-to for Thunderbird 2 all seem to be set right in Thunderbird 3.

    I'm at a complete loss as to what else I can check.


  • Related Answers
  • Iain

    Are these IMAP settings the answer?

  • markus

    There is a quick and easy way to this, check it out here: http://www.high-on-it.co.za/2011/02/how-to-setup-gmail-in-thunderbird-with.html

  • 8088

    I have a different google mail account set up and working

    Have you enabled IMAP in the Mail account you're trying to add to Thunderbird 3 ?

    Image courtesy How-To Geek

    Image courtesy How-To Geek

    This Google groups discussion indicates few other Non-Thunderbird users are also facing the same problem. You might want to try

  • Bart B

    I changed NOTHING - I just waited about an hour, during which time I did log in to the web interface, then, it just started working in Thunderbird. No changes were made on either end.

    I guess when ever you get the above error the answer is to be patient.

    It's possible I triggered all this by accidentally repeatedly entering the wrong password the first time I tries to access the account from TB. It's also possible that it takes some time for the change in settings to allow IMAP to take effect.