Send Mail From Outlook Web Access

This is a discussion on Send Mail From Outlook Web Access within the PHP Language forums, part of the PHP Programming Forums category; I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-22-2005
Google Mike
 
Posts: n/a
Default Send Mail From Outlook Web Access

I've got RH9 Linux with default PHP.

Is there a way to send email on Linux to an Exchange Server from PHP
and/or other tools when there is *NOT* SMTP access?

Has anyone figured out a way to use PHP to get inside an OWA (Microsoft
Outlook Web Access) website to send email that way?

The reason I ask is because my corporate office is going to do away
with our rogue SMTP server access and force everything through Exchange
Server. This makes it hard for our batch scripts on the Linux server to
relay to internal email accounts that a job has failed or other errors.

Reply With Quote
  #2 (permalink)  
Old 02-22-2005
NC
 
Posts: n/a
Default Re: Send Mail From Outlook Web Access

Google Mike wrote:
>
> Is there a way to send email on Linux to an Exchange Server
> from PHP and/or other tools when there is *NOT* SMTP access?


I'm lost... If you don't have SMTP access to an Exchange Server,
is there a guarantee you can have any other kind of access?

> Has anyone figured out a way to use PHP to get inside an OWA
> (Microsoft Outlook Web Access) website to send email that way?


Not that I heard of, but it should be doable via cURL or
even fsockopen().

> The reason I ask is because my corporate office is going
> to do away with our rogue SMTP server access and force
> everything through Exchange Server.


Again, Exchange Server can (and does) provide SMTP service...
Can you explain the problem in a little more detail? In
particular, are the Exchange Server and your Linux machine
on the same LAN?

Cheers,
NC

Reply With Quote
  #3 (permalink)  
Old 02-22-2005
James
 
Posts: n/a
Default Re: Send Mail From Outlook Web Access

just use the address for the Exchange server as the SMTP and everything
should be fine -- I have never had an issue with it myself.

Reply With Quote
  #4 (permalink)  
Old 02-23-2005
Chung Leong
 
Posts: n/a
Default Re: Send Mail From Outlook Web Access


"Google Mike" <googlemike@hotpop.com> wrote in message
news:1109095078.006024.230980@l41g2000cwc.googlegr oups.com...
> I've got RH9 Linux with default PHP.
>
> Is there a way to send email on Linux to an Exchange Server from PHP
> and/or other tools when there is *NOT* SMTP access?
>
> Has anyone figured out a way to use PHP to get inside an OWA (Microsoft
> Outlook Web Access) website to send email that way?
>
> The reason I ask is because my corporate office is going to do away
> with our rogue SMTP server access and force everything through Exchange
> Server. This makes it hard for our batch scripts on the Linux server to
> relay to internal email accounts that a job has failed or other errors.
>


Not something I've tried. According to Microsoft, all Exchange
functionalities are expose through XML and HTTP/DAV. So in theory, you can
send a message without SMTP.

Here's a good introductory article:

http://msdn.microsoft.com/library/de...devwebapps.asp


Reply With Quote
  #5 (permalink)  
Old 02-23-2005
Google Mike
 
Posts: n/a
Default Re: Send Mail From Outlook Web Access

The answer: it's firewalled away from my access. The only port I can
reach is the Outlook to Exchange Server port and port 80 (OWA).

Reply With Quote
  #6 (permalink)  
Old 02-23-2005
Chung Leong
 
Posts: n/a
Default Re: Send Mail From Outlook Web Access


"Google Mike" <googlemike@hotpop.com> wrote in message
news:1109095078.006024.230980@l41g2000cwc.googlegr oups.com...
> I've got RH9 Linux with default PHP.
>
> Is there a way to send email on Linux to an Exchange Server from PHP
> and/or other tools when there is *NOT* SMTP access?
>
> Has anyone figured out a way to use PHP to get inside an OWA (Microsoft
> Outlook Web Access) website to send email that way?
>
> The reason I ask is because my corporate office is going to do away
> with our rogue SMTP server access and force everything through Exchange
> Server. This makes it hard for our batch scripts on the Linux server to
> relay to internal email accounts that a job has failed or other errors.
>


Actually, it appears that OWA works with non-IE browsers. You should be able
to post a message via a regular HTTP post. My suggestion is to download a
HTTP logging tool from somewhere, and examine the transaction between
Firefox and OWA when a message is sent to see what need to be done.

If you have a relatively recent version of PHP, doing a HTTP post with
authentication info is fairly easy. Just take a look at
http://www.php.net/stream_context_create/


Reply With Quote
  #7 (permalink)  
Old 02-24-2005
Google Mike
 
Posts: n/a
Default Re: Send Mail From Outlook Web Access

Yeah. I think I'll try that. You reminded me that I don't have to just
do this from Windows which has like zero tools for monitoring HTTP
traffic. I can do it from Mozilla and Linux. Duh. (Pinching myself
because I forgot about that! :) ) So, I just need to see if I can find
an HTTP logging tool for Linux. Got any suggestions?

Oh, and the good news is that my office has this enabled over HTTP, not
HTTPS, so I can actually read the traffic. They enable it over HTTP for
intranet, and HTTPS for when we're outside the office.

Reply With Quote
  #8 (permalink)  
Old 02-24-2005
Chung Leong
 
Posts: n/a
Default Re: Send Mail From Outlook Web Access


"Google Mike" <googlemike@hotpop.com> wrote in message
news:1109218418.306478.196210@o13g2000cwo.googlegr oups.com...
> Yeah. I think I'll try that. You reminded me that I don't have to just
> do this from Windows which has like zero tools for monitoring HTTP
> traffic. I can do it from Mozilla and Linux. Duh. (Pinching myself
> because I forgot about that! :) ) So, I just need to see if I can find
> an HTTP logging tool for Linux. Got any suggestions?
>
> Oh, and the good news is that my office has this enabled over HTTP, not
> HTTPS, so I can actually read the traffic. They enable it over HTTP for
> intranet, and HTTPS for when we're outside the office.
>


There's a Mozilla extension called livehttpheaders. I've never used it
myself, but it's probably worth a try. Just Google for it.


Reply With Quote
  #9 (permalink)  
Old 02-24-2005
Google Mike
 
Posts: n/a
Default Re: Send Mail From Outlook Web Access

Thanks. Your a pal! :)

Reply With Quote
  #10 (permalink)  
Old 02-25-2005
Google Mike
 
Posts: n/a
Default Re: Send Mail From Outlook Web Access

To get into OWA, I did some tests by using Linux, Mozilla (with proxy
turned on to self), and then fired up the Squid proxy for Linux. I
disabled strip_query_terms in squid.conf so that I could see the full
URL. Here's what I found in the /var/log/squid/acccess.log file after
using OWA to send a message. (Also look for my further comments below
this.)

GET http://webmail/
GET http://webmail/exchange/logon.asp
GET
http://webmail/exchange/LogonFrm.asp...Google%2C+Mike
GET
http://webmail/exchange/LogonFrm.asp...Google%2C+Mike
GET http://webmail/exchange/root.asp
GET http://webmail/exchange/Navbar/nbInbox.asp
GET http://webmail/exchange/inbox/main_f...re=0&obj=&acs=
GET
http://webmail/exchange/inbox/title....pidx=0&store=0
GET
http://webmail/exchange/inbox/peerfl...890000&store=0
GET
http://webmail/exchange/inbox/messag...890000&store=0
GET http://webmail/exchange/inbox/comman...othing&store=0
GET http://webmail/exchange/images/envelope.gif
GET
http://webmail/exchange/forms/ipm/no...nd=new&store=0
GET
http://webmail/exchange/forms/ipm/no...=1&att=0&imp=1
GET
http://webmail/exchange/forms/ipm/no...12136&caller=1
GET http://webmail/exchange/forms/ipm/no....asp?obj=12136
POST http://webmail/exchange/forms/ipm/note/commands.asp
# The above POST, if done in GET format, would probably be:
http://webmail/exchange/forms/ipm/no...1&importance=1
GET http://webmail/exchange/logoff.asp

One of the first things that happens is Basic Authentication. (Note
that NTLM Authentication is just Basic Authentication pointed at a
Active Directory or SAM security file.) That means that one has to pass
a Basic Auth header when trying to login on to LogonFrm.asp.

I think some of these URLs I might not even be required to hit in order
to acquire the proper session ID on the server or the proper cookie
information. For instance, I would reason to bet that the long HEX info
?obj= in some of the URLs above is not even a necessary page one needs
to hit in order to send out email. If it is, then perhaps one of the
prior pages passes this information.

I also think all the magic happens in commands.asp in that POST. Since
I know that often times you can replace a POST with a GET to debug
things, I believe the above replacement for the POST just might work.
Otherwise one will have to pass a form to the commands.asp.

The only cookie I received was on the webmail/logon.asp page, and it
was just an ordinary session ID. Perhaps some of the prior pages to
commands.asp updates the server's session cookie with other information
-- I don't know.

Meanwhile, watch out for the objID parameter in the URL -- that's
uniquely identified each time. I believe one of the prior pages
provides that value and this must be reused in order for the email to
go out.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:48 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0