Getting E-mail Out of OWA

or … “Ha, take that ITS

The Problem…

Getting all my e-mail in one place has been something of a challenge recently, the goal was to have all my e-mail end up under one account – with a single web interface to access all my e-mail on the go. Finally, tonight I think I’ve cracked it with the help of fetchExc.

The tricky part has been my University e-mail, Durham by default only allows you to access your e-mail though Outlook Web Access (OWA), and despite campaigning and pestering from myself, the  CompSoc and even the Student Union President they have refused to allow student’s access to their mail though POP, IMAP or redirecting e-mails directly in Exchange. The only option available is an OWA rule that allows you to forward e-mails to another account, however in the process of doing so all the headers are lost. In durham-to-durham e-mails even the sender of the original e-mail’s address is lost – and only their Exchange ‘friendly name’ is displayed (such as “P. NICHOLLS”)

Alex originally wrote a script that took these forwarded e-mails, re-headed them with the sender address – or looked up the sender address from friendly name via University LDAP, then sent them on to another account (in my case to gmail). This was ok, but still not ideal. I’d been using that system up until now, getting more and more frustrated when it was unable to look up addressses, lost CC and mailing list information, and so on. (Not to knock the actual script, there’s no way it could access this information its a very bad design fault on OWA’s part).

The Solution…

Then tonight, after a lot of playing around I finally made a breakthrough when I discovered fetchExc. This is able to connect to OWA using WebDAV, download the e-mails it finds then send them on to another account. Most importantly though it runs on a server, rather than being a desktop application (such as pop2owa which is a POP gateway for OWA which I used to use to get my Exchange mail into Thunderbird) which means it can update gmail in near-to-real-time and still fit in with my plan of having everything mobile and web-based.

To do this you’ll need a server somewhere than can run the tool, I’m using my Dreamhost account so these instructions relate specifically to Dreamhost – but any linux server with command line access and crontab should do.

  1. Download and unpack fetchExc from http://www.saunalahti.fi/juhrauti/fetchExc-2.0.tar.gz
  2. Create the file fetchExc.properties in your home directly and insert settings appropriately. (See http://www.saunalahti.fi/juhrauti/index.html if you need to customise them from the example below)[1].
    ExchangeServer=exdurf.dur.ac.uk
    ExchangePath=exchange
    MailServer=mailhost.zen.co.uk
    DestinationAddress=/usr/bin/procmail
    Username=d60yha
    Password=yourpasshere
    Domain=MDS
    Delete=false
    All=false
    Secure=true
    ProcMail=true
    FBApath=/exchweb/bin/auth/owaauth.dll
    
  3. Using the Dreamhost instructions on procmail as reference, create a file in your home directory (or edit if it already exists) and add the below (substituting in your address):
    :0
    ! youraddress@somedomain.com
  4. Now, give the program a test run, it should be giving some indication that its working.
    java -jar /pathtoit/fetchExc.jar
  5. Next as the fetchExc site suggests you’ll probably want to make a quick bash file that runs fetchExc, then put it in crontab so that it runs every few minutes, ensuring your e-mail is always up to date. I made a file runFetchExc
    #!/bin/bash
    
    export PATH=$PATH:/usr/local/jre/bin
    
    java -jar /pathtoit/fetchExc.jar $* >> fetchExc.log 2>> fetchExc.err
  6. Then added the following line to crontab
    */2 * * * * /pathtoit/runFetchExc

…And that’s it! All my e-mail ends up in gmail, with full and correct headers — and I’m a happy bunny

Notes…

: One further problem I came across is with regards to having somewhere to relay the e-mail to using this system. FetchExc ideally wants an SMTP server and a send-to address that it can resent the mail through, however it doesn’t seem to like SMTP authentication. To get around this problem in this example I tell fetchExc to send its e-mail through ProcMail, which in turn has a rule to send all e-mail to my gmail account. If you can relay without authenticating then check the fetchExc pages for a different config and skip over the ProcMail stuff in my instructions.

17 thoughts on “Getting E-mail Out of OWA

  1. This isn’t working for me, I get an error:

    INFO: Redirect requested but followRedirects is disabled
    Can’t find path for user. Exiting after trying FBA

    Also, it would make more sense to set up an OWA rule to forward messages to the email relating to the shell account being used, and then set up a postfix file to call the java and discard the mail -that way the fetcher will be called every time you get a mail.

  2. My bad Alex I missed a line out on the .properties file I think. Try again now, have updated the post. I have the INFO point too, but that doesn’t seem to cause me any problems.

    The reason I didn’t look into some sort of trigger on checking mail is one of the limitations with the “Forward” rule in OWA is that it ignores certain types of e-mails (such as bouncebacks, out-of-office notifications, calendar invites and other automatic Exchange generated e-mails)

  3. Paul –

    I’ve been trying to get fetchExc to connect to Exchange for a few days – I managed to figure out the properties for Exchange 2003, but was wondering if you had had any luck configuring it to work with 2007?

    I’m getting “Can’t find path for user. Exiting after trying FBA” and I’m sure it’s a config thing, but can’t figure out what to tweak 🙂

    Any pointers on how to decipher the parameters?

  4. Horrah, Durham Uni ITS are now going to enable IMAP on request unsupported. Listen out for details on how to request it for your account, or ask me around end May to mid June.

  5. Hi, trying to use my Mac Mail app to access my Durham webmail. Not as up on this stuff as all you guys are – main problem seems to be finding an incoming mail server – ideas for how I can do this as I am a liver out would be really appreciated.

    Thanks!

    1. Hi Liza,
      If you just want to access it from the Apple Mail app you’ll first need to request that IMAP access is enabled on your account, this’ll let the Mail app connect to the Durham system and grab your e-mail. The form to request IMAP enabling is here: http://www.dur.ac.uk/its/email/exchange/eximap/ and once done (takes effect overnight) there are instructions for setting it up in Mail here: http://www.dur.ac.uk/its/email/exchange/eximap/configuring-clients/

      Hope this helps! Paul

  6. Fantastic guide, thank you.
    I’d messed around with all sorts but this really is the neatest.
    Surprisingly fast too!

  7. And PS. to you Mac guys messing with this..
    You do know Entourage can access your emails via OWA anyway..
    Just set your OWA URL as the exchange server – Entourage will do the rest! 🙂

    I think there’s even a way to do it via Mail.app ‘s Exchange support too.

  8. hey
    i dont know what to say to an amazing actor and charming person like you
    you take me to an other place when i loke to your lovely face
    love you
    kissessssssssssssssssssssssssssssss

  9. hey
    im trying to inter into your group but i couldnt i dont know exactly how to do it
    i hope that you can answer me coz i wona be there

  10. damn – just what i need – thanks Paul – now if i could just understand it beyond the most basic grasp of what your talking about!

  11. If you’re getting “Can’t find path for user. Exiting after trying FBA” out of fetchMail, one possibility is a bad password. Took me a while to sort that one out after a change by an Outlook admin….

  12. INFO: Redirect requested but followRedirects is disabled

    IOException in fetchAll()):Unexpected end of file from server

    how to do ?

  13. I am getting the same error as few above:

    INFO: Redirect requested but followRedirects is disabled
    Can’t find path for user. Exiting after trying FBA

    Any hints how to solve it please?

    Thanks in advance.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.