microsoft / BotFramework-Services

Microsoft Bot Framework Services
Creative Commons Attribution 4.0 International
38 stars 11 forks source link

Configure Bot Email Channel Error #303

Closed sedashgh closed 3 years ago

sedashgh commented 3 years ago

When I try to add an email channel to a Bot which already works with Teams I am unable to save the email credentials even though the email credentials are valid office 365 users who can sign in to Outlook 365.

From a Bot Channels Registration - > Channels - >Email dialog -> Enter credentials -> Save I can see the following output in Developer Tools in Chrome. https://dev.botframework.com/api/bots/SampleAll/channels/email Post json data (omitted account name and password)

{
  "isValidated": false,
  "channelId": "email",
  "channelDisplayName": "Email",
  "botId": "SampleAll",
  "botIconUrl": "//bot-framework.azureedge.net/bot-icons-v1/SampleAll_4z58JlBqy2NL9OrEpFByC81q7SY9jrEJjP65BvCFAF7p1iz.png",
  "isEnabled": false,
  "hasConfiguration": false,
  "isIsolated": false,
  "emailAddress": "[any office 365 email address in tenant]",
  "password": "[password to above email address]"
}
results in
{
  "error": {
    "code": "ServiceError",
    "message": "Unable to validate the given credentials. ID: 1e53b10e07328c4aa3cb58fa1b0c47b1"
  }
}
craigjensen commented 3 years ago

Please try running the Ews test tool referenced near the bottom of this issue and see if it helps isolate the problem.

sedashgh commented 3 years ago

Yes. It revealed an AutoDiscover problem. I am trying to find out how to fix that with Office 365. Under Manage Email apps all apps are enabled. I have a primary domain so that when I tried EWSTest on the original domain somedomain.onmicrosoft.com it got farther. I now see that sending mail to the primary domain fails whereas I can send mail to the original domain however channel registration fails on the original domain. EWSTest on the original domain gets 401. Basic Authorization is blocked.

xieofxie commented 3 years ago
Hello @sedashgh, if I understand it correctly, you added a primary domain(someprimarydomain.com) for the original domain(somedomain.onmicrosoft.com), so you could add xx@someprimarydomain.com in the somedomain.onmicrosoft.com tenant. And your status is as below: Domain\Action Send email to EWSTest channel registration
A@someprimarydomain.com Fail ? Fail
B@somedomain.onmicrosoft.com Succeed Fail Fail

I just tried adding another domain to a tenant and it worked for all the three actions. I think you should pay attention to the following:

Thanks~

sedashgh commented 3 years ago

Thanks very much. I will add the necessary records in the domain provider.