Page 1 of 7 1234567 LastLast
Results 1 to 10 of 65
Discuss Microsoft Exchange email access without IMAP through Python...help needed! at the Free Toolchain Software (Cydia App's) - Hackint0sh.org; I'm looking for some Python or iPhone POP3 help. Read below for the full explanation... ...
  1. #1
    Professional Array

    Join Date
    Aug 2007
    Posts
    54
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    10

    Default Microsoft Exchange email access without IMAP through Python...help needed!

    I'm looking for some Python or iPhone POP3 help. Read below for the full explanation...

    Since I got my iPhone, I've been searching for a way to get my work email to work on it. Of course, my company can't (won't) enable IMAP. We have Outlook Web Access, but sadly, that won't load in iPhone's Safari either due to some kind of compatibility problem. Sure, there's Synchronica, but it's a pain and only free for 60 days.

    So I started thinking about creating an app or script that could screen-scrape Outlook Web Access behind the scenes and present my email in a nice, iPhone-like interface. Surprisingly, I found just the thing already made for me. Adrian Holovaty wrote a simple python script that collects email from OWA and serves it up locally as a 'fake' POP3 server. It's called weboutlook. Now having Python already installed on my iPhone doesn't seem quite as useless.

    His script is made to work on an OWA site that uses forms-based authentication, so I had to make a number of modifications to use it with my HTTP-authenticated site (you'd know if it uses HTTP by the login box popping up rather than appearing as part of a web page). I can't get the code to attach to this post for some reason, but if anyone wants my version, let me know.

    So the scraper/POP server runs great on my laptop. The only thing you need to do to the script is to put your OWA server address after 'WEBMAIL_SERVER =' in popdaemon.py. Then just install python (if you don't already have it), chmod +x both .py files, and run 'python popdaemon.py' from your Terminal or command prompt to start the POP server. Then set up a POP account in your favorite email program and point it to the fake POP server, 127.0.0.1 at port 8110. Use your OWA login for username and password and the emails from the first page of your Inbox should show up in the new account.

    Unfortunately, it does not work when installed/run on the iPhone. Using all the same settings, I just get 'cannot connect to POP server' errors. Using SSH, I have confirmed that the scraper is functioning (and successfully downloading emails) from the Python command line. It appears that the POP server is also running, but I'm having a hard time debugging due to the lack of an iPhone telnet client (anyone know of one?).

    I am by no means a Python expert so I don't know what could be preventing the iPhone from seeing the POP server. It does use the same libraries that WebShell uses to serve webpages, which is reported to be working on the iPhone, although I haven't tried it yet. If anyone else gives it a try, please let me know if you get anywhere.

    Finally, a question about security. The password is sent from Python to OWA over HTTPs, so security should not be an issue there. However, you are logging into the local fake POP server without any encryption. This does not concern me on a firewalled computer, but could there be a possibility for abuse of the script on the iPhone?



  2. #2
    Senior Professional Array

    Join Date
    Aug 2007
    Posts
    227
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    18

    Default

    Quote Originally Posted by lh99 View Post
    I'm looking for some Python or iPhone POP3 help. Read below for the full explanation...

    Since I got my iPhone, I've been searching for a way to get my work email to work on it. Of course, my company can't (won't) enable IMAP. We have Outlook Web Access, but sadly, that won't load in iPhone's Safari either due to some kind of compatibility problem. Sure, there's Synchronica, but it's a pain and only free for 60 days.

    So I started thinking about creating an app or script that could screen-scrape Outlook Web Access behind the scenes and present my email in a nice, iPhone-like interface. Surprisingly, I found just the thing already made for me. Adrian Holovaty wrote a simple python script that collects email from OWA and serves it up locally as a 'fake' POP3 server. It's called weboutlook. Now having Python already installed on my iPhone doesn't seem quite as useless.

    His script is made to work on an OWA site that uses forms-based authentication, so I had to make a number of modifications to use it with my HTTP-authenticated site (you'd know if it uses HTTP by the login box popping up rather than appearing as part of a web page). I can't get the code to attach to this post for some reason, but if anyone wants my version, let me know.

    So the scraper/POP server runs great on my laptop. The only thing you need to do to the script is to put your OWA server address after 'WEBMAIL_SERVER =' in popdaemon.py. Then just install python (if you don't already have it), chmod +x both .py files, and run 'python popdaemon.py' from your Terminal or command prompt to start the POP server. Then set up a POP account in your favorite email program and point it to the fake POP server, 127.0.0.1 at port 8110. Use your OWA login for username and password and the emails from the first page of your Inbox should show up in the new account.

    Unfortunately, it does not work when installed/run on the iPhone. Using all the same settings, I just get 'cannot connect to POP server' errors. Using SSH, I have confirmed that the scraper is functioning (and successfully downloading emails) from the Python command line. It appears that the POP server is also running, but I'm having a hard time debugging due to the lack of an iPhone telnet client (anyone know of one?).

    I am by no means a Python expert so I don't know what could be preventing the iPhone from seeing the POP server. It does use the same libraries that WebShell uses to serve webpages, which is reported to be working on the iPhone, although I haven't tried it yet. If anyone else gives it a try, please let me know if you get anywhere.

    Finally, a question about security. The password is sent from Python to OWA over HTTPs, so security should not be an issue there. However, you are logging into the local fake POP server without any encryption. This does not concern me on a firewalled computer, but could there be a possibility for abuse of the script on the iPhone?
    The binkit (version 6) has nc (netcat) which can be used to connect to port 110 on the iPhone to see if the server is running.

  3. #3
    Professional Array

    Join Date
    Aug 2007
    Posts
    54
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    10

    Default

    Cool, I had never used netcat before. Looks like it could be a pretty useful tool.

    On my computer, nc 127.0.0.1 8110 returns the POP server welcome message. On the iPhone, nothing appears. I'm going to try a simple test server script to see if I can figure out why the POP server isn't running.

  4. #4
    Rookie Array

    Join Date
    Aug 2007
    Posts
    18
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I am very interested in the outcome of this. Please keep us all informed, and let us know if you need any help.

  5. #5
    Advanced Array

    Join Date
    Aug 2007
    Posts
    46
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I would also be very interested. In the moment the missing OWA / OTA Exchange sync is a pain. It would be great to have something working at least for email.


  6. #6
    Professional Array

    Join Date
    Aug 2007
    Posts
    54
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    10

    Default

    No solution yet, but I am working on it. I have done some testing with an HTTP server that uses the same module (asyncore) and it works perfectly on the iPhone. Based on this, it seems to me that the POP server is running, but there's some issue with the communication function, asynchat, that's causing it to malfunction. More later.

  7. #7
    Professional Array

    Join Date
    Aug 2007
    Posts
    54
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    10

    Default

    Some good news! I have the POP3 server running on the iPhone. The server WAS running, it was just hanging up on a piece of code in the POP3 'welcome message'. After commenting it out, the thing fires right up and is accessible by Telnet.

    Still can't get the iPhone email client to connect, but it's a step in the right direction. Latest script can be downloaded from the new Google Code project. See issues tracker for a more complete description of the problem.

    Anyone know how to get the iPhone to connect to a POP server at a non-standard port? When the server is at 8110, mail doesn't even see it. It will log in if I put the server at port 110, though. I'm using:

    Host Name: localhost:8110 or 127.0.0.1:8110

    Also, if you have POP server communications experience, maybe you can help me figure out why the iPhone email setup is hanging up after login. I think it's waiting for some kind of response after login, but I don't know what.

  8. #8
    Senior Professional Array

    Join Date
    Jul 2007
    Posts
    445
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    30

    Default

    Quote Originally Posted by lh99 View Post
    Some good news! I have the POP3 server running on the iPhone. The server WAS running, it was just hanging up on a piece of code in the POP3 'welcome message'. After commenting it out, the thing fires right up and is accessible by Telnet.

    Still can't get the iPhone email client to connect, but it's a step in the right direction. Latest script can be downloaded from the new Google Code project. See issues tracker for a more complete description of the problem.

    Anyone know how to get the iPhone to connect to a POP server at a non-standard port? When the server is at 8110, mail doesn't even see it. It will log in if I put the server at port 110, though. I'm using:

    Host Name: localhost:8110 or 127.0.0.1:8110

    Also, if you have POP server communications experience, maybe you can help me figure out why the iPhone email setup is hanging up after login. I think it's waiting for some kind of response after login, but I don't know what.
    just on a hunch you can connect 2 a regular pop server via telnet and login, and then connect to yours and login and see whats different?


    I'm still working on the direct feed to mail thing... are you interested in that at all? Maybe we can join efforts...

  9. #9
    Rookie Array

    Join Date
    Jul 2007
    Posts
    20
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default pop2owa mail "server"

    Don't know if this is of interest. but there is an open source app called pop2owa that uses OWA RPC to get email AND SENT email, and to the iphone it's a pop3 server. It's written in VB and runs on windows. I've got it installed and it does work, connecting to my work exchange, but it is unstable.

    http://www.pop2owa.com/en/index.php

    I know the python script runs ON the iphone which is cool, but maybe if someone with VB experience had a hand this could be a good solution as it supports attachments, and SENDING of mail as well, which is huge. I have both Macs and PCs in my environment so it's not a big deal that it's Windoze. Entourgage uses the RPC also so i'm sure it could be "ported" to the Mac.

    Just a thought.

  10. #10
    Senior Professional Array

    Join Date
    Jul 2007
    Posts
    445
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    30

    Default

    little update:

    I've been going through the mail db files and its not as simple as I thought... the data is somehow cached somewhere, and i dont know where exactly. i'm guessing that it may be the mail app has an sqlite process locking the envelope info file, its also a bit difficult to test since it keeps logging into accounts and erasing my envelope info... i'm going to try this a little more slowly... i'm setting up a dummy pop server just so the iphone checks and goes away...


 

 
Page 1 of 7 1234567 LastLast

Similar Threads

  1. Replies: 0
    Last Post: 02-19-2008, 05:25 PM
  2. Email Imap attachments
    By Nelson0000 in forum General
    Replies: 0
    Last Post: 02-19-2008, 04:35 PM
  3. Mail auto-check doesnt work on IMAP Exchange
    By bence8810 in forum General
    Replies: 24
    Last Post: 01-10-2008, 07:37 PM
  4. mailstreet and imap email
    By Globalm3 in forum General
    Replies: 0
    Last Post: 09-21-2007, 01:24 AM
  5. IMAP & Exchange 2003 poroblems
    By kelkin in forum General
    Replies: 2
    Last Post: 08-26-2007, 05:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 05:07 AM.
twitter, follow us!