[horde] IMP authentication - IMAP

Howard Bagcat howard at mu.edu.ph
Fri Jun 11 02:23:59 PDT 2004


Anyone,

Got another problem. 

Here's the scenario, my IMAP server is configured to authenticate using the 'username at domain' scheme. Now, IMP passes
authentication information to my IMAP with just the 'username'. In my old IMP-2.2.4, the problem was solved by modifying
/imp/lib/IMP.php's:

1. createSession()

        // original
        // $_SESSION['imp']['uniquser'] = $_SESSION['imp']['user'];
       
       // modified entry
        if (Auth::getAuth()) {
            $_SESSION['imp']['uniquser'] = Auth::getAuth();
        } elseif (($conf['server']['server_list'] != 'none') && !empty($servers[$server]['realm'])) {
            $_SESSION['imp']['uniquser'] = $_SESSION['imp']['user'] . '@' . $servers[$server]['realm'];
        } elseif (!empty($realm)) {
            $_SESSION['imp']['uniquser'] = $_SESSION['imp']['user'] . '@' . $realm;
        } else {
            $_SESSION['imp']['uniquser'] = $_SESSION['imp']['user'];


2. authenticate()

        // manipulate username        
        if ($_SESSION['imp']['server'] == "mx.mu.edu.ph" ) {
                $txtUser = $_SESSION['imp']['user']."@mu.edu.ph";
        }
        else if ($_SESSION['imp']['server'] == "dept.mu.edu.ph") {
                $txtUser = $_SESSION['imp']['user']."@".$_SESSION['imp']['server'];
        } else {
                $txtUser = $_SESSION['imp']['user'];
        }


        if ($flags == 0) {

            $_SESSION['imp']['stream'] = @imap_open($connstr, $txtUser, Secret::read(Secret::getKey('imp'),  
$_SESSION['imp']['pass']));

            //$_SESSION['imp']['stream'] = @imap_open($connstr, $_SESSION['imp']['user'], Secret::read(Secret::getKey('imp'),
$_SESSION['imp']['pass']));


        } else {

            $_SESSION['imp']['stream'] = @imap_open($connstr, $txtUser, Secret::read(Secret::getKey('imp'),
$_SESSION['imp']['pass']), $flags);

            //$_SESSION['imp']['stream'] = @imap_open($connstr, $_SESSION['imp']['user'], Secret::read(Secret::getKey('imp'),
$_SESSION['imp']['pass']), $flags);

        }

In (2), code prefix with '//' are the original code. 

Any suggestion as to how am I be able to authenticate my IMAP with 'username at domain' using Horde3-ALPHA and IMP4-ALPHA.

Your ideas are highly appreciated. Thank You.


Kumusta, Howard

E-Sulat v.0.0.1 ( Manna )
.......................................................................................
An extended module for MUWeb4 Project <http://www.mu.edu.ph>
Powered by Horde, Postfix, PostgreSQL & Courier-IMAP




More information about the horde mailing list