mguessan / davmail

DavMail POP/IMAP/SMTP/Caldav/Carddav/LDAP Exchange and Office 365 Gateway - Synced with main subversion repository at
http://davmail.sourceforge.net
GNU General Public License v2.0
582 stars 86 forks source link

402 connection attemps in a single second (401 unauthorized) #183

Open jkellermeier opened 3 years ago

jkellermeier commented 3 years ago

One of our users run into a problem - the system tried to connect but get 401 unauthorized all the time. We could fix that at the client, BUT the DavMail tried to connect 402 times in a single second - continoues!

2021-11-08 00:00:00 10.x.x.x POST /ews/exchange.asmx &CorrelationID=;&ClientId=...&cafeReqId=...-...-...-...-...ade; 443 USERNAME 10.x.x.x Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/90.0.4430.93+Safari/537.36+Edg/90.0.818.49 - 401 1 1326 15

It's a lot of log volume on the servers when this happens!

Is there a posibility to reduce the connection attemps or better stop the connection attemps when resceiving the same error again and again?

Kind regards

mguessan commented 2 years ago

Would need to have more information on the client interacting with DavMail. DavMail never initiates interaction with Exchange by itself, on authentication errors DavMail returns an error to the client that should have a retry limit.

In addition, DavMail can detect when throttling is triggered on Exchange: https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/ews-throttling-in-exchange

Regards