Amazon Lex: can't make mobile app work - amazon-web-services

I have a bot that works perfectly in the AWS console.
I've tried to make it work in a mobile app using AWS MobileHub but it doesn't work well and I don't know why I'm totally stuck.
Description: I make a request with a project name to get the list of tasks on this project. But first I have to connect. The "connection" request gets a token from my backend and put it in sessionAttributes. The other requests must have this token in sessionAttributes or the bot will ask to authenticate.
The workflow works with the AWS console bot:
Request "tasks for project 123" -> Answer "you must authenticate"
Request "connection" -> Answer "you are now connected"
Request "tasks for project 123" -> Answer "tasks for project 123
are 4, 8, 11. Choose a task to get details."
Now what happens with the app, in text mode:
Request "tasks for project 123" -> Answer "you must authenticate"
Request "connection" -> No answer
Request "tasks for project 123" -> The app crashes
Logs in Android Studio at step 3 (crash):
06-28 11:05:58.942 1719-1719/com.amazon.mysampleapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.amazon.mysampleapp, PID: 1719
Theme: themes:{default=overlay:com.cyngn.hexo, iconPack:com.cyngn.hexo, fontPkg:com.cyngn.hexo, com.android.systemui=overlay:com.cyngn.hexo, com.android.systemui.navbar=overlay:com.cyngn.hexo}
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.amazonaws.mobileconnectors.lex.interactionkit.continuations.LexServiceContinuation.continueWithTextInForTextOut(java.lang.String)' on a null object reference
at com.mysampleapp.demo.bots.ConversationalBotTextFragment.textEntered(ConversationalBotTextFragment.java:135)
at com.mysampleapp.demo.bots.ConversationalBotTextFragment.access$000(ConversationalBotTextFragment.java:42)
at com.mysampleapp.demo.bots.ConversationalBotTextFragment$1.onKey(ConversationalBotTextFragment.java:86)
at android.view.View.dispatchKeyEvent(View.java:9236)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2651)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1777)
at android.app.Activity.dispatchKeyEvent(Activity.java:2731)
at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:543)
at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:53)
at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:312)
at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:53)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2363)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4135)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4097)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3650)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3703)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3669)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3795)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3677)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3852)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3650)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3703)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3669)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3677)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3650)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5932)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5906)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5867)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3442)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5461)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-28 11:05:58.944 789-3750/? W/ActivityManager: Force finishing activity com.amazon.mysampleapp/com.mysampleapp.MainActivity
And here with the voice on mobile app:
Request "tasks for project 123" -> Answer "you must authenticate"
Request "connection" -> Answer "you are now connected"
Request "tasks for project 123" -> Answer "you must authenticate"
Logs in Android Studio at steps 1 and 3:
06-28 11:24:15.227 4265-4265/com.amazon.mysampleapp E/Lex: InteractiveVoiceViewAdapter: Interaction error
com.amazonaws.mobileconnectors.lex.interactionkit.exceptions.DialogFailedException: Failed to fulfill current request.
at com.amazonaws.mobileconnectors.lex.interactionkit.InteractionClient$8.run(InteractionClient.java:593)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5461)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-28 11:24:15.227 4265-4265/com.amazon.mysampleapp E/ConversationalBotVoice: Error: You must authenticate.
com.amazonaws.mobileconnectors.lex.interactionkit.exceptions.DialogFailedException: Failed to fulfill current request.
at com.amazonaws.mobileconnectors.lex.interactionkit.InteractionClient$8.run(InteractionClient.java:593)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5461)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
So I tried to change the lambda so I don't need the connection part (but still it uses the token for the requests, I've just written the token in the lambda instead of getting it from the backend).
In AWS console, I get the tasks list
On mobile with text, I get the tasks list
On mobile with voice, it doesn't work
And the logs for that last case:
06-28 11:38:40.619 7655-7655/com.amazon.mysampleapp E/Lex: InteractiveVoiceViewAdapter: Interaction error
com.amazonaws.services.lexrts.model.DependencyFailedException: Received error response from Lambda: Handled (Service: AmazonLexRuntime; Status Code: 424; Error Code: DependencyFailedException; Request ID: 8f30ae21-5be5-11e7-bc7b-8d61d03f20da)
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:729)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:405)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:212)
at com.amazonaws.services.lexrts.AmazonLexRuntimeClient.invoke(AmazonLexRuntimeClient.java:651)
at com.amazonaws.services.lexrts.AmazonLexRuntimeClient.postContent(AmazonLexRuntimeClient.java:450)
at com.amazonaws.mobileconnectors.lex.interactionkit.InteractionClient$2.run(InteractionClient.java:375)
at java.lang.Thread.run(Thread.java:818)
06-28 11:38:40.620 7655-7655/com.amazon.mysampleapp E/ConversationalBotVoice: Error: Error from Bot
com.amazonaws.services.lexrts.model.DependencyFailedException: Received error response from Lambda: Handled (Service: AmazonLexRuntime; Status Code: 424; Error Code: DependencyFailedException; Request ID: 8f30ae21-5be5-11e7-bc7b-8d61d03f20da)
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:729)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:405)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:212)
at com.amazonaws.services.lexrts.AmazonLexRuntimeClient.invoke(AmazonLexRuntimeClient.java:651)
at com.amazonaws.services.lexrts.AmazonLexRuntimeClient.postContent(AmazonLexRuntimeClient.java:450)
at com.amazonaws.mobileconnectors.lex.interactionkit.InteractionClient$2.run(InteractionClient.java:375)
at java.lang.Thread.run(Thread.java:818)
I don't know what to do, I don't even know how to log things, how to check what is sent to Lex from the app and what Lex sends back. Thanks for your help.

Related

Kestrel gives bad request after FIN and end of request

I have a API made in Dotnet 6, running in a docker container and hosted on AWS.
The client is built in Wordpress and uses php curl to make requests to the api.
The Api is built with using minimal APIs and as much as I can see it doesn't do anything too fancy.
After going live with the API I did start notice strange logs where requests end with a BadHttpRequestException.
I have not been able to trace what is causing it but if we look at the server logs that traces the entire request we can see that the request is fulfilled and it sends back the response with a status of 200.
After that at row 18 it starts to close the connection, but at row 19 it starts to read the body again which after a while ends with a Bad request error at row 22 before the connection is stopped.
This error is not caught in my exception middleware so I'm lost to what to do or how to fix in.
Any suggestions would be highly appreciated.
Both Logs below are for the same endpoint on the api
Log with error in it
1 "Connection id \"{ConnectionId}\" accepted.",
2 "Connection id \"{ConnectionId}\" started.",
3 "{HostingRequestStartingLog:l}",
4 "{CandidateCount} candidate(s) found for the request path '{Path}'",
5 "Request matched endpoint '{EndpointName}'",
6 "The request has an origin header: '{origin}'.",
7 "CORS policy execution successful.",
8 "Successfully validated the token.",
9 "AuthenticationScheme: {AuthenticationScheme} was successfully authenticated.",
10"AuthenticationScheme: {AuthenticationScheme} was successfully authenticated.",
11"Authorization was successful.",
12"Executing endpoint '{EndpointName}'",
13"Writing value of type '{Type}' with status code '200'.",
14"Executed endpoint '{EndpointName}'",
15"HTTP {RequestMethod} {RequestPath} responded 200 in {Elapsed:0.0000} ms",
16"Connection id \"{ConnectionId}\" completed keep alive response.",
17"{HostingRequestFinishedLog:l}",
18"Connection id \"{ConnectionId}\" received FIN.",
19"Connection id \"{ConnectionId}\", Request id \"{TraceIdentifier}\": started reading request body.",
20"Connection id \"{ConnectionId}\" sending FIN because: \"{Reason}\"",
21"Connection id \"{ConnectionId}\" disconnecting.",
22"Connection id \"{ConnectionId}\" bad request data: \"{message}\"",
23"Exception": "Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Unexpected end of request content.\n at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1ContentLengthMessageBody.TryReadInternal(ReadResult& readResult)\n at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1MessageBody.OnConsumeAsync()"
24"Connection id \"{ConnectionId}\", Request id \"{TraceIdentifier}\": done reading request body.",
25"Connection id \"{ConnectionId}\" stopped.",
Log that is fine
1 "Connection id \"{ConnectionId}\" accepted.",
2 "Connection id \"{ConnectionId}\" started.",
3 "{HostingRequestStartingLog:l}",
4 "{CandidateCount} candidate(s) found for the request path '{Path}'",
5 "Request matched endpoint '{EndpointName}'",
6 "The request has an origin header: '{origin}'.",
7 "CORS policy execution successful.",
8 "Successfully validated the token.",
9 "AuthenticationScheme: {AuthenticationScheme} was successfully authenticated.",
10"AuthenticationScheme: {AuthenticationScheme} was successfully authenticated.",
11"Authorization was successful.",
12"Executing endpoint '{EndpointName}'",
13"Writing value of type '{Type}' with status code '200'.",
14"Executed endpoint '{EndpointName}'",
15"HTTP {RequestMethod} {RequestPath} responded 200 in {Elapsed:0.0000} ms",
16"Connection id \"{ConnectionId}\" completed keep alive response.",
17"{HostingRequestFinishedLog:l}",
18"Connection id \"{ConnectionId}\", Request id \"{TraceIdentifier}\": started reading request body.",
19"Connection id \"{ConnectionId}\", Request id \"{TraceIdentifier}\": done reading request body.",
20"Connection id \"{ConnectionId}\" received FIN.",
21"Connection id \"{ConnectionId}\" disconnecting.",
22"Connection id \"{ConnectionId}\" sending FIN because: \"{Reason}\"",
23"Connection id \"{ConnectionId}\" stopped.",

Custom "statusMsg" not working as expected

After adding the following adaptive authentication script, if the username is not according to the format I should be getting the custom status message saying, Access Denied, invalid username format. But instead I get the default status message, Something went wrong during the authentication process. Please try signing in again.
function onLoginRequest(context) {
executeStep(1, {
onSuccess: function(context) {
var user = context.currentKnownSubject;
if(user!= null && user.username != null && !user.username.equals('')) {
Log.info("username: " + user.username);
} else {
sendError('',{'status':'AUTHENTICATION USERNAME ERROR', 'statusMsg': 'Access denied, invalid username format.'});
}
}
});
}
In addition, I get the following error in the wso2carbon.log file as well.
TID: [-1234] [authenticationendpoint] [2022-10-05 15:44:12,715] [37951f7d-8240-48d4-ad4f-1d4c8a6a3ec4] ERROR {org.wso2.carbon.identity.application.authentication.endpoint.util.AuthContextAPIClient} - Sending GET request to URL : https://dev.wso2istemp.com/api/identity/auth/v1.1/data/AuthenticationError/0b0efc37-819d-4b39-85b2-517126c3c9cb, failed. java.io.IOException: Server returned HTTP response code: 401 for URL: https://dev.wso2istemp.com/api/identity/auth/v1.1/data/AuthenticationError/0b0efc37-819d-4b39-85b2-517126c3c9cb
...
org.wso2.carbon.identity.application.authentication.endpoint.util.AuthContextAPIClient.getContextProperties(AuthContextAPIClient.java:70)
at org.apache.jsp.retry_jsp._jspService(retry_jsp.java:194)
...
org.wso2.carbon.ui.filters.cache.ContentTypeBasedCachePreventionFilter.doFilter(ContentTypeBasedCachePreventionFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
...
org.wso2.carbon.identity.application.authentication.endpoint.util.filter.AuthenticationEndpointFilter.doFilter(AuthenticationEndpointFilter.java:190)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
...
The <IS_HOME>/repository/conf/deployment.toml configurations for [server] are as follows.
[server]
hostname = "dev.wso2istemp.com"
node_ip = "127.0.0.1"
base_path = "https://$ref{server.hostname}:${carbon.management.port}"
What is the reason for the following issue in the wso2carbon.log and why the custom status message is not shown properly?
When the adaptive authentication script is running, the values are passed to the Identity Server(IS) encrypted. In above case, the encrypted data chunk is passed to the IS,
https://dev.wso2istemp.com/api/identity/auth/v1.1/data/AuthenticationError/24e56d99-9494-4989-a3e2-4008b73ebd9b
with the last segment of the URL is being the data chunk. When the server tries to get that data chunk with a GET request, java.io.IOException: Server returned HTTP response code: 401 for URL which is the code for unauthorized is thrown. Since that data chunk is not properly received, the default status message is shown instead of the custom status message. The steps to resolve this are given below.
First clarify whether the dev.wso2istemp.com which you were using is not mapped with the localhost in /etc/hosts file.
Go to <IS_HOME>/repository/conf/deployment.toml file and check for the following configuration [identity.auth_framework.endpoint] and check whether the mutual SSL is set to false via mutual_ssl_manager_enabled=false
If so, enable that by commenting the mutual_ssl_manager_enabled=false, since using mutual SSL is recommended for IS. If you go to the <IS_HOME>/repository/resources/conf/default.json file, you can notice that the default value for mutual_ssl_manager_enabled is true
In a multi-node situation, the above error can occur if the mutual SSL is not enabled, If that does not resolves the issue, then you have to check whether the internal_hostname has been set properly so that the internal API calls are being sent properly.
To do that, if you have not added the following configuration to <IS_HOME>/repository/conf/deployment.toml file, you can check whether it has been properly applied to the <IS_HOME>/repository/conf/identity/identity.xml by checking for <ServerHostName>localhost</ServerHostName>
[server]
internal_hostname="localhost"
If you are using a multi-node deployment, this localhost value should be added to the SAN for the certificate when the certificate is generated (-ext SAN=dns:localhost)
keytool -genkey -alias newcert -keyalg RSA -keysize 2048 -keystore newkeystore.jks -dname "CN=dev.wso2istemp.com, OU=Is,O=Wso2,L=SL,S=WS,C=LK" -storepass mypassword -keypass mypassword -ext SAN=dns:localhost
But if you are using a single node you can add the following configuration to the deployment.toml and check whether it resolves things. (In single node case the internal_hostname should be similar to hostname)
[server]
hostname = "dev.wso2istemp.com"
internal_hostname = "dev.wso2istemp.com"
If that is not working[https://github.com/wso2/product-is/issues/11878] then go to <IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/web.xml and uncomment the following commented snippet.
<!--context-param>
<param-name>AuthenticationRESTEndpointURL</param-name>
<param-value>https://localhost:9443/api/identity/auth/v1.1/</param-value>
</context-param-->
This might route the internal_hostname being reflected on the request since the internal API calls are blocked when hostname of the server being replaced instead of the internal_hostname for the internal API calls(https://dev.wso2istemp.com/api/identity/auth/v1.1/data/AuthenticationError/24e56d99-9494-4989-a3e2-4008b73ebd9b).

WSO2 API-M v4.1.0: 404 with log message STATUS = Message dispatched to the main sequence. Invalid URL., RESOURCE = , HEALTH CHECK URL

I was able to create and publish APIs on my dev WSO2 installation based on H2 DB. Unfortunately started from the fifth APIs (the first four still working very well) I have this error.
If I'm calling the API from Postman I receive
{
"code": 404,
"type": "Status report",
"message": "Not Found",
"description": "The requested resource is not available."
}
Into the logs I see
INFO {org.apache.synapse.mediators.builtin.LogMediator} - STATUS = Message dispatched to the main sequence. Invalid URL., RESOURCE = XXXXXXXXXXXXXXX, HEALTH CHECK URL = XXXXXXXXXXXXXXX
Any help will appriciate.
API-M version 4.1.0
Regards,

Jenkins send email with part of log line

I have SOAPUI project with 10 test cases in Jenkins. I set up Jenkins to send me email with information from console output (log). I have set up email notification content as HTML (text/html).
I have this log in console output in Jenkins:
07:25:05,957 INFO [SoapUITestCaseRunner] Running SoapUI testcase [Login with username and password]
07:25:05,957 INFO [SoapUITestCaseRunner] running step [Clear access token]
07:25:05,957 INFO [log] Environment URL: url.test.environment
07:25:05,958 INFO [SoapUITestCaseRunner] running step [Retrieve accessToken]
07:25:05,959 DEBUG [HttpClientSupport$SoapUIHttpClient] Stale connection check
07:25:05,960 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
07:25:05,960 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /api/v2/path HTTP/1.1
07:25:06,010 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200
07:25:06,011 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive indefinitely
07:25:06,017 INFO [SoapUITestCaseRunner] Assertion [JsonPath Existence Match] has status VALID
07:25:06,017 INFO [SoapUITestCaseRunner] Assertion [Valid HTTP Status Codes] has status VALID
07:25:06,017 INFO [SoapUITestCaseRunner] Assertion [JsonPath Existence Match 1] has status VALID
07:25:06,017 INFO [SoapUITestCaseRunner] Assertion [JsonPath Existence Match 2] has status VALID
07:25:06,017 INFO [SoapUITestCaseRunner] running step [Pass accessToken]
07:25:06,019 INFO [SoapUITestCaseRunner] Finished running SoapUI testcase [Login with username and password], time taken: 51ms, status: FINISHED
I have set up Jenkins to send email just with this line from log:
07:25:06,019 INFO [SoapUITestCaseRunner] Finished running SoapUI testcase [Login with username and password], time taken: 51ms, status: FINISHED
To that I use this regex to find just that line:
<pre>${BUILD_LOG_REGEX, regex="Finished running SoapUI testcase \\[Login with username and password\\]", showTruncatedLines=false}</pre>
But I want to have in email notification just parts of that line, something like this:
"Login with username and password: FINISHED"
or
"Login with username and password: FAILED"
Is there any way to send email with just part of that line?
Thanks to Aaron I found a solution.
Now I use this regex:
<b>Login with username and password: </b> <font color="green">${BUILD_LOG_REGEX, regex=".*Finished running SoapUI testcase \\[Login with username and password\\].*status: FINISHED", showTruncatedLines=false, substText="SUCCESS"}</font>
<font color="red">${BUILD_LOG_REGEX, regex=".*Finished running SoapUI testcase \\[Login with username and password\\].*status: FAILED", showTruncatedLines=false, substText="FAILED"}</font>
E-mail notification now looks like this:
Login with username and password: SUCCESS
or this:
Login with username and password: FAILED
"SUCCESS" text has green color and "FAILED" text has red color
It seems like you can use a substText argument to define a replacement pattern :
<pre>${BUILD_LOG_REGEX, regex="Finished running SoapUI testcase \\[Login with username and password\\].*status: ([A-Z]+)", showTruncatedLines=false, substText="Login with username and password : \\1"}</pre>
This will match only the lines such as the last one from your sample, select the success/failure status in the first capturing group which will be referred in the replacement pattern.

How to setup outgoing mail server through outlook office365 in odoo 9

I will try to setup outgoing mail server in odoo 9 .so i fill all the field and test connection and the connection also success , but at the time of send mail it will generate an error .
Field fill like that:-
Name : sendmail
Priority: 10
SMTP Server : smtp.office365.com
SMTP Port:25
Debugging: enable
Connection Security:TLS (STARTTLS)
Username:my yser name
Password:password
But, when we send any mail then it will generate the below error
16-12-06 10:04:28,440 426 INFO test openerp.addons.base.ir.ir_mail_server: Mail delivery failed via SMTP server 'smtp.office365.com'.
SMTPDataError: 550
5.7.60 SMTP; Client does not have permissions to send as this sender
2016-12-06 10:04:28,443 426 ERROR test openerp.addons.mail.models.mail_mail: failed sending mail (id: 136) due to Mail Delivery Failed
Mail delivery failed via SMTP server 'smtp.office365.com'.
SMTPDataError: 550
5.7.60 SMTP; Client does not have permissions to send as this sender
Traceback (most recent call last):
File "/usr/lib/python2.7/dist- packages/openerp/addons/mail/models/mail_mail.py", line 262, in send
res = IrMailServer.send_email(msg, mail_server_id=mail.mail_server_id.id)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
return new_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 490, in new_api
result = method(self._model, cr, uid, *args, **old_kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_mail_server.py", line 483, in send_email
raise MailDeliveryException(_("Mail Delivery Failed"), msg)
MailDeliveryException: (u'Mail Delivery Failed', u"Mail delivery failed via SMTP server 'smtp.office365.com'.\nSMTPDataError: 550\n5.7.60 SMTP; Client does not have permissions to send as this sender")
So i tried too much for this , but i am not getting any solution , if you have any solutin , please share with me .
Use port 587.
The error message tells you that the sender is invalid - you can only send as the mailbox owner (primary SMTP address) or as one of the proxy addresses associated with the mailbox.
Removing all catchall parameters (mail.catchall.domain and mail.catchall.alias) under "Settings" -> "Technical" -> "Parameters" -> "System Parameters" and it work like charm .
WORKS LIKE CHARM :
Removing all catchall parameters (mail.catchall.domain and mail.catchall.alias) under "Settings" -> "Technical" -> "Parameters" -> "System Parameters" and it work like charm . TY Debasish
I'm on Odoo V12
It was not suffisient for my problem, I had to delete the alias domain but there another thing to check :
I initialy created my odoo installation with a GMAIL address, worked a bit but had to switch for a pro e-mail because all my invitations e-mail was blocked by Google Bot beacause it look liked suspicious. It did this only in Odoo v12 because there is more links in the mail.
So I configured my real smtp server in Odoo but get the error 550. Odoo kept in the COMPANY settings the primary gmail address and tried to send on my other smtp server with the gmail name. The other server didn't accepted it so sent me back error 550.
Once i putted my new e-mail address in the company description, and deleted alias domain it worked !!
PS : Don't try to edit ir_mail_server.py to put in bruteforce your e-mail ... Doesn't work ..