How to disable Horde's Mobile Mail (MIMP)

ggouweloos

Member
Nov 26, 2008
14
0
51
Since the upgrade to 11.28 I would like to disable MIMP for at least one account/domain. Disable it serverwide is also an option.

Can anyone tell me how I can do this?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
All of the discussions and patches I've seen so far were before MIMP was the default. The best way I can see to avoid the detection would simply be to change this setting in /usr/local/cpanel/base/horde/config/conf.php file:

Code:
 $conf['auth']['checkbrowser'] = true;
To false instead. If you aren't checking the browser, then you cannot detect if it is a mobile device or not. This change will be a global change, which you cannot restrict to just one account. Additionally, it will not save on Horde updates, so you'd need to change the setting each time you run an update. Otherwise, you can exclude the file from cPanel update syncs, but then you run the risk of having an outdated version of the file with a newer version of Horde. If you want to exclude the file from updates, you can do it this way:

Code:
echo "/usr/local/cpanel/base/horde/config/conf.php" >> /etc/cpanelsync.exclude
Unfortunately, I cannot get my mobile phone to work to test out my theory on removing browser detection to remove MIMP detection, so I am only speculating above that this would result in the behavior you'd prefer (no MIMP redirection upon Mobile phone detection).

Otherwise, you might post on the horde mailing list with the question to see any other possible suggestions:

horde Info Page
 

ggouweloos

Member
Nov 26, 2008
14
0
51
Just tried but it does not work.
It keeps me directing to a simple page on the phone showing a 'Mobile Mail' link.
Which redirects me to MIMP.

Maybe MIMP is a nice product for 128 x 96 screens, but it looks horrible on a High-Res device.
 

ggouweloos

Member
Nov 26, 2008
14
0
51
The code that acts on the browser and view-types on login:

Code:
/* If DIMP/MIMP are available, show selection of alternate views. */
$views = array();
if (!empty($conf['user']['select_view'])) {
    $apps = $registry->listApps(null, true);
    $view_cookie = isset($_COOKIE['default_imp_view'])
        ? $_COOKIE['default_imp_view']
        : ($browser->isMobile() && isset($apps['mimp']) ? 'mimp' : 'imp');
    if (isset($apps['dimp']) || isset($apps['mimp'])) {
        $views[] = array('sel' => $view_cookie == 'imp',
                         'val' => 'imp', 'name' => _("Traditional"));
        if (isset($apps['dimp'])) {
            $views[] = array('sel' => $view_cookie == 'dimp',
                             'val' => 'dimp', 'name' => _("Dynamic"));
        }
        if (isset($apps['mimp'])) {
            $views[] = array('sel' => $view_cookie == 'mimp',
                             'val' => 'mimp', 'name' => _("Minimalist"));
        }
    }
}
Not sure where it sets the $apps['mimp'] variable.... Looks like a config-setting though.
 

ggouweloos

Member
Nov 26, 2008
14
0
51
OK here a simple hack in one of the Horde core files to disable MIMP:

Edit:
usr\local\cpanel\base\horde\lib\Horde\Browser.php

Find function ismobile:

Code:
    function isMobile()
    {
        return $this->_mobile;
    }
Replace with:
Code:
    function isMobile()
    {
	return false;
    }