You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: support/power-platform/dataverse/email-exchange-synchronization/http-server-returned-forbidden-exception.md
+27-27Lines changed: 27 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,72 +5,72 @@ ms.reviewer:
5
5
ms.date: 12/10/2024
6
6
ms.custom: sap:Email and Exchange Synchronization
7
7
---
8
-
# "Http server returned Forbidden exception" error appears in Microsoft Dynamics 365 mailbox
8
+
# "Http server returned Forbidden exception" error when testing a Dynamics 365 mailbox
9
9
10
-
This article provides a solution to an error that occurs when you select the **Test & Enable Mailbox** button on a mailbox record in Dynamics 365.
10
+
This article provides a solution to an error that occurs when you select the **Test & Enable Mailbox** button on a mailbox record in Microsoft Dynamics 365.
11
11
12
12
_Applies to:_ Microsoft Dynamics 365
13
13
_Original KB number:_ 4483440
14
14
15
15
## Symptoms
16
16
17
-
When you select the **Test & Enable Mailbox** button on a mailbox record in Dynamics 365, the test results section shows Failure and the following alert is logged:
17
+
When you select the **Test & Enable Mailbox** button on a mailbox record in Dynamics 365, the test results section shows **Failure** and the following alert is logged:
18
18
19
-
> "The email message "Your mailbox is now connected to Dynamics 365" cannot be sent because an error occurred while establishing a secure connection to the email server. Mailbox [Mailbox Name] didn't synchronize. The owner of the email server profile Microsoft Exchange Online has been notified.
20
-
Email Server Error Code: Http server returned Forbidden exception."
19
+
> The email message "Your mailbox is now connected to Dynamics 365" cannot be sent because an error occurred while establishing a secure connection to the email server. Mailbox [Mailbox Name] didn't synchronize. The owner of the email server profile Microsoft Exchange Online has been notified.
20
+
> **Email Server Error Code**: Http server returned Forbidden exception.
21
21
22
-
If you select **Details**, the following other details are shown:
22
+
If you select **Details**, the following details are shown:
23
23
24
-
> "Error : System.Net.WebException: The request failed with HTTP status 403: Forbidden.
25
-
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
26
-
at System.Web.Services.Protocols.SoapHttpClientProtocol.EndInvoke(IAsyncResult asyncResult)
27
-
at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeServiceBinding.EndCreateItem(IAsyncResult asyncResult)
28
-
at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeOutgoingEmailProvider.EndCreateItem()"
24
+
> Error : System.Net.WebException: The request failed with HTTP status 403: Forbidden.
> at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeOutgoingEmailProvider.EndCreateItem()
29
29
30
30
## Cause
31
31
32
-
Dynamics 365 communicates with Microsoft Exchange using Exchange Web Services (EWS) requests. If EWS is disabled, this error will occur. The following contents are some potential ways that EWS may be disabled or restricted in Exchange:
32
+
Dynamics 365 communicates with Microsoft Exchange using Exchange Web Services (EWS) requests. If EWS is disabled, this error will occur. Here are some potential ways that EWS might be disabled or restricted in Exchange:
33
33
34
-
1. EWS is disabled for the mailbox
35
-
2. EWS is disabled for the entire organization
36
-
3. The `EwsApplicationAccessPolicy` is set to **EnforceAllowList** and `the EwsAllowList` doesn't allow access from Dynamics 365 (CRM).
37
-
4. The `EwsApplicationAccessPolicy` is set to **EnforceBlockList** and `the EwsBlockList` includes Dynamics 365 (CRM).
34
+
1. EWS is disabled for the mailbox.
35
+
2. EWS is disabled for the entire organization.
36
+
3. The `EwsApplicationAccessPolicy` is set to **EnforceAllowList** and the `EwsAllowList` doesn't allow access from Dynamics 365.
37
+
4. The `EwsApplicationAccessPolicy` is set to **EnforceBlockList** and the `EwsBlockList` includes Dynamics 365.
38
38
39
39
## Resolution
40
40
41
-
**If the issue only occurs for some mailboxes, check if EWS is disabled for the mailbox:**
41
+
### Check if EWS is disabled for the mailbox if the issue only occurs for some mailboxes
42
42
43
-
1. First check to see if EWS has been disabled for the mailbox. Use the following PowerShell command:
43
+
1. First, check if EWS is disabled for a specific mailbox using this PowerShell command:
44
44
45
45
```powershell
46
46
Get-CASMailbox <mailbox-alias> | ft EwsEnabled
47
47
```
48
48
49
-
2. If **EwsEnabled** is set to **False**, use the following PowerShell command to enable Exchange Web Services (EWS) for the mailbox:
49
+
2. If **EwsEnabled** is set to **False**, enable it using this command:
50
50
51
51
```powershell
52
52
Set-CASMailbox <mailbox-alias> -EwsEnabled $True
53
53
```
54
54
55
55
> [!IMPORTANT]
56
-
> After running this command, it may take up to 120 minutes before the setting change takes effect.
56
+
> After running this command, it might take up to 120 minutes before the setting change takes effect.
57
57
58
-
**If the issue occurs for all mailboxes, check if EWS is disabled at the organization level, or if the EwsAllowList is being used to limit what EWS traffic is allowed.**
58
+
## Check if EWS is disabled at the organization level or if the EwsAllowList limits the EWS traffic if the issue occurs for all mailboxes
59
59
60
-
1. Use the following PowerShell command to see if any of the EWS settings are configured:
60
+
1. Use this PowerShell command to check organization-level settings:
2. Verify that **EwsEnabled** isn't set to **False**. The following command can be used to set **EwsEnabled** to **True** if it's currently set to **False**:
66
+
2. Ensure that `EwsEnabled` isn't set to **False**. If it is, enable it using:
67
67
68
68
```powershell
69
69
Set-OrganizationConfig -EwsEnabled $True
70
70
```
71
71
72
72
> [!IMPORTANT]
73
-
> After running this command, it may take up to 120 minutes before the setting change takes effect.
73
+
> After running this command, it might take up to 120 minutes before the setting change takes effect.
74
74
75
75
3. If `EwsApplicationAccessPolicy` is set to **EnforceAllowList** and the `EwsAllowList` doesn't contain a value for CRM (Example: CRM/\*), which would prevent Dynamics 365 (CRM) from being able to communicate with Exchange. Use the following command to update the list to include CRM/* and whatever other applications you want to allow (\<PreviousAllowList> in the following example):
76
76
@@ -79,16 +79,16 @@ Dynamics 365 communicates with Microsoft Exchange using Exchange Web Services (E
79
79
```
80
80
81
81
> [!IMPORTANT]
82
-
> After running this command, it may take up to 120 minutes before the setting change takes effect.
82
+
> After running this command, it might take up to 120 minutes before the setting change takes effect.
83
83
84
-
4. If `EwsApplicationAccessPolicy` is set to **EnforceBlockList** and the **EwsAllowList** contains a value for CRM (Example: CRM/*), which would prevent Dynamics 365 (CRM) from being able to communicate with Exchange. Use the following command to update the list to no longer include CRM:
84
+
4. If `EwsApplicationAccessPolicy` is set to **EnforceBlockList** and the `EwsAllowList` contains a value for CRM (Example: CRM/*), which would prevent Dynamics 365 (CRM) from being able to communicate with Exchange. Use the following command to update the list to no longer include CRM:
85
85
86
86
```powershell
87
87
Set-OrganizationConfig -EwsApplicationAccessPolicy:EnforceBlockList -EwsBlockList:<PreviousBlockList WITH CRM REMOVED>
88
88
```
89
89
90
90
> [!IMPORTANT]
91
-
> After running this command, it may take up to 120 minutes before the setting change takes effect.
91
+
> After running this command, it might take up to 120 minutes before the setting change takes effect.
0 commit comments