Multiple IMAP Accounts plugin for Roundcube

Roundcube logoAfter some relentless searching I found a great plugin that supports multiple IMAP accounts for Roundcube tucked away on BitBucket. It’s a great tool that simply adds a drop down of the IMAP accounts you’ve set-up  to the top right area of Roundcube, replacing your email address in that area.

Update June 2019: You don’t need to follow the steps to replace any code as the author as since fixed the issue. Simply go here, download, and upload it to the plugins folder. 😍

Instructions on how to install multiple IMAP accounts plugin for Roundcube

  1. First, head over to here and click the ‘Download repository’ link
  2. Download it, and rename the folder to ident_switch
  3. Upload it to the /path/to/roundube/plugins/ folder
  4. Use the contents (for MySQL) of /path/to/roundcube/plugins/ident_switch/SQL/mysql.initial.sql and add it to your Rondcube database (you can do this by using phpMyAdmin). It will create a new database table named ident_switch
  5. As the script has not been updated for a while, it does not work for version 1.3. I created a fix, so make sure you head over here (or scroll to the bottom of this page for the code) and copy/paste the Javascript code (overwriting the entire file) into the file /path/to/roundcube/plugins/ident_switch/ident_switch.min.js
  6. Now you’re ready Logout and Login to Roundcube.
  7. Once you’re logged in navigate to Settings -> Identities and once you add a new Identity you’ll see a new section to add the IMAP details. Fill the fields in, add the identity and you’ll see the new drop-down menu at the top.



Updated code for ident_switch.min.js

$(function(){var $truName=$('.topright .username');if($truName){$sw=$('#plugin-ident_switch-account');if($sw){$sw.prependTo('#topline .topright');$truName.hide();$('#plugin-ident_switch-account:first-child').show();}}
$("INPUT[name='_ident_switch.form.enabled']").change();$("SELECT[name='']").change();plugin_switchIdent_processPreconfig();});function plugin_switchIdent_processPreconfig(){var disFld=$("INPUT[name='_ident_switch.form.readonly']");disFld.parentsUntil("TABLE","TR").hide();var disVal=disFld.val();if(disVal>0){$("INPUT[name='']").prop("disabled",true);$("SELECT[name='']").prop("disabled",true);$("INPUT[name='_ident_switch.form.port']").prop("disabled",true);}
function plugin_switchIdent_enabled_onChange(e){var $enFld=$("INPUT[name='_ident_switch.form.enabled']");$("INPUT[name!='_ident_switch.form.enabled'], SELECT",$enFld.parents("FIELDSET")).prop("disabled",!$":checked"));plugin_switchIdent_processPreconfig();}
function plugin_switchIdent_secure_onChange(e){var $secSel=$("SELECT[name='']");var $portFld=$("INPUT[name='_ident_switch.form.port']");if('SSL'===$secSel.val().toUpperCase())
function plugin_switchIdent_switch(val){rcmail.http_post('plugin.ident_switch.switch',{'_ident-id':val,'_mbox':rcmail.env.mailbox});}
function plugin_switchIdent_fixIdent(iid){if(parseInt(iid)>0)

5 thoughts...

  1. Hello!

    Just installed this plugin – thanks for the pointers!

    Everything seems OK except that after adding new identity and marking it as “enabled” under the Iden_Switch dialog, I do not get the dropdown box to select the identify, I can only see the primary identity under which I have logged on.

    I checked the SQL table and the row is added into the ident_switch table.

  2. elle69 says:

    Hello Steven,
    I followed all the steps described but I still have the error [ident_switch.form.readonly].

    Could you help me find a solution?

    1. SSULLIVAN88 says:

      You can ignore it. If you want to disable it, in either config.php or change:

      ‘readonly’ => true


      ‘readonly’ => false

      This will disable the fields from being read only.

      1. elle69 says:

        Hello SSULLIVAN88,
        I try this, but no solve the problem, the IMAP form not write in database.

        1. SSULLIVAN88 says:

          You might want to check the error log as that should help you understand why it’s not saving to the database. You don’t have the config file setup do you?

          Get Outlook for iOS

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>