AquaMail Forum
English - Android => Development builds => Topic started by: Kostya Vasilyev on November 18, 2013, 02:45:56 am
-
http://www.aqua-mail.com/download/AquaMail-market-1.3.0-pre1.6.apk
A big round of applause for @qristo76, please. His help with making sending messages work with Exchange 2010SP2 was immense.
Fixed in this build:
- Drafts / sending not working with Exchange 2010SP2 and possibly others
- Moving a message between folders would make it impossible to download its attachments
- A few smaller fixes
Still working on:
- Properly handle calendar invites (to be on par with IMAP / POP3)
-
Hi,
first of all I want to thank you, this app of yours is great work! Also I very much appreciate the support here.
Now, after the praise, here comes my complaint ;) I get an "HTTP/1.1 401 Unauthorized" error when I try to connect to my company's Exchange server (Build Number 14.3.158.1, i.e. Update Rollup 2 for Exchange Server 2010 SP3). Login is 100% correct. When I open h ttps://foo.bar/EWS/Exchange.asmx (with foo.bar being replaced by my company's server address, of course) in my browser, the login works.
This is the log associated with the issue (I had to replace http with h ttp because of the forum restrictions):
2013.11.19 13:33:09.235 +0100 UIModeTracker onScreenOff
2013.11.19 13:33:09.236 +0100 UIModeTracker Notifying listeners
2013.11.19 13:33:09.237 +0100 UILock Locking the UI now, lockNow = true
2013.11.19 13:34:58.748 +0100 UIModeTracker onScreenOff
2013.11.19 13:34:58.749 +0100 UIModeTracker Notifying listeners
2013.11.19 13:34:58.750 +0100 UILock Locking the UI now, lockNow = true
2013.11.19 13:35:45.703 +0100 UIModeTracker onStart org.kman.AquaMail.ui.AccountSetupActivity$Light
2013.11.19 13:35:45.705 +0100 UIModeTracker onResume org.kman.AquaMail.ui.AccountSetupActivity$Light
2013.11.19 13:35:48.436 +0100 AquaMail [MDATR.1] UI requested Exchange account check: org.kman.AquaMail.mail.MailAccount@42097eb8: id = 10000, name = John Doe, email = j.doe@foo-bar
2013.11.19 13:35:48.437 +0100 MailStateWatcher Service state change uri: content://org.kman.AquaMail.data/accounts/10000/test/ews, what: 100, aux = 0x0000
2013.11.19 13:35:48.438 +0100 AquaMail [POWER.1] >>>>> Acquiring wake lock for MailTaskExecutor Executor_Network
2013.11.19 13:35:48.439 +0100 AquaMail [POWER.1] Acquired wake lock flag 0x00100000, result 0x00100000
2013.11.19 13:35:48.440 +0100 LockManager Acquiring the Wake lock
2013.11.19 13:35:48.475 +0100 AquaMail [EXEC.1867] Received task [org.kman.AquaMail.mail.ews.EwsTask_CheckAccount@42599d30, content://org.kman.AquaMail.data/accounts/10000/test/ews]
2013.11.19 13:35:48.492 +0100 AquaMail [MDATR.1867] Using WiFi sync policy values
2013.11.19 13:35:48.493 +0100 AquaMail [NETWRK.1867] Request for connection content://org.kman.AquaMail.data/accounts/10000/test/ews to [foo.bar:443, sslStrict]
2013.11.19 13:35:48.524 +0100 AquaMail [POWER.1867] >>>>> Acquiring wake lock for MailConnectionManager
2013.11.19 13:35:48.525 +0100 AquaMail [POWER.1867] Acquired wake lock flag 0x00010000, result 0x00110000
2013.11.19 13:35:48.526 +0100 LockManager ... Wake lock already held
2013.11.19 13:35:48.550 +0100 AquaMail [EWS.1867] Creating HTTP client
2013.11.19 13:35:48.558 +0100 AquaMail [EWS.1867] Executing HTTP request EwsCmd_GetFolderInfo to h ttps://foo.bar/EWS/Exchange.asmx
2013.11.19 13:35:48.559 +0100 AquaMail [EWS_RAW.1867] <soap:Envelope xmlns:xsi="h ttp://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="h ttp://www.w3.org/2001/XMLSchema"
xmlns:soap="h ttp://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="h ttp://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2007_SP1" />
</soap:Header>
<soap:Body>
<GetFolder xmlns="h ttp://schemas.microsoft.com/exchange/services/2006/messages">
<FolderShape>
<t:BaseShape>Default</t:BaseShape>
</FolderShape>
<FolderIds>
<t:DistinguishedFolderId Id="inbox" />
</FolderIds>
</GetFolder>
</soap:Body>
</soap:Envelope>
2013.11.19 13:35:48.842 +0100 AquaMail [EWS.1867] Error executing request: "HTTP/1.1 401 Unauthorized"
2013.11.19 13:35:48.844 +0100 AquaMail [EWS.1867] Result: -3, traffic: 0 read, 0 write, time: 293ms
2013.11.19 13:35:48.848 +0100 MailStateWatcher Service state change uri: content://org.kman.AquaMail.data/accounts/10000/test/ews, what: 101, aux = 0xfffffffd
2013.11.19 13:35:48.856 +0100 AquaMail [TASKS.1867] Task [org.kman.AquaMail.mail.ews.EwsTask_CheckAccount@42599d30, content://org.kman.AquaMail.data/accounts/10000/test/ews] took 0,36 seconds to process
2013.11.19 13:35:48.858 +0100 AquaMail [NETWRK.1867] Network usage: 0/0 bytes read/written
2013.11.19 13:35:48.860 +0100 AquaMail [NETWRK.1867] Releasing connection [content://org.kman.AquaMail.data/accounts/10000/test/ews, h ttps://foo.bar/EWS/Exchange.asmx]
2013.11.19 13:35:48.866 +0100 AquaMail [NETWRK.1867] Connection manager, can't release wake lock
2013.11.19 13:35:48.871 +0100 AquaMail [NETWRK.1865] Closing the connection [content://org.kman.AquaMail.data/accounts/10000/test/ews, h ttps://foo.bar/EWS/Exchange.asmx]
2013.11.19 13:35:48.873 +0100 AquaMail [NETWRK.1867] In process: 0
2013.11.19 13:35:48.875 +0100 AquaMail [NETWRK.1867] Active : count = 0
2013.11.19 13:35:48.876 +0100 AquaMail [NETWRK.1867] Idle : count = 0
2013.11.19 13:35:48.878 +0100 AquaMail [NETWRK.1867] Lingering : count = 1
2013.11.19 13:35:48.880 +0100 AquaMail [NETWRK.1867] [content://org.kman.AquaMail.data/accounts/1/in, Socket[address=foo.bar/xxx,port=993,localPort=55601]]
2013.11.19 13:35:48.881 +0100 AquaMail [NETWRK.1867] Closing : count = 1
2013.11.19 13:35:48.881 +0100 AquaMail [NETWRK.1867] [content://org.kman.AquaMail.data/accounts/10000/test/ews, not conn]
2013.11.19 13:35:48.882 +0100 AquaMail [POWER.1865] >>>>> Releasing wake lock for MailConnectionManager
2013.11.19 13:35:48.883 +0100 AquaMail [POWER.1865] Released wake lock flag 0x00010000, result 0x00100000
2013.11.19 13:35:48.885 +0100 AquaMail [POWER.1867] >>>>> Releasing wake lock for MailTaskExecutor Executor_Network
2013.11.19 13:35:48.886 +0100 AquaMail [POWER.1867] Released wake lock flag 0x00100000, result 0x00000000
2013.11.19 13:35:48.887 +0100 LockManager Releasing all locks
2013.11.19 13:35:48.890 +0100 LockManager Releasing the Wake lock, time held = 0,45 sec
2013.11.19 13:35:48.893 +0100 LockManager After release: Wake lock isHeld = false
2013.11.19 13:35:48.894 +0100 LockManager WiFi lock is not held
2013.11.19 13:35:48.895 +0100 StartSyncService All locks have been released
2013.11.19 13:35:48.897 +0100 PushConnectivityReceiver Unblocking the events, old state = false
-
@bennigecko -- it's my understanding that sometimes EWS requires the login to be in the form of "domain\username" or "domain\username@address" (depending on how it's configured), could you try that? Is there an Exchange admin you could ask about this?
One other thing is, when you tested in the browser, did the page (site) redirect to another URL?
Something like: you enter "https://foo.com/EWS/Exchange.asmx", prompted for your login / password, they're accepted and then you end up at "https://bar.com/EWS/Exchange.asmx" (note the foo.com vs. bar.com difference).
The reasons I ask is that i'm using Apache HTTP library, and it would be hard to believe it sends the wrong login / password... so it's more likely to be something less obvious, just want to understand what.
-
I'm not being redirected, however after entering my login and pw on "h ttps://mail.company.de/EWS/Exchange.asmx" I end up at "h ttps://mail.company.de/ews/Services.wsdl" Right now there isn't any admin I could ask further questions, but I can try tomorrow.
I also tried another android app with EWS support, there the login works if it's in the form of domain/username (with slash, backslash doesn't work). When I open "h ttps://mail.company.de/EWS/Exchange.asmx" in the browser the login has to be username@domain.de though. domain/username wouldn't work. Then again, if I access the account via OWA both variants lead to success.
Another thing I noticed is that the 401 Unauthorized reply comes very fast - as you can see in the log it doesn't even take a second. Not sure if that means something, but I've been playing around with email apps for quite some time and and it always takes at least a couple of seconds until the connection is granted or refused.
Oh and I also tried pre1.8, same problem ;)
-
Thanks for the info. The host name stays the same, so that's not the issue.
I wonder if the server uses NTLM authentication (not implemented in AquaMail right now, but I'd add it if needed).
Too bad the admin is not around to ask.
If your web browser is Chrome, this is a simple way to check:
- before opening the EWS page, hit Ctrl+Shft+I, choose the "Network" tab in the panel that opens below
- type the EWS URL, authenticate
- in the network tab below, click on the just executed page request, and look for a request header that starts with Authentication, the next word is the authentication type.
I'm attaching a screenshot below, this is Exchange Online and it uses Basic authentication.
-
"Authorization: NTLM". Looks like the evildoer is identified ;)
It would be great if you could implement it, I would be happy to test it further then.
-
Great, thanks for investigating!
Yes, I'm going to implement NTLM as soon as I can.
-
@benniegecko:
Could you try this version please: 1.3.0-pre2.1
http://www.aqua-mail.com/forum/index.php?topic=1801.msg6257#msg6257
If it doesn't work, could you capture a debug log (with session data enabled)?
As a reminder, the log does not contain passwords.
-
No need for a log, it works fine now and I haven't run into any issues so far. Huge thanks!
-
Great, thanks for the update!