Comments (6)
Which auth type are you using to access the Exchange server? If your username an password is correct, then it's likely that you are connecting with an auth type that the EWS service does not support.
from exchangelib.
Thank you very much for your support. Right, I had the wrong Auth type here.
Here you can see the settings for authentication in the ECP. So I need NTLM.
Unfortunately, I get the following error message:
exchangelib.errors.TransportError: No valid version headers found in response (ErrorServerBusy("Reraised from ErrorInternalServerTransientError(Reraised from KeyError('www-authenticate'))"))
Can you please help me again here?
Many thanks in advance.
from exchangelib.
Please post the full stack trace, and the code you use to connect to the server.
from exchangelib.
Traceback
Traceback (most recent call last):
File "/home/lkleemann/.local/lib/python3.12/site-packages/exchangelib/util.py", line 833, in post_ratelimited
r = session.post(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/lkleemann/.local/lib/python3.12/site-packages/requests/sessions.py", line 637, in post
return self.request("POST", url, data=data, json=json, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lkleemann/.local/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lkleemann/.local/lib/python3.12/site-packages/requests/sessions.py", line 710, in send
r = dispatch_hook("response", hooks, r, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lkleemann/.local/lib/python3.12/site-packages/requests/hooks.py", line 30, in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lkleemann/.local/lib/python3.12/site-packages/requests_ntlm/requests_ntlm.py", line 168, in response_hook
return self.retry_using_http_NTLM_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lkleemann/.local/lib/python3.12/site-packages/requests_ntlm/requests_ntlm.py", line 133, in retry_using_http_NTLM_auth
auth_header_value = response2.headers[auth_header_field]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/home/lkleemann/.local/lib/python3.12/site-packages/requests/structures.py", line 52, in __getitem__
return self._store[key.lower()][1]
~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'www-authenticate'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/lkleemann/.local/lib/python3.12/site-packages/exchangelib/services/common.py", line 308, in _get_elements
yield from self._response_generator(payload=payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lkleemann/.local/lib/python3.12/site-packages/exchangelib/services/common.py", line 271, in _response_generator
response = self._get_response_xml(payload=payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lkleemann/.local/lib/python3.12/site-packages/exchangelib/services/common.py", line 404, in _get_response_xml
r = self._get_response(payload=payload, api_version=api_version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lkleemann/.local/lib/python3.12/site-packages/exchangelib/services/common.py", line 355, in _get_response
r, session = post_ratelimited(
^^^^^^^^^^^^^^^^^
File "/home/lkleemann/.local/lib/python3.12/site-packages/exchangelib/util.py", line 852, in post_ratelimited
raise ErrorInternalServerTransientError(f"Reraised from {e.__class__.__name__}({e})")
exchangelib.errors.ErrorInternalServerTransientError: Reraised from KeyError('www-authenticate')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/lkleemann/.local/lib/python3.12/site-packages/exchangelib/version.py", line 202, in guess
list(ConvertId(protocol=protocol).call([AlternateId(id="DUMMY", format=EWS_ID, mailbox="DUMMY")], ENTRY_ID))
File "/home/lkleemann/.local/lib/python3.12/site-packages/exchangelib/services/common.py", line 225, in _elems_to_objs
for elem in elems:
File "/home/lkleemann/.local/lib/python3.12/site-packages/exchangelib/services/common.py", line 287, in _chunked_get_elements
yield from self._get_elements(payload=payload_func(chunk, **kwargs))
File "/home/lkleemann/.local/lib/python3.12/site-packages/exchangelib/services/common.py", line 340, in _get_elements
self._handle_backoff(ErrorServerBusy(f"Reraised from {e.__class__.__name__}({e})", back_off=wait))
File "/home/lkleemann/.local/lib/python3.12/site-packages/exchangelib/services/common.py", line 446, in _handle_backoff
raise e
exchangelib.errors.ErrorServerBusy: Reraised from ErrorInternalServerTransientError(Reraised from KeyError('www-authenticate'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/lkleemann/development/IntranetSystem/server/src/python/exchange/exchangeService.py", line 44, in <module>
IntranetExchangeConnection = IntranetExchangeConnectionFile.IntranetExchangeConnection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lkleemann/development/IntranetSystem/server/src/python/exchange/functions/exchangeConnection.py", line 19, in __init__
self.mailAccount_Intranet = Account(
^^^^^^^^
File "/home/lkleemann/.local/lib/python3.12/site-packages/exchangelib/account.py", line 205, in __init__
self.version = self.protocol.version.copy()
^^^^^^^^^^^^^^^^^^^^^
File "/home/lkleemann/.local/lib/python3.12/site-packages/exchangelib/protocol.py", line 480, in version
self.config.version = Version.guess(self, api_version_hint=self.api_version_hint)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lkleemann/.local/lib/python3.12/site-packages/exchangelib/version.py", line 206, in guess
raise TransportError(f"No valid version headers found in response ({e!r})")
exchangelib.errors.TransportError: No valid version headers found in response (ErrorServerBusy("Reraised from ErrorInternalServerTransientError(Reraised from KeyError('www-authenticate'))"))
Connection to Server
self.credentials = Credentials(
username='Test.User@[domain].de', password='[password]')
self.config = Configuration(server="[server]",
credentials=self.credentials, auth_type="NTLM"
)
# retry_policy=FaultTolerance(max_wait=3600),
self.mailAccount= Account(
primary_smtp_address='Test.User@[domain].de', config=self.config,
autodiscover=False, access_type=DELEGATE
)
from exchangelib.
This means that the server you are connecting to does not announce NTLM auth in its HTTP response headers. Either you are not connecting to the right server, or your server does not support NTLM auth after all.
from exchangelib.
Perfect, thank you very much for your support.
from exchangelib.
Related Issues (20)
- Error creating inbox rules HOT 4
- Multiple Email address inbox Stream subscription HOT 1
- Unnable to access shared calendar without permission on the mailbox root folder HOT 6
- Error in conver rule from xml
- Typo in Exchange 2019 version HOT 1
- Can't browse public_folders_root anymore HOT 32
- exchangelib.errors.ErrorAccessDenied: Not allowed to access Non IPM folder. HOT 23
- Can junk mail rules be created by exchangelib? HOT 1
- Validation rule error when manage inbox rules HOT 3
- `folder.parts` no longer returns root of hierarchy in list of parts (5.2.1) HOT 9
- `ErrorNonExistentMailbox` in version 5.2.1 but not in 5.2.0 HOT 6
- Create calendar appointment in another account as access data, the appointment is created in the access account. HOT 3
- Get all Public Folders HOT 23
- ErrorInvalidSchemaVersionForMailboxVersion with exchangelib v5.2.1 and Exchange server version 15.2.1544.4 HOT 45
- EOF occurred in violation of protocol HOT 4
- ValueError trying to delete a rule HOT 2
- Error getting folders for v5.2.1+ (server 2010sp3 upd.29) HOT 3
- Cannot fetch calendar folder HOT 4
- Problem getting auth type from Exchange server HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exchangelib.