-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi daniel,
On Saturday, February 18, 2006, daniel wrote:
> Hello
>
> The problem that i am having is due to my exchange 5.5 server being
> seperate from my active directory. In order to login via IMAP it
> needs to be in the form of DOMAIN/USERNAME/ALIAS . Getting
> SquirrelMail configured is all okay, but for some reason it gets the
> email address as DOMAIN/USERNAME/[EMAIL PROTECTED] It's taking the whole login
> name as the alias when actually all i need is the ALIAS part of the
> login. I have managed to come up with code to split the login by "/"
> and retrieve the last out of the list but have no idea where to make
> this happen (e.g. redirect.php or something). Any ideas guys?

Redirect would be the easiest place to handle it, though webmail_top
hook would also work fairly well.  Let me see if I understand your
issue entirely.  Each user, to login, must type the following:

  DOMAIN/USERNAME/ALIAS

For example:

  foo/jangliss/bar

Correct? This would mean that you'd need to keep that format in tact
throughout the whole session, so you'd have to edit the users'
personal information. If that is really the case, then you'll want to
do the split on webmail.php in the hook webmail_top.  The reason I
suggest that is because redirect.php doesn't, and cannot, load the
users' preferences, where as webmail.php does.  What you'll probably
want to do to make it as flexible as possible, and save trashing
peoples stuff at a later point (and allow you to take it across
versions) is make a plugin.  Use webmail_top as the hook you want to
edit the information in.  You'll probably want to set a flag in the
users' prefs to say you have set the email address up once already so
you don't have to keep rerunning it... something like this would
probably work:


function fix_exchange_addy() {
    global $username,$data_dir;

    $done = getPref($username, $data_dir, 'exchange_addy',0);

    if ($done) {
       return true;
    }

    $split = explode('/', $username);

    if (!empty($split[2])) {
       setPref($username, $data_dir, 'exchange_addy', 1);
       setPref($username, $data_dir, 'email_address', $split[2]);
    }

}

Untested... and syntax might need some checking, I am forever getting
the setPref and getPref orders around the wrong way.

Hope that gives you an idea at least.

- --
Jonathan Angliss
<[EMAIL PROTECTED]>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)

iD8DBQFD+VVAK4PoFPj9H3MRAt21AKDMUAMX5fVkF2Nl1oQsD9ZFtt8olwCfcmQX
MottHXCFO9jyXFIpdmYv6e4=
=Bz0+
-----END PGP SIGNATURE-----



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
--
squirrelmail-users mailing list
Posting Guidelines: 
http://www.squirrelmail.org/wiki/MailingListPostingGuidelines
List Address: [email protected]
List Archives: 
http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user
List Archives:  http://sourceforge.net/mailarchive/forum.php?forum_id=2995
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

Reply via email to