AquaMail Forum

English - Android => How do I... => Topic started by: ewill on December 18, 2016, 09:38:45 pm

Title: Struggling with Exchange Push mail
Post by: ewill on December 18, 2016, 09:38:45 pm
I have been admiring AquaMail from the side - the dealbreaker for me was pushmail from Exchange.  Now that I see it is supported, I purchased the premium.

I am having trouble actually getting pushmail to work.

Here is what I have:
-I have just upgraded to 1.7.1-91
-CM 13 on an LG G4
-General Settings:
--Sync even when "auto Sync" is off
--Scheduled Sync - checked
--Mail check interval -  1 hour (though I would like to extend that to preserve the battery and just rely on the push)
--Push mail enabled
--everything else is at the default setting
-Exchange account options
--Schedudled sync - checked
--Include in sync all - checked

The server is outlook.office365.com.  I know that the push takes a while to sync in - it has been over 12 hours since I enabled auto sync

When I send an email, it is not detected in AuquaMail until I do a sync.  What am I missing?

Thanks for the help
Title: Re: Struggling with Exchange Push mail
Post by: mikeone on December 18, 2016, 10:16:16 pm
Please check your settings for 'Push' as follows - to get notifications about' new messages' immediately -:

1 - On app's level
> Menu button > Settings > Mail, receiving:
Push mail: enabled [enabled by default]

2 - On account level
> long press on account name > Options and folders > Account options:
Push mail: enabled [disabled by default]

3 - On folder level
> long press on account name > Options and folders > Folders > press the wheel of the folder where you want to get push notifications (e.g. Inbox):
check 'Use Push mail'

Please have a look into the app's FAQ-page:
http://www.aqua-mail.com/?page_id=227
> Search for "How do I enable Push mail"
Title: Re: Struggling with Exchange Push mail
Post by: StR on December 18, 2016, 10:23:04 pm
--Push mail enabled

Just in case, - where have you enabled the Push? There are three places where it has to be enabled (I believe, two are enabled by default): app level, account level, specific folder.
Please read the item "How do I enable Push mail?" in the FAQ:
http://www.aqua-mail.com/?page_id=227

Quote
--Mail check interval -  1 hour (though I would like to extend that to preserve the battery and just rely on the push)
Mail check ("scheduled sync") works as a "backup" for PUSH. I don't know all details about the implementation of Push on EWS, but I know that Push on IMAP can have a time-out (depending on the server) on either 0.5- or 1-hour time scale. So, from everything I've read here on the forum it would be wise to keep sync at least once an hour.
And, AFAIK (although I am not using Exchange), - battery use from a sync is much less then from enabling Push.
Title: Re: Struggling with Exchange Push mail
Post by: Kostya Vasilyev on December 18, 2016, 10:43:08 pm
Quote
Here is what I have:
-I have just upgraded to 1.7.1-91
-CM 13 on an LG G4
-General Settings:
--Sync even when "auto Sync" is off
--Scheduled Sync - checked
--Mail check interval -  1 hour (though I would like to extend that to preserve the battery and just rely on the push)
--Push mail enabled
--everything else is at the default setting
-Exchange account options
--Schedudled sync - checked
--Include in sync all - checked

Everything looks good except:

1 - account options -> push mail needs to be enabled

2 - if this is an old install of Aqua Mail, from before 1.7, please check the Inbox's "per folder" push setting

My test account is at Office 365 as well, works fine, let's see... Yours is a company / corporate, with a custom domain name?
Title: Re: Struggling with Exchange Push mail
Post by: ewill on December 18, 2016, 11:23:29 pm
Thanks for all of the quick assistance.  Before I saw the response, I was getting a bit eager and I happened to see another post where the person deleted and recreated the exchange account.  Since I set up the exchange account before my pro purchase, I had decided to try that.

And - push is now working!

I appreciate all of the help.  I would bet that something in the list would have helped.

 :)
Title: Re: Struggling with Exchange Push mail
Post by: mikeone on December 18, 2016, 11:53:19 pm
Glad to hear that push is properly working now.
Thanks for your feedback.
Title: Re: Struggling with Exchange Push mail
Post by: Godwin on December 23, 2016, 02:41:15 pm
I'm also struggling with Exchange push mail.

All the options are enabled. However in the Account options/Push Mail it says "Push mail for this account seems to be blocked on the server".

Push works with the Outlook app so it's not a device problem.

Trev
Title: Re: Struggling with Exchange Push mail
Post by: Kostya Vasilyev on December 23, 2016, 10:49:44 pm
Re: All the options are enabled. However in the Account options/Push Mail it says "Push mail for this account seems to be blocked on the server".

Yep.

There are different ways to connect to Exchange and different ways to implement push.

Aqua Mail uses 1) EWS to connect and 2) "push subscriptions" for well push mail.

Even though both are official documented Exchange features, some IT departments block EWS completely or push subs specifically.

Your mail server, unfortunately, falls into the second category. This affects about 3-5% of users.

PS - and some IT depts block all mail apps except a certain "white list".
Title: Re: Struggling with Exchange Push mail
Post by: starks on December 24, 2016, 10:03:40 pm
Ugh. I hadn't enabled push at the account or folder level. No wonder why AquaMail wasn't behaving any differently from before.

I have a lot of folders. It was pain going through each. Still don't think I'm getting the proper notifications for mail delivery.

Doing all of this wasn't obvious. If it's not going to be default, it should be readily apparent to any user.
Title: Re: Struggling with Exchange Push mail
Post by: mikeone on December 25, 2016, 02:36:21 pm
Usually you don't need "Push" enabled for all FOLDERS, but just for the INBOX (which receives new incoming messages)
Title: Re: Struggling with Exchange Push mail
Post by: starks on December 26, 2016, 05:26:19 am
Only 1% of my new mail ends up in Inbox. Each folder is dictated by rules.
Title: Re: Struggling with Exchange Push mail
Post by: Kostya Vasilyev on December 27, 2016, 10:13:18 pm
Re: Push mail for this account seems to be blocked on the server

If it says that, then it might really mean that.

It's a real legitimate issue, Aqua Mail uses something called "EWS push notifications" and I've seen some servers not do what they're supposed to, presumably due to a security policy.

Feel free to post the "Exchange push device is" from Aqua Mail settings -> Debug (very end, tapping the ID copies to the clipboard) and I will check the logs of our "cloud component".

This ID is a random hash, doesn't disclose anything about your identity, or feel free to email it to support / at / aqua-mail / dot com.

Finally, if you'd purchased the app for this feature specifically and this is a "no go" for you, feel free to email support / at / aqua-mail / dot com and we'll cancel / refund.
Title: Re: Struggling with Exchange Push mail
Post by: StR on December 28, 2016, 01:06:23 am
Re: Push mail for this account seems to be blocked on the server

If it says that, then it might really mean that.

It's a real legitimate issue, Aqua Mail uses something called "EWS push notifications" and I've seen some servers not do what they're supposed to, presumably due to a security policy.

Kostya, you seem to be repeating your own answer to the same question. (Look just up this thread)  ;)
You need some rest. Enjoy your upcoming holidays!

PS. You might consider adding that question/answer to the FAQ. It is not just frequently answered, but also frequently asked.  ;D
Title: Re: Struggling with Exchange Push mail
Post by: Taepoong on December 29, 2016, 01:02:28 pm
Dear everybody,

May I pickup the topic again?

I installed the most recent release of aqua mail pro, enabled all 3 options for push mail (app, account, folder level). But it is still not working. However, push is working fine using the Android default mail app (which I hate).

Is there still something missing, I have to adjust?

Thank you to everybody.

Taepoong

Title: Re: Struggling with Exchange Push mail
Post by: Kostya Vasilyev on December 30, 2016, 09:45:39 pm
I can only repeat my above explanation...

Quote
Re: All the options are enabled. However in the Account options/Push Mail it says "Push mail for this account seems to be blocked on the server".

Yep.

There are different ways to connect to Exchange and different ways to implement push.

Aqua Mail uses 1) EWS to connect and 2) "push subscriptions" for well push mail.

Even though both are official documented Exchange features, some IT departments block EWS completely or push subs specifically.

Your mail server, unfortunately, falls into the second category. This affects about 3-5% of users.

PS - and some IT depts block all mail apps except a certain "white list".
Title: Re: Struggling with Exchange Push mail
Post by: StR on December 30, 2016, 11:21:37 pm
@Taepoong:
In the other thread I've already pointed out to Kostya's posting in this thread (just a few posts above), and he just quoted himself again.

Is there still something missing, I have to adjust?
Just in case it is not obvious from the quote above, - you can talk to your IT people and ask if they can enable "Push subscriptions". (I assume EWS works for you, it is only push that doesn't.)

Yet another option is to change your job and go to the place that has more cooperating IT people.  ;D 
Or, you can become the CEO and fire those IT folks.  8)
Title: Re: Struggling with Exchange Push mail
Post by: ewill on January 02, 2017, 05:04:28 pm
I have just upgraded my phone to Nougat (Lineage/CM 14.1) and my push issues have returned.

I have checked and I have push enabled in all 3 places.

I set AquaMail to not be battery optimized

I have even deleted and re-set up my Exchange account.

I am on the latest development build (1.8.0-107).

Any ideas?

Edit: I was browsing some more and I saw that Doze under Nougat is a bit more strict.  As a test, I added a calendar event 2 minutes to the future in my google calendar - and the notification app that I use recognize the appointment and started the notification.  All this while the screen is off and within 2 minutes of adding the appointment to my calendar.
Title: Re: Struggling with Exchange Push mail
Post by: Kostya Vasilyev on January 04, 2017, 01:03:45 am
Aqua Mail's push for Exchange uses Google Cloud Messaging, which is not supposed to be affected by Doze Mode.

If you post the "Exchange push device ID" from Aqua Mail's settings -> debug, I will check server logs (tapping that setting copies the value into the clipboard).

Title: Re: Struggling with Exchange Push mail
Post by: ewill on January 04, 2017, 02:23:57 pm
Aqua Mail's push for Exchange uses Google Cloud Messaging, which is not supposed to be affected by Doze Mode.

If you post the "Exchange push device ID" from Aqua Mail's settings -> debug, I will check server logs (tapping that setting copies the value into the clipboard).
Thanks. Exchange push device id:
b22efcbec3dc31f36f2b7c5b7941b7e5cff9ae22

I have it set meanwhile for a sync every 15 minutes. Let me know if you would like me to change that for testing purposes.



Sent from my LG-H811 using Tapatalk

Title: Re: Struggling with Exchange Push mail
Post by: Kostya Vasilyev on January 06, 2017, 10:21:55 pm
Quote
Thanks. Exchange push device id:
b22efcbec3dc31f36f2b7c5b7941b7e5cff9ae22

Thank you.

Our server actually is receiving events from your Exchange server, and then routes them to Aqua Mail on the device, over Google Cloud Messaging.

( so I was wrong with my guess about the underlying reason )

This is very interesting. Most recent event was received just a few minutes ago.

There are new messages, messages being moved between folders, etc (I'll mention again that all that's there is abstract message and folder hashes, nothing more).

Please enable debug logging, with "raw session data" as described in my signature below (link), re-enable all three push options, and collect a log over say 2-3 hours.

Over this time, please make it so that there are actual changes (new messages, changes of read/unread state, etc), maybe make some changes like that 3-10 minutes after you start the log.

Then send the log file to support / at / aqua-mail / dot com please.
Title: Re: Struggling with Exchange Push mail
Post by: ewill on January 06, 2017, 11:43:09 pm
Thanks for looking into it - I will not be able to do that for another day, but I will certainly collect the log and send it to you (making sure that I have the activity you described).

One question, I now have it set for a 15 minute sync (so that I get something) - during my logging period, should I change that to any other setting?

Title: Re: Struggling with Exchange Push mail
Post by: ewill on January 08, 2017, 03:11:01 am
This is somewhat of a mystery.  I started the debugging and noticed that push seemed to be working.  The only thing that I changed is that I had uploaded the newest development version 1.8.0-112, set analytics to off and started debugging.   Push seems to be working now with debugging set to off.  I will continue to monitor and send a log if push stops.

Like I say, it is somewhat of a mystery, but if it is working, that is all good.

Thanks for the help.
Title: Re: Struggling with Exchange Push mail
Post by: Kostya Vasilyev on January 08, 2017, 11:18:45 pm
Quote
This is somewhat of a mystery.  I started the debugging and noticed that push seemed to be working.  The only thing that I changed is that I had uploaded the newest development version 1.8.0-112, set analytics to off and started debugging.   Push seems to be working now with debugging set to off.  I will continue to monitor and send a log if push stops.

Like I say, it is somewhat of a mystery, but if it is working, that is all good.

Maybe your IT dept has removed the blocking.

Maybe installing a newer Aqua Mail version "fixed" the previously broken GCM (the app asks Google Play Services to regenerate its device token ID when it detects that it's been updated... and I've seen those tokens go bad, push messages not delivered).

Anyway, glad to hear about the improvement.
Title: Re: Struggling with Exchange Push mail
Post by: ewill on January 09, 2017, 01:30:56 am
Quote
This is somewhat of a mystery.  I started the debugging and noticed that push seemed to be working.  The only thing that I changed is that I had uploaded the newest development version 1.8.0-112, set analytics to off and started debugging.   Push seems to be working now with debugging set to off.  I will continue to monitor and send a log if push stops.

Like I say, it is somewhat of a mystery, but if it is working, that is all good.

Maybe your IT dept has removed the blocking.

Maybe installing a newer Aqua Mail version "fixed" the previously broken GCM (the app asks Google Play Services to regenerate its device token ID when it detects that it's been updated... and I've seen those tokens go bad, push messages not delivered).

Anyway, glad to hear about the improvement.

I don't think there was any blocking by my IT department - this all happened over the weekend.

However, the token ID seems to be a great possibility.  When I upgraded to Nougat, I did a fresh install and restored my apps a Titanium Backup.  Perhaps that process resulted in a bad token. 

Thank you very much for the help.
Title: Re: Struggling with Exchange Push mail
Post by: ewill on January 24, 2017, 06:02:44 am
I just went through an episode of push mail not working - then it began working again.

The steps were as follows:
-I installed the latest development build (design refresh).  I didn't have much time to look through the differences and wanted to revert until I had a bit more time, so I restored (using titanium) the prior version
-About a day later, I notice that push was no longer working.

Then, I did a bunch of stuff:
-installed the latest development build
-erased cache and rebooted
-detached aqua from google play (using the Titanium utility)
-reinstalled the latest development build
-unchecked and rechecked all 3 places were push is configured
Push was still not working

Got tired of fooling with it and just set the sync to 15 minutes (from my typical setting of 24 hours - just relying in push).

Then, after nearly a day, push starts working.

Right now all is good.  If you want me to try to replicate the issue and send you a log when the issue is occurring, I can do that - however I will be traveling over the next few days and will not be able to do that immediately.

The one thing in common both times that push stopped is that it happened just after a restore (using titanium backup).

Title: Re: Struggling with Exchange Push mail
Post by: Kostya Vasilyev on January 24, 2017, 10:03:04 pm
Re: both times that push stopped is that it happened just after a restore (using titanium backup).

Maybe it's the wrong token issue too.

Play Services is supposed to notice app updates and re-generate the tokens, but I've seen it get out of sync with the cloud side of Google Cloud Messaging.
Title: Re: Struggling with Exchange Push mail
Post by: ewill on January 24, 2017, 10:26:59 pm
Token issue would explain it.

Is there a way to force a regeneration of the token?
Title: Re: Struggling with Exchange Push mail
Post by: Kostya Vasilyev on January 24, 2017, 10:56:31 pm
Re: Is there a way to force a regeneration of the token?

It's one of those magical things that is supposed to happen automatically.

Aqua Mail requests a new token when it sees a change in its own version, the phone's Android version or build number (e.g. 6.0.1 -> 6.0.1 with patches), etc.

But tokens are managed by Google Play Services, and I have seen them get "stuck" and the only way to fix it was to reinstall the app.

https://github.com/firebase/quickstart-android/issues/72#issuecomment-267410547