Discussion:
Outlook Web Access
j***@gmail.com
2008-03-26 18:21:35 UTC
Permalink
This is my first post to the list. Besides I'm a newbie using the next configuration:
* getmail
* maildrop
* mutt
* ssmpt
(I was a Kmail user)
First thing, congratulations for your work.

Second, I have a feature request:
- I use Microsoft Outlook at work. There we have a Microsoft Exchange Server for the mail, calendar, contacts, ...
- I would like to user Cygwin, getmail, maildrop, mutt configuration.
- So I would like getmail could retrieve messages from a Microsoft Exchange Server.

Alternatives:
-[ ] Microsoft Exchange Server can be configured with SMTP, POP, IMAP support. But since I work in a big company, it's imposible that the system administrator do this.
-[ ] I haven't found any program which use Microsoft's propietary protocol. So it should be difficult to find information to support the native protocol.
-[X] There is something really easy to implement and that works quiet well. You can retrieve messages and delete them throught the webmail interface.

Web Interface:
--------------
I have found today this small piece of code (approx. 100 lines) written in python (open source):
http://www.holovaty.com/code/weboutlook/0.1/scraper.py

This is suppose to work when you have something like this:
https://owa.intermedia.net/Login.aspx

In my enterprise, we don't have a form to access. We use something like this:
http://user:***@server/exchange

I have changed this morning the code (really ugly since I'm not a programmer), to manage to retrieve messages from our server and it work. It would be REALLY NICE if you could integrate both ideas inside getmail.

Best regards,
José María

My modified code:
-------------------------------------------------------------
#!/usr/bin/python
#! -*- encoding: utf-8 -*-
import urllib2,re

# Conexión al webmail.
_auth=urllib2.HTTPBasicAuthHandler()
_auth.add_password( realm='mail.intra.enterprise.corp', \
uri='http://mail.intra.enterprise.corp', \
user='myusername', \
passwd='mypassword')
_opener=urllib2.build_opener(_auth)
urllib2.install_opener(_opener)

# Ya podemos abrir las URL.
class OWA:
def __init__(self,url='http://mail.intra.casa.corp/exchange/'):
self.url=url
_fp=urllib2.urlopen(self.url)
_texto=_fp.readlines()
_message_urls=self._get_folder('Bandeja de entrada') # or 'Inbox'
print self._read_message(_message_urls[0])

def _get_folder(self,_folder_name):
#if not self.is_logged_in: self.login()
_url = self.url + urllib2.quote(_folder_name) + '/?Cmd=contents'
_fp=urllib2.urlopen(_url)
_html=_fp.read()
#html = self.get_page(url)
#print _html
_buscador=re.compile('NAME=MsgID VALUE="([^"]*)"')
_message_urls=_buscador.findall(_html)
#_message_urls = re.findall(r'(?i)NAME=MsgID value="([^"]*)"', _html)
return _message_urls

def _read_message(self,_msgID):
_url=self.url[:-1] + _msgID + '/?Cmd=body'
_req = urllib2.Request(_url)
_req.add_header('Translate', 'f')
_fp=urllib2.urlopen(_req)
return _fp.read()

a=OWA('http://mail.intra.enterprise.corp/exchange/Firstname.Surname/')
-------------------------------------------------------------
Charles Cazabon
2008-03-26 18:50:39 UTC
Permalink
Post by j***@gmail.com
First thing, congratulations for your work.
Thank you.
Post by j***@gmail.com
- I use Microsoft Outlook at work. There we have a Microsoft Exchange Server
for the mail, calendar, contacts, ...
I pity you :). I'd hate to have to use Outlook again; it was one of the worst
MUAs I've ever used.
Post by j***@gmail.com
- I would like to user Cygwin, getmail, maildrop, mutt configuration.
- So I would like getmail could retrieve messages from a Microsoft Exchange Server.
Well, this is already possible, if the server has been configured to support
POP and/or IMAP. Many (most?) MSexchange servers are configured this way --
and if they aren't, isn't it likely because the company has decided they don't
want users using other software?
Post by j***@gmail.com
-[ ] I haven't found any program which use Microsoft's propietary protocol.
So it should be difficult to find information to support the native
protocol.
The Outlook<->MSexchange protocol is deliberately undocumented, and is
modified with each new release of the software. It's a classic case of
Microsoft trying to lock users into their products, and lock out alternative
software implementations. Trying to reverse-engineer the protocol is
therefore pointless.
Post by j***@gmail.com
http://www.holovaty.com/code/weboutlook/0.1/scraper.py
A screen-scraper. Yes, but as I said above... if a company has decided "you
shall access the mail server via the web interface and Outlook only", wouldn't
it be a bad idea to try to bypass that restriction?

I don't think this is a good candidate for inclusion in getmail.
Screen-scraping breaks if they ever change the web interface (even slightly),
is officially unsupported (so they don't care if they break other software),
and is demonstrably inferior to using the standard (well, as far as MS goes),
documented, supported POP and/or IMAP interfaces.

I think if you want to retrieve mail from an MSexchange server, you should use
POP or IMAP access. If those services aren't enabled, ask for them to be. If
they refuse to allow POP/IMAP access to their server, then you've got no
particular reason to be trying to fake it.

Charles
--
-----------------------------------------------------------------------
Charles Cazabon
GPL'ed software available at: http://pyropus.ca/software/
-----------------------------------------------------------------------
Tom Vajzovic
2008-03-26 19:00:29 UTC
Permalink
Hi
Post by j***@gmail.com
- So I would like getmail could retrieve messages from a Microsoft Exchange Server.
--------------
http://www.holovaty.com/code/weboutlook/0.1/scraper.py
https://owa.intermedia.net/Login.aspx
I have changed this morning the code (really ugly since I'm not a programmer), to manage to retrieve messages from our server and it work. It would be REALLY NICE if you could integrate both ideas inside getmail.
<snip code>

This is a bit of a botch. The messages in an Exchange mailbox can be
fetched by http without trying to decode the web interface.

If anyone wanted to implement it in getmail, they should read the
documentation from Microsoft (which is quite good):

http://msdn2.microsoft.com/en-us/library/aa143161(EXCHG.65).aspx

And perhaps also the documentation included in the source of Ximian
Connector (which adds Exchange/Outlook functionality to Evolution):

http://packages.debian.org/src:ximian-connector

Alternatively you could use one of the already existing programs that
does what you want, eg:

http://freshmeat.net/projects/outlookgrabber/

Regards,

Tom

Loading...