Author Topic: Authenticate Error with Exchange IMAP  (Read 14826 times)

tiouini

  • Newbie
  • *
  • Posts: 12
Authenticate Error with Exchange IMAP
« on: November 24, 2015, 05:00:20 pm »
Hello,

I'm working with AquaMail to get Exchange 2010 mails with IMAP.
It works fine but sometimes, I'm getting an autenthicate error.
I can get this error several times and then it disappears without changing anything.

The error message is (sorry for french part, I'm working with a french phone)...
"Erreur d'identification (login) avec le serveur entrant : NO AUTHENTICATE FAILED".
(Login Error with incoming server : no authenticate failed)

Thanks for your help.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Authenticate Error with Exchange IMAP
« Reply #1 on: November 25, 2015, 09:26:41 pm »
The message comes from the mail server, AquaMail just shows it.

The "NO" in "NO AUTHENTICATE FAILED" is part of IMAP's command response, and that's why the whole thing is in English.

I'm confident that the app sends the login and the password exactly as entered -- or there'd be hundreds or thousands of messages on the forum about it (which there aren't).

Is it possible that it's some sort of transient error on the server side? Or maybe your company's "computer people" have some sort of limit in place? How often a mail app is allowed to log in, from how many devices, that sort of thing?
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

tiouini

  • Newbie
  • *
  • Posts: 12
Re: Authenticate Error with Exchange IMAP
« Reply #2 on: December 07, 2015, 06:20:07 pm »
Hello,

Sorry for my late response....

I have looked on the default throttling policy on our Exchange 2010.
IMAPMaxConcurrency is set to null, so unlimited.

I have increased EASMaxDevices and EASMaxConcurrency from 10 to 20 which are Exchange ActiveSync parameters.

I don't think that they were good properties to change as I'm connected with IMAP on AquaMail.

Many thanks in advance for your help.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Authenticate Error with Exchange IMAP
« Reply #3 on: December 07, 2015, 06:29:05 pm »
Sorry my knowledge of Exchange's advanced server setting is -- "non-existent". You're way ahead of me.

All I can say is that when you see this message in AquaMail, it's a "real" error that was returned by the server.

In terms of connections -- push mail needs one per folder + one connection for scheduled mail checks.

Most of the time, connections should get closed gracefully, with proper log out command.

One possible exception (applies to both push and scheduled checks) is when the "network" or maybe the server is too happy to abort existing network connections between the app and the server -- essentially aborting them.

Some mobile operators are known to do this, closing connections after a few minutes.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

tiouini

  • Newbie
  • *
  • Posts: 12
Re: Authenticate Error with Exchange IMAP
« Reply #4 on: December 07, 2015, 06:44:45 pm »
Don't worry about your Exchange knowledge.

I have put my response to help others users and see if someone has an idea to help me more.

I will tell you later this week if my changes are fine.

Many thanks for you help and for your very fast response :-).


tiouini

  • Newbie
  • *
  • Posts: 12
Re: Authenticate Error with Exchange IMAP
« Reply #5 on: December 09, 2015, 04:34:16 pm »
Hello,

My changes didn't change anything  :-\.
Still getting "No Authenticate" message.

For information, when I get this error, if I'm going in "Configure Account" menu, and press "Next" and then "Save" button without changing anything in the parameters, it works !

Does it give you more information to help ?

Many thanks in advance.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Authenticate Error with Exchange IMAP
« Reply #6 on: December 09, 2015, 05:08:13 pm »
Not to me, but then I'm not an Exchange expert.

Maybe there is a limit to the number of simultaneous connections, and maybe your phone or the network is too happy to abort existing network connections when the phone is idle (when the app's in the background).
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

tiouini

  • Newbie
  • *
  • Posts: 12
Re: Authenticate Error with Exchange IMAP
« Reply #7 on: December 09, 2015, 06:15:17 pm »
OK, I have looked on a way to change the limit of simultaneous connections and founded the MaxConnectionsPerUser. Old settings was 16. I have changed it to 50.

I will let you know tomorrow if it works.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Authenticate Error with Exchange IMAP
« Reply #8 on: December 09, 2015, 06:19:08 pm »
As I wrote -- AquaMail needs one connection per push folder + one connection for scheduled mail checks.

But if they get aborted (phone switching between WiFi and mobile, or the intermediary networks disconnecting "inactive" connections) -- then the app has to make new ones (and close the old connections, which may be too late to be seen by the server).
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

tiouini

  • Newbie
  • *
  • Posts: 12
Re: Authenticate Error with Exchange IMAP
« Reply #9 on: December 24, 2015, 11:24:52 am »
Hello,

my change from 16 to 50 for MaxConnectionsPerUser settings has not changed anything, still getting "No Authenticate failed" error.
I wonder if the error frequency is longer than before so I have change the property from 50 to 100.

I will let you know if it's better.

Waiting that, I wish you a merry Christmas.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Authenticate Error with Exchange IMAP
« Reply #10 on: December 25, 2015, 11:22:59 pm »
I wonder if there is some sort of connection leak -- not necessarily in AquaMail either.

FWIW -- Gmail is limited to 15 connections per account, and I've got AquaMail running with Gmail accounts on 2-3 devices at the same time. No issues at all.

Do you use push mail in AquaMail?

Can you try turning it off to see if it makes a difference?
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

mi7chy

  • Newbie
  • *
  • Posts: 13
Re: Authenticate Error with Exchange IMAP
« Reply #11 on: January 03, 2016, 11:08:07 pm »
Don't know if it's related but I get much more frequent failures attempting to sync mail with Microsoft Live IMAP than Yahoo IMAP with default Aqua Mail IMAP settings.  Unchecking 'Enable optimizations' under IMAP options seems to lessen the failures so something you can try.
« Last Edit: January 04, 2016, 12:10:10 am by mi7chy »

tiouini

  • Newbie
  • *
  • Posts: 12
Re: Authenticate Error with Exchange IMAP
« Reply #12 on: January 05, 2016, 12:41:08 pm »
Hello,

Firstable, all my best wishes for this new year.

Changing MaxConnectionsPerUser from 16 to 50 hasn't changed anything.


Yes, I'm using PushMail as it's the best way to get "fresh" data.

But, in AquaMail parameters/Network, I have changed "Keep-Alive" property to None, in Wifi and Data.

These changes seem to make some improvements and error is not going quickly, yesterday the error was only going at 6pm.

So, this morning, I have looked on Event Viewer on the Exchange Server and see this error.

Source : MSExchangeIS
Error 9646 :
MAPI session..... exceeded the maximum number of 16 objects of type « session ».


After looking for this error with my friend Google, I have seen that 2 properties ("Maximum Allowed Sessions Per User" and "Maximum Allowed Service Sessions Per User") should be added in the registry on the exchange server.

I have added these properties in the registry of my echange server and set them to 0x20 (32).

Moreover, the "MaxConnectionsPerUser" property in Exchange Server Console (founded in Server Configuration/Client Access/POP3 and IMAP4/IMAP4/Connection) is not the same the property. As a result, adding "Maximum Allowed Sessions Per User" and "Maximum Allowed Service Sessions Per User" in the registry has no effect in the "MaxConnectionsPerUser" property.


Please see the following article :
http://www.msexchange.org/blogs/walther/news/so-you-still-have-issues-opening-many-shared-exchange-2010-calendars-using-outlook-2003-569.html [nofollow]

Moreover you will find detailed explanations on this technet article :
https://technet.microsoft.com/en-us/library/ff477612.aspx#SL [nofollow]


In conclusion, it seems that problem is due to MAPI sessions that were not closed.

My properties are now set like this :

Exchange Properties :
MaxConnectionsPerUser : 16 (back to default)
Maximum Allowed Sessions Per User : 0x20
Maximum Allowed Service Sessions Per User : 0x20

AquaMail Properties :
Keep-Alive : None (in Wifi and Data)

Vasilyev, could you tell me why AquaMail generate a MAPI error whereas I'm connected to Exchange with IMAP ? Something wrong in my configuration ?

Thanks in advance.

I will let you know if it works.

Thanks.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Authenticate Error with Exchange IMAP
« Reply #13 on: January 05, 2016, 02:56:18 pm »
Re: Vasilyev, could you tell me why AquaMail generate a MAPI error whereas I'm connected to Exchange with IMAP ? Something wrong in my configuration ?

Wish I could, but I don't work on Exchange.

I can elaborate a bit on sessions (connections) though.

IMAP push requires a separate connection per folder to work (+ one connection is needed for scheduled mail checks, message downloading, marking read etc.)

This connection has to "be alive" to be useful.

The IMAP spec guarantees that connections will be left open at least for 30 minutes, in terms of server not closing them. I don't know if Exchange is different.

Second, some networks (I mean the networks between your Android phone and the mail server) can be too happy to disconnect "unused" connections (when there is no active data flow).

Therefore -- AquaMail "checks" every IDLE connection every few minutes, by sending an "empty" command and waiting for a response. This lets the server and the intermediary networks know that this connection is not really "unused".

Now, if the app gets no response from the server (inside a few seconds) to this "empty" command, then it's assumed that the connection went dead (on the server, or closed by the intermediary networks) and it's dropped and a new one is made, in order to provide reliable push mail.

Finally, if a connection is "dropped" it may take a long time for the server to notice this and "cross it out" -- TCP/IP does not have a good way to detect this case, you only find out that a connection has gone "dead" when sending something (and even then, on the second attempt to send).

There is something called "SO_KEEPALIVE" but it checks at two hour intervals, too long to be useful.

---

And that's about *all* I know about IMAP, networking and connections.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

tiouini

  • Newbie
  • *
  • Posts: 12
Re: Authenticate Error with Exchange IMAP
« Reply #14 on: January 19, 2016, 04:48:11 pm »
Hello,

I think that my problem is almost gone !


My properties are now set like this :

Exchange Properties :
MaxConnectionsPerUser : 16 (back to default)
Maximum Allowed Sessions Per User : 0x30 (48)
Maximum Allowed Service Sessions Per User : 0x30 (48)

Connections seems to work now.

But I get the error back (the NO AUTHENTICATE failed) when I'm connected to a wifi connection and I close it.
Now, there is no error on the Exchange Server.
After closing the wifi connection, I'm getting the error during 15 minutes but meanwhile I'm still receiving emails...
Then error is gone...

Do you have any idea ?
Thanks.