Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#443 Imap referral support in Exchange

Way Out There
open
5
2005-04-11
2005-02-21
AncientGeek
No

In a multiple exchange server environment, exchange
sort of supports referrals if your mailbox is on
another server. Exchange resonds with
? OK [REFERRAL
imap://lawco%2Fwvogel;AUTH=*@durban-1.gibb.co.za/]
LOGIN completed.

Exchange responds with that server name, so why not log
into that server?

The following experimental code snippet from
imap_general.php does just that.

$read = sqimap_run_command ($imap_stream, $query,
false, $response, $message);
/* Check for Exchange referrals */
if (strpos($message,"REFERRAL") > 0) {
$start_pos = strpos($message,"AUTH=*@");
$end_pos = strrpos($message, "/");
if ($start_pos && $end_pos ) {
$imap_server_address =
substr($message,$start_pos+7,$end_pos-($start_pos+7));
sqimap_logout($imap_stream);
$imap_server_address = $response_text;
$imap_stream = sqimap_login ($username, $orig_password,
$imap_server_address, $imap_server_address, $imap_port,
$hide);
return $imap_stream;
}
}

The attach patch file is for 1.44. It works for me but
is not intended to be production code! I'm not a PHP
programmer!

Discussion

  • AncientGeek
    AncientGeek
    2005-02-21

    Patch imap_general.php for exchange referrals

     
    Attachments
  • Logged In: YES
    user_id=285765

    Marc wants to look at this for the devel branch, so he claimed.

     
    • assigned_to: nobody --> stekkel
     
  • AncientGeek
    AncientGeek
    2005-04-12

    Logged In: YES
    user_id=1224279

    Another approach (which I used since I wanted to stick with
    stock standard squirrelmail) is to use Perdition imap proxy. I
    synchronise perdition's user database with exchange. I can
    assemble a howto if anyone is interested. Goodbye OWA,
    goodbye IIS! Users are very happy with the change.

     
  • Logged In: YES
    user_id=188834

    I was just checking out this patch.

    I would like to clarify that it only provides a hack for the LOGIN REFERRALS
    (RFC2221), and not MAILBOX REFERRALS (RFC2193).

    Also it would be wise to consider the scenarios outlined in RFC2221:

    Example: C: A001 LOGIN MIKE PASSWORD
    S: A001 NO [REFERRAL IMAP://MIKE@SERVER2/] Specified user
    is invalid on this server. Try SERVER2.

    Example: C: A001 LOGIN MATTHEW PASSWORD
    S: A001 OK [REFERRAL IMAP://MATTHEW@SERVER2/] Specified
    user's personal mailboxes located on Server2, but
    public mailboxes are available.

    This means that responses NO and OK could be handled differently for the
    purpose of checking out the public folders available in SERVER1.