Hi,
I have a little question about preauth.
I want to create a link who use preauth and redirect the user to the compose view with an email adresse in the field recipient.
So I use this script :
PHP Code:<?php
$PREAUTH_KEY="0f6f5bbf7f3ee4e99e2d24a7091e262db37eb9542bc921b2ae4434fcb6338284";
$WEB_MAIL_PREAUTH_URL="http://zimbra.server.com/service/preauth";
$user = $_GET["user"];
$domain=$_GET["domain"];
$email = "{$user}@{$domain}";
if(empty($PREAUTH_KEY)) {
die("Need preauth key for domain ".$domain);
}
$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=".$preauthToken;
/*Redirection vers la page de création de mail avec comme destinataire admin@xxx.com*/
$preauthURL .= "&redirectURL=/zimbra/?view=compose&to=admin@xxx.com"
$lien="<a href=".$preauthURL.">Cliquez ici</a>";
?>
So with the link generated, I should be authentified and redirected on the page to create a new message, with the field recipient pre-filled with : admin@xxx.com
But it doesn't work, I'm redirected on the home page of my zimbra mailbox :/
Why zimbra can't do these two actions ? (preauth, then redirect on compose view with a recipient pre-filled).
Thanks![]()


LinkBack URL
About LinkBacks

