From b96a009bb3f2c189af1a921a7f50f547b19620f9 Mon Sep 17 00:00:00 2001 From: Erik Cederstrand Date: Tue, 19 Jan 2021 21:01:41 +0100 Subject: [PATCH] Backport of upstream commit 3b773ec9 See https://github.com/ecederstrand/exchangelib/commit/3b773ec924a6bed70cc0a4c410efeb28d3ed4994 --- exchangelib/transport.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exchangelib/transport.py b/exchangelib/transport.py index 53a133fb..4c3fd51a 100644 --- a/exchangelib/transport.py +++ b/exchangelib/transport.py @@ -36,11 +36,11 @@ def extra_headers(account): + """Generate extra HTTP headers """ - Generate extra headers for impersonation requests. See - https://blogs.msdn.microsoft.com/webdav_101/2015/05/11/best-practices-ews-authentication-and-access-issues/ - """ - if account and account.access_type == IMPERSONATION: + if account: + # See + # https://blogs.msdn.microsoft.com/webdav_101/2015/05/11/best-practices-ews-authentication-and-access-issues/ return {'X-AnchorMailbox': account.primary_smtp_address} return None