Skip to content

Commit

Permalink
Merge pull request #54 from nylas/disable_exchange_2019_support
Browse files Browse the repository at this point in the history
Force using Exchange 2016 protocol for Exchange 2019
  • Loading branch information
khamidou authored Aug 27, 2020
2 parents 16ccf8f + eb2e287 commit 9c4dd32
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions exchangelib/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ def from_xml(cls, elem):
def api_version(self):
if EXCHANGE_2013_SP1 <= self < EXCHANGE_2016:
return 'Exchange2013_SP1'

# Force Exchange 2016 protocol version for Exchange 2019
# because Exchangelib doesn't work out of the box with
# service accounts on these servers.
if self >= EXCHANGE_2019:
return 'Exchange2016'

try:
return self.API_VERSION_MAP[self.major_version][self.minor_version]
except KeyError:
Expand Down

0 comments on commit 9c4dd32

Please sign in to comment.