Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 28th October 2008, 23:59
necromncr necromncr is offline
Junior Member
Join Date: Jul 2008
Posts: 9
Thanks: 1
Thanked 6 Times in 3 Posts
Default HOWTO: IlohaMail - email address login

Well, I did some tweaking to IlohaMail that allows me to login using email address instead of username. Here is the procedure:

Setup a new MySQL username for accessing db_ispconfig database. For example, let's say it will be ilohamail. I did this step using phpmyadmin as root user. DO NOT MAKE ANY PRIVILEGES FOR ACCESSING ISPConfig's DATABASE YET!

Add privileges to ilohamail user for certain ISPConfig tables and their fields:

GRANT SELECT ( `doc_id` , `user_username` , `user_emailalias` , `user_email`) ON `db_ispconfig`.`isp_isp_user` TO 'ilohamail'@'localhost';
GRANT SELECT ON `db_ispconfig`.`isp_dep` TO 'ilohamail'@'localhost';
GRANT SELECT ( `doc_id` , `doctype_id` , `web_domain`) ON `db_ispconfig`.`isp_isp_web` TO 'ilohamail'@'localhost';
This will enable IlohaMail access to only username - hostname parts of the tables and not any further info. If you named your database otherwise than db_ispconfig be sure to change that.

Change ./conf/db_config.php and add following lines:

$DB_ISP_PASSWORD="<password you created in step 1>";
Change ./conf/conf.php and add this:

Put it somewhere into php code area (and not at the end of the file!)

Copy include/idba.MySQL.inc into include/idba_isp.MySQL.inc

cp include/idba.MySQL.inc include/idba_isp.MySQL.inc
Open include/idba_isp.MySQL.inc and replace all occurances:


(they're the same only _ISP_ is added)
Leave $DB_PERSISTENT as it is.

Open source/index.php.

Look for includes (lines 51+).
Add the following after include_once("../conf/login.php") :

// check if we're in ISP config mode
if ($ISP) {
Find this lines at around line 110:

        //attempt to initiate session
        if ($user && $password && $host){
                $user_name = $user;
Change it into:

    //attempt to initiate session
    if ($user && $password && $host){

        if (($ISP) && (strpos($user,'@')!==false)) {
            $db = new idba_isp_obj;
            // make connection to ISP config database. BE SURE YOU HAVE SECURED ACCESS TO THE DATABASE FIRST!
            if ($db->connect()) {
                $sql = "SELECT user.user_username "
                            ."FROM isp_isp_user user, isp_dep dep, isp_isp_web web "
                            ."WHERE user.doc_id=child_doc_id "
                            ." AND dep.child_doctype_id=1014 "
                            ." AND web.doc_id=dep.parent_doc_id "
                            ." AND (CONCAT(user.user_email,'@',web.web_domain)='$user')";
                $result = $db->query($sql);
                if (($result) && ($db->num_rows($result)>0)){
                    $user = $db->result($result, 0, "user_username");

        $user_name = $user;
Looking thru my code I think this should be enough. You can try logging into your IlohaMail using your mail for login and your password. It should work with your primary email only - aliases wont work.

If it's not working for you or I forgot to write it down please let me know.


Last edited by necromncr; 9th May 2009 at 21:30. Reason: fixed sql error
Reply With Quote
The Following 2 Users Say Thank You to necromncr For This Useful Post:
bernholdt (30th January 2009), falko (29th October 2008)
Sponsored Links


email login, ilohamail

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Webmail problems with only one domain? compner Installation/Configuration 14 16th February 2010 17:59
Can't receive email at all (or can't login) djkoelkast Installation/Configuration 2 8th September 2006 15:26
Details on problem /mailuser login and more (long) linutzy Installation/Configuration 11 15th February 2006 19:45
UebiMiau webmail adding @localhostname to email address except first address. Kamran Shah Installation/Configuration 5 11th October 2005 18:01

All times are GMT +2. The time now is 05:12.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.