Ab5602-Notes

Revision as of 16:44, 29 March 2017 by Gbkersey (talk | contribs) (→‎PHP + CURL + Zimbra SOAP)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Firefox, FireGPG (discontinued) PGP and Zimbra


There has been an ongoing discussion about including PGP/GPG encryption and signing features to Zimbra. Install the following Zimlet to add PGP features:

https://github.com/barrydegraaff/pgp-zimlet



More about Zimbra and other stuff at my blog: http://rob.sun3.org

PHP + CURL + Zimbra SOAP


function soapSend($url,$soap)
    {
    $gwch = curl_init();
    curl_setopt($gwch, CURLOPT_URL,$url);
    curl_setopt($gwch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($gwch, CURLOPT_VERBOSE, true);
    curl_setopt($gwch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($gwch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($gwch, CURLOPT_POSTFIELDS, $soap); 
    return curl_exec($gwch);
    }
   
$auth_soap = trim(file_get_contents("soap/mysoap.txt"));
$data = soapSend("https://zimbra.my.edu/service/soap",$auth_soap);
$pattern = '/<authToken>(?<name>[a-zA-Z0-9-_]+)<\/authToken>/';
preg_match_all($pattern, $data, $matches, PREG_SET_ORDER);

mysoap.txt:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <soap:Header>
       <context xmlns="urn:zimbra">
           <userAgent name="ZimbraWebClient - SAF3 (Win)" version="5.0.15_GA_2851.RHEL5_64"/>
       </context>
   </soap:Header>
   <soap:Body>
     <AuthRequest xmlns="urn:zimbraAccount">
        <account by="name">myuser@my.edu</account>
        <password>mypassword</password>
     </AuthRequest>
   </soap:Body>
</soap:Envelope>
Jump to: navigation, search