Page 2 of 7 FirstFirst 1234567 LastLast
Results 11 to 20 of 65
Discuss Microsoft Exchange email access without IMAP through Python...help needed! at the Free Toolchain Software (Cydia App's) - Hackint0sh.org; More good news: The POP server in 0.0.2 actually does work -- I was just ...
  1. #11
    Professional Array

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

    Default

    More good news:

    The POP server in 0.0.2 actually does work -- I was just being impatient. It takes SEVERAL minutes for the setup to complete once I press 'save.'

    Additionally, I had set cwmx.com as my SMTP server (supposedly AT&T/Cingular's outgoing email server). It looks like this may have been part of the problem; when I changed it to my local ISP's SMTP server, the iPhone was able to successfully connect. I think you need a valid SMTP server to get the account to work, at least initially.

    More bad news:

    Although the iPhone connects to the POP server, it doesn't display the messages. It requests and receives emails but doesn't do anything with them. Instead, it just shows "Load 25 More Messages..." where the list should be.

    It appears that this is due to a lack of TOP support in the POP server. A TOP request gets the message header and the first X lines of the message so the email client can display a preview of the message. I'm now working on implementing a dummy TOP handler to see if I can get the iPhone to display my messages.

    As a reminder, since it was buried in an earlier post, this project now has a Google Code page. The only thing there are Downloads of the scripts, but I'll fill in some more info once the code's sort of working:

    http://code.google.com/p/iphone-pop3-outlook/


  2. #12
    Senior Professional Array

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

    Default

    Great progress luke! congrats!

    I havent tested just yet. I'm kind of putting my direct sql idea on hold for a bit and looking at scraping contacts so we can add them to the iphone OTA...

    I'm afraid it will have a similar type of locking as the email, but it might be less complex to overturn, now that I think of it, these locks is probably part of the reason that the itunes sync doesnt let you do anything while its syncing, and basically kills all apps on the phone.....

    maybe running the inserts from the iphone's sqlite3 binary will prove more succesful...

    On another note, I found a plist that allows you to reduce the interval between e-mail checks on the iphone. if you want it I can e-mail you cause I can't attache it here...

    I wonder what we can use to force a "manual" update, through a script. I'm also looking into a way of detecting new messages the way the OMA does, which would allow us to poll the server whenever a new message comes in, effectively giving push-functionality. I

  3. #13
    Professional Array

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

    Default

    One more update for today:

    So I now have a hacked-together version of the POP server running on the iPhone and delivering 'fake' emails successfully to the iPhone inbox!

    Unfortunately, UIDL (unique message-ID), TOP m 0, and TOP m 40 support need to be added to the server script in order for the iPhone to properly display the messages.

    Should be very easy, but will take some time.

  4. #14
    Rookie Array

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

    Default

    I keep getting an error on my iPhone stating 'bad username or password'. I am sure it is correct, as it was the same that I used on my powerbook running this script, and it correctly grabbed my email. On the iPhone, here is what gets spit out in the terminal:

    Sent welcome message
    User Name sent, asking for password
    error: uncaptured python exception, closing channel <__main__.POPChannel connected 127.0.0.1:49340 at 0x3ff08c> (<class 'scraper.RetrievalError'>:Couldn't find <base href> on page after logging in. [/usr/lib/python2.5/asyncore.py|read|68] [/usr/lib/python2.5/asyncore.py|handle_read_event|390] [/usr/lib/python2.5/asynchat.py|handle_read|137] [Media/python/popdaemon.py|found_terminator|100] [Media/python/popdaemon.py|pop_PASS|116] [/private/var/root/Media/python/scraper.py|login|127])

  5. #15
    Professional Array

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

    Default

    It works! I have a preliminary version of TOP and UIDL implemented (needs lots of cleanup and error handling, though). I have successfully downloaded all 24 messages in my Exchange inbox. They display the 2 line preview in the list, all HTML and images work, and so do file attachments!

    The working code (0.0.3) is now available:

    http://iphone-pop3-outlook.googlecod...aper-0.0.3.zip

    Please note that this isn't a 'released' version or even a beta. It's a proof of concept, and should be treated as such. I'm not responsible if it exposes your password, screws up your Outlook Inbox, or iPhone (although I'm sure enough that it won't to use it myself).

    The biggest problem right now is that it's pretty slow. This is because the script downloads every message in the main inbox every time the user logs in. The original designer of this script had it automatically delete all messages after download, so it wasn't an issue for him. I think most of us will be using the iPhone in addition to a work PC, so this won't work for us.

    I am thinking about how to limit the download to messages that weren't present at the last login. For now, it would be advisable not to try to connect to an Inbox that's full of messages, especially on EDGE.
    Last edited by lh99; 08-25-2007 at 09:28 PM.


  6. #16
    Professional Array

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

    Default

    kupan-

    The error you're receiving is not actually an issue with your password. If that were the case, the script would kick out a '401 Unauthorized' error. It looks like it's logging in, but not getting the page that it expects. The script looks for the <BASE href="..."> tag in the OWA page so it knows what address to find your Inbox, etc at. I'm not sure why this would work on your Powerbook and not on the iPhone though. Try manually working around the error by going to your OWA main screen in your browser and viewing the page source. Look for the BASE tag and copy the contents (in between the quotations). In scraper.py replace:

    Code:
    m = re.search(r'(?i)<BASE href="([^"]*)">', html)
    with the contents of the BASE tag:

    Code:
    m = "https://mail.yourcompany.com/exchange/yourusername/"


    Quote Originally Posted by kupan787 View Post
    I keep getting an error on my iPhone stating 'bad username or password'. I am sure it is correct, as it was the same that I used on my powerbook running this script, and it correctly grabbed my email. On the iPhone, here is what gets spit out in the terminal:

    Sent welcome message
    User Name sent, asking for password
    error: uncaptured python exception, closing channel <__main__.POPChannel connected 127.0.0.1:49340 at 0x3ff08c> (<class 'scraper.RetrievalError'>:Couldn't find <base href> on page after logging in. [/usr/lib/python2.5/asyncore.py|read|68] [/usr/lib/python2.5/asyncore.py|handle_read_event|390] [/usr/lib/python2.5/asynchat.py|handle_read|137] [Media/python/popdaemon.py|found_terminator|100] [Media/python/popdaemon.py|pop_PASS|116] [/private/var/root/Media/python/scraper.py|login|127])

  7. #17
    Rookie Array

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

    Default

    Quote Originally Posted by lh99 View Post

    Code:
    m = re.search(r'(?i)<BASE href="([^"]*)">', html)
    with the contents of the BASE tag:

    Code:
    m = "https://mail.yourcompany.com/exchange/yourusername/"
    Ya, I started diving into the python script and caught that. Not sure whats up, when I look at the page source, I find that <BASE> tag, and it looks fine. But I replaced the m with my string, and now I get this:

    Sent welcome message
    User Name sent, asking for password
    User logged in
    Sent STAT

    Any ideas? Additional I tried another address (different company, different server), and I see the same thing. No emails in my viewer, just the 'Load 25 More Messages...' thing. I click on it, or click on refresh in Mail, and it spins and spins, but just goes through the same thing, and sits at 'Sent STAT'.

    EDIT:

    So I just saw this note on the google page:

    if you enter your user name and password into form elements embedded in a webpage, you need the forms version

    Where I can get the forms version? I don't seem to see it.
    Last edited by kupan787; 08-25-2007 at 10:30 PM.

  8. #18
    Professional Array

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

    Default

    Is this with the new version, 0.0.3, or 0.0.2? The older versions won't get you past the 'Load 25 More Messages' thing.

    If you're running the new version, try giving it some time. If you have a lot of messages in the inbox, it could take several minutes to load. As mentioned in the previous post, the script has to download ALL messages on the first page of your OWA inbox, so it may take a while.

    If you still have no luck, try using Telnet from your computer:

    telnet 192.168.0.XXX 110
    (you should get a welcome message, then type the following commands)

    user domain\username
    pass password

    stat
    (after a potentially long delay, server should reply with some numbers)

    list
    (should list all messages in your Inbox in the format msg# size)

    uidl
    (should list all messages, but with a long code instead of the message size)

    top 1 0
    (should display the headers from your first message in the inbox)

    top 1 40
    (should give you the headers & first 40 lines of your first message in the inbox)

    retr 1
    (should give you the whole first message)

    These are all the commands that the iPhone will send to the server. If there are any errors shown, post them here.

    Quote Originally Posted by kupan787 View Post
    Ya, I started diving into the python script and caught that. Not sure whats up, when I look at the page source, I find that <BASE> tag, and it looks fine. But I replaced the m with my string, and now I get this:

    Sent welcome message
    User Name sent, asking for password
    User logged in
    Sent STAT

    Any ideas? Additional I tried another address (different company, different server), and I see the same thing. No emails in my viewer, just the 'Load 25 More Messages...' thing. I click on it, or click on refresh in Mail, and it spins and spins, but just goes through the same thing, and sits at 'Sent STAT'.

  9. #19
    Professional Array

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

    Default

    It's linked at the end of that paragraph:

    http://www.holovaty.com/code/weboutlook/0.1/scraper.py

    This is the original script. It should still work with the latest POP server, but I don't have the ability to test it.

    EDIT:

    Just replace the scraper.py you downloaded from the Google Code site with the one linked above. It looks like you'll probably have to change your server address in popdaemon.py to leave out the /exchange/ portion as the original scraper.py appends it automatically.

    So I just saw this note on the google page:

    if you enter your user name and password into form elements embedded in a webpage, you need the forms version

    Where I can get the forms version? I don't seem to see it.
    Last edited by lh99; 08-25-2007 at 10:47 PM.

  10. #20
    Rookie Array

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

    Default

    I'm using 0.0.3

    So, whats a long delay (seconds or minutes)? Here is my sequence:

    benmac:~ kupan787$ telnet 192.168.1.141 110
    Trying 192.168.1.141...
    Connected to 192.168.1.141.
    Escape character is '^]'.
    +OK Outlook Web Access POP3 Proxy
    user *******
    +OK Password required
    pass *******
    +OK User logged in
    stat
    +OK 0 0

    From entering the stat command, to the response back (+OK 0 0), is less than 1 second. After waiting 5 minutes, I issued:

    list
    +OK
    .

    and that is all I see. Attempting to do a top or retr command gets me forced logout. So I decided to do a bit of tracking down, and I am noticing some interesting things:

    Laptop:

    1) For it to work on my laptop, I have to use port 8110. If I use port 110, it complains when starting up.
    2) I can't hardcode in the 'm' value in scraper on my laptop, otherwise I get this:

    Sent welcome message
    User Name sent, asking for password
    User logged in
    error: uncaptured python exception, closing channel <__main__.POPChannel connected 127.0.0.1:61261 at 0x887b0> (exceptions.IOError'http error', 404, 'Resource Not Found', <httplib.HTTPMessage instance at 0x242e90>) [/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/asyncore.py|read|69] [/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/asyncore.py|handle_read_event|390] [/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/asynchat.py|handle_read|136] [popdaemon.py|found_terminator|99] [popdaemon.py|pop_PASS|122] [/Users/kupan787/Desktop/OutlookWebScraper-0/scraper.py|inbox|141] [/Users/kupan787/Desktop/OutlookWebScraper-0/scraper.py|get_folder|151] [/Users/kupan787/Desktop/OutlookWebScraper-0/scraper.py|get_page|94] [/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/urllib.py|open|181] [/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/urllib.py|open_https|384] [/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/urllib.py|http_error|323] [/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/urllib.py|http_error_default|329])

    3) If I use port 8110, and the original scraper file, things work great on my laptop.

    iPhone:

    1) For it to get started, I have to use port 110, otherwise the Mail client wont connect.
    2) If I don't hardcode the 'm' value in scraper, I get the following:

    Sent welcome message
    User Name sent, asking for password
    error: uncaptured python exception, closing channel <__main__.POPChannel connected 127.0.0.1:49175 at 0x363d2c> (<class 'scraper.RetrievalError'>:Couldn't find <base href> on page after logging in. [/usr/lib/python2.5/asyncore.py|read|68] [/usr/lib/python2.5/asyncore.py|handle_read_event|390] [/usr/lib/python2.5/asynchat.py|handle_read|137] [popdaemon.py|found_terminator|99] [popdaemon.py|pop_PASS|115] [/private/var/root/Media/python/scraper.py|login|131])

    3) If I change the port to 110, hardcode my 'm' value, I can login but stat returns nothing (either in telnet or through the mail app).

    Let me know what other information might be helpful in tracking this down. I feel so close!


 

 
Page 2 of 7 FirstFirst 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 01:33 PM.
twitter, follow us!