I finally got it working, the standard ways would not work. Here is what finally worked. I'm sure half of it could be trimmed out, if someone wants to optimize this please post the code back here.

This was with php 5.2.4. There are some issues with curl and open_dirs and safe mode in php. If you look at the php documentation you will see it.


PHP Code:
<?php
        $zimbra_email_id 
="123456"// you need to know the id of the eamil to extract it.
        
$zm_base_url "http://zimbra.example.com";
         
$zm_redirect_url "/?id=".$zimbra_email_id."&view=html";
         
$zimbra_user "zimbra_user";
         
//I have a group of functions that will build this, but I don't have time to post it now.
         //but the url should look like this.
         
         //  http://zimbra.example.com/service/preauth?account=zimbra_user&expires=0&timestamp=1201897639000&preauth=14464oeu51ca6baaoeuaoeuaoeu368foeu1135d3e1&redirectURL=/zimbra/home/zimbra_user/?id=41452&view=html
         
$zm_url ="" ;//$obj->build_preauth_url($zm_base_url,$zm_redirect_url);
        
           
$ch curl_init();
        
          
$header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
          
$header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
          
$header[] = "Cache-Control: max-age=0";
          
$header[] = "Connection: keep-alive";
          
$header[] = "Keep-Alive: 300";
          
$header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
          
$header[] = "Accept-Language: en-us,en;q=0.5";
          
$header[] = "Pragma: "// browsers keep this blank.
          
curl_setopt($chCURLOPT_URL$zm_url);
          
curl_setopt($chCURLOPT_USERAGENT'Googlebot/2.1 (+http://www.google.com/bot.html)');
          
curl_setopt($chCURLOPT_HTTPHEADER$header);
          
curl_setopt($chCURLOPT_REFERER'http://www.google.com');
          
curl_setopt($chCURLOPT_ENCODING'gzip,deflate');
          
curl_setopt($chCURLOPT_AUTOREFERERtrue);
          
curl_setopt($chCURLOPT_RETURNTRANSFER1);
          
curl_setopt($chCURLOPT_TIMEOUT10);
          
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
          
curl_setopt($chCURLOPT_FAILONERROR1);
          
curl_setopt ($chCURLOPT_COOKIEJAR"cookies");  
          
curl_setopt($chCURLOPT_COOKIEFILE'cookie'.$zimbra_user.'.txt');
          
//  curl_setopt($ch, CURLOPT_HTTPGET, 1); //might be of value
        // curl_setopt($ch, CURLOPT_REFERER,1);
          
          
          
$html curl_exec($ch); // execute the curl command 
          
echo $html;


?>