cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Introduction and first question

From: Matthias Ritzkowski <matthiar_at_gmail.com>
Date: Fri, 21 Nov 2008 12:16:17 -0500

Hi,

I am fairly new to curl, I have done simple file transfers with it in
the past, but that's it.
Now I am trying something else:

I need to log in to an OWA Exchange Server (MS-Exchange 2007) and
download an attachment from a specific message.

At the moment I am finding bits and pieces of information here and
there, so I am looking for pointers and similar examples.

I am using curl 7.16.4 on the command.

Here's my current script:

curl -v --cacert /home/mritzkowski/curl/cacert.pem -s -b cookies.txt
-c cookies.txt -A "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT
5.0)" -L https://webmail.company.com/owa/auth/logon.aspx?url=https://webmail.company.com/owa/&reason=0
-d username=username -d password=password -d
destination=https://webmail.company.com/owa/ -d flags=0 -d
forcedownlevel=0 -d isUtf8=1 -d SubmitCreds=Log%20On -d
https://webmail.company.com/owa/

I get this output:

 * About to connect() to webmail.company.com port 443 (#0)
* Trying 172.27.13.63... connected
* Connected to webmail.company.com (172.27.13.63) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: /home/mritzkowski/curl/cacert.pem
  CApath: none
* SSLv2, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using AES128-SHA
* Server certificate:
* subject: /C=US/O=webmail.company.com/OU=GT35868496/OU=See
www.geotrust.com/resources/cps (c)08/OU=Domain Control Validated -
QuickSSL(R)/CN=webmail.company.com
* start date: 2008-09-19 15:46:54 GMT
* expire date: 2010-09-20 15:46:54 GMT
* common name: webmail.company.com (matched)
* issuer: /C=US/O=Equifax Secure Inc./CN=Equifax Secure Global
eBusiness CA-1
* SSL certificate verify ok.
> GET /owa/auth/logon.aspx?url=https://webmail.company.com/owa/ HTTP/1.1
> User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
> Host: webmail.company.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Length: 8344
< Content-Type: text/html; charset=utf-8
< Expires: -1
< Server: Microsoft-IIS/7.0
< X-AspNet-Version: 2.0.50727
< X-OWA-Version: 8.1.291.1
< X-Powered-By: ASP.NET
< Date: Fri, 21 Nov 2008 17:11:34 GMT
<
<!-- Copyright (c) 2006 Microsoft Corporation. All rights reserved. -->
<!-- OwaPage = ASP.auth_logon_aspx -->

I think I am stuck at the login screen ...
Where to go from here?

Thanks for any help or pointers!
Matthias Ritzkowski
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-11-21