Update This is what we've done....
1. Prepare your domain for preauth - gdpak domain.com
2. Pass the login ID to a different php5 supported web server; make sure you work with your Network Engineer to test the firewall between the webserver to the email server.
3. Using the code below and replace $PREAUTH_KEY, $WEB_MAIL_PREAUTH_URL, $user = $_GET["user"] and $domain=$_GET["domain"] values
4. Test your script.
Hope this helps.
Thanks.
PL
<?php
/**
* Globals. Can be stored in external config.inc.php or retreived from a DB.
*/
$PREAUTH_KEY="0f6f5bbf7f3ee4e99e2d24a7091e262db37e b9542bc921b2ae4434fcb6338284";
$WEB_MAIL_PREAUTH_URL="http://zimbra.server.com/service/preauth";
/**
* User's email address and domain. In this example obtained from a GET query parameter.
* i.e. preauthExample.php?email=user@domain.com&domain=do main.com
* You could also parse the email instead of passing domain as a separate parameter
*/
$user = $_GET["user"];
$domain=$_GET["domain"];
$email = "{$user}@{$domain}";
if(empty($PREAUTH_KEY)) {
die("Need preauth key for domain ".$domain);
}
/**
* Create preauth token and preauth URL
*/
$timestamp=time()*1000;
$preauthToken=hash_hmac("sha1",$email."|name|0|".$ timestamp,$PREAUTH_KEY);
$preauthURL = $WEB_MAIL_PREAUTH_URL."?account=".$email."&by=name ×tamp=".$timestamp."&expires=0&preauth=".$pre authToken;
/**
* Redirect to Zimbra preauth URL
*/
header("Location: $preauthURL");
?> |