Ejabberd api set_vcard database_failure - ejabberd

When I use the following command for the ejabberd API I get the following response;
curl -ik -X POST -H 'Authorization: Bearer xxxxxxxxxxx' https://localhost:5280/api/set_vcard -d '{"user":"foo","host":"example.com","name":"FN","content":"foobar"}'
HTTP/1.1 400 Bad Request
Content-Length: 18
Content-Type: application/json
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type, Authorization, X-Admin
"database_failure"
On the ejabberd log (level 5) I see this;
[info] (<0.607.0>) Accepted connection ::ffff:172.18.0.1:46622 -> ::ffff:172.18.0.3:5280
[debug] S: [{[<<"ws">>],ejabberd_http_ws},{[<<"bosh">>],mod_bosh},{[<<"oauth">>],ejabberd_oauth},{[<<"api">>],mod_http_api},{[<<"admin">>],ejabberd_web_admin}]
[debug] ({tlssock,#Port<0.18819>,#Ref<0.650175335.3240493057.203147>}) http query: 'POST' <<"/api/set_vcard">>
[debug] client data: <<"{\"user\":\"foo\",\"host\":\"example.com\",\"contents\":[\"FN:foobar\"]}">>
[debug] [<<"api">>,<<"set_vcard">>] matches [<<"api">>]
[info] API call set_vcard [{<<"user">>,<<"foo">>},{<<"host">>,<<"example.com">>},{<<"contents">>,[<<"FN:foobar">>]}] from ::ffff:172.18.0.1:46622
[debug] Command 'set_vcard' execution allowed by rule 'api service' (CallerInfo=#{caller_module => mod_http_api,caller_server => <<"example.com">>,ip => {0,0,0,0,0,65535,44050,1},oauth_scope => [<<"ejabberd:api-service">>],usr => {<<"admin">>,<<"example.com">>,<<>>}})
[debug] Executing command mod_admin_extra:set_vcard with Args=[<<"foo">>,<<"example.com">>,<<>>,<<>>,[<<"FN:foobar">>]]
It is using MySQL as a database (working fine for everything else) however when I watch the database general query log I don't see my API request trigger any queries. I see all the other normal ejabberd queries so there isn't a problem with the db connection and as mentioned earlier everything else works.
$ ejabberdctl status
The node ejabberd#e87da11aa894 is started with status: started
ejabberd 18.4.0 is running in that node
Does anyone have any clues they can throw my way? I've ran out of leads on what could be the issue.
!!! EDIT !!!
Work around
As mentioned in https://github.com/processone/ejabberd/issues/2629 other people have experienced this issue. Changing config to disable the cache and clearing the vcard table in the database seems to be a work around;
SQL:
DELETE FROM vcard;
Config:
...
mod_vcard:
search: false
use_cache: false
...

The API is fairly permissive in what it allows, however once it's in the database the record will fail to load.
For 'set_vcard', the 'name 'is the field name you wish to alter and the content is the contents of that field.
{
"user": "catman",
"host": "the.host",
"name": "FN",
"content": "Cat Man"
}
ejabberd also caches queries, so once you have a barfed record it'll return 'database_failed' even if you've corrected your api call or fixed it in the database by hand. Caching can be disabled under the modules configuration.

Notice in your log that it says:
[debug] client data: <<"{\"user\":\"foo\",\"host\":\"example.com\",\"contents\":[\"FN:foobar\"]}">>
How can it be that contents is FN:foobar? I installed 18.04, setup mysql storage, and running this query:
$ curl -v -H "X-Admin: true" -H "Content-Type:application/json" http://localhost:5280/api/set_vcard -d '{"user":"user1","host":"localhost","name":"FN","content":"mi nombre curllll"}'
The log says:
21:42:29.638 [info] (<0.487.0>) Accepted connection 127.0.0.1:58412 -> 127.0.0.1:5280
21:42:29.638 [debug] S: [{[<<"api">>],mod_http_api},{[<<"bosh">>],mod_bosh},{[<<"oauth">>],ejabberd_oauth},{[<<"presence">>],mod_webpresence},{[<<"register">>],mod_register_web},{[<<"rest">>],mod_rest},{[<<"ws">>],ejabberd_http_ws},{[<<"admin">>],ejabberd_web_admin}]
21:42:29.639 [debug] (#Port<0.18079>) http query: 'POST' <<"/api/set_vcard">>
21:42:29.639 [debug] client data: <<"{\"user\":\"user1\",\"host\":\"localhost\",\"name\":\"FN\",\"content\":\"mi nombre curllll\"}">>
21:42:29.639 [debug] [<<"api">>,<<"set_vcard">>] matches [<<"api">>]
21:42:29.639 [info] API call set_vcard [{<<"user">>,<<"user1">>},{<<"host">>,<<"localhost">>},{<<"name">>,<<"FN">>},{<<"content">>,<<"mi nombre curllll">>}] from 127.0.0.1:58412
21:42:29.640 [debug] Command 'set_vcard' execution allowed by rule 'test commands' (CallerInfo=#{caller_module => mod_http_api,ip => {127,0,0,1}})
21:42:29.640 [debug] Executing command mod_admin_extra:set_vcard with Args=[<<"user1">>,<<"localhost">>,<<"FN">>,<<"mi nombre curllll">>]
21:42:29.640 [debug] SQL: "select vcard from vcard where username='user1' and 0=0"
21:42:29.642 [debug] SQL: "begin;"
21:42:29.642 [debug] SQL: "UPDATE vcard SET vcard='<vCard xmlns=''vcard-temp''><FN>mi nombre curllll</FN><N><FAMILY>mi familia11</FAMILY></N><NICKNAME>mi apodoooooooooooooooooooo11</NICKNAME><PHOTO><BINVAL>R0lGODlhDwAPAJECAP//AAAAAP///wAAACH5BAEAAAIALAAAAAAPAA8AAAIulB2Zx5IA4WIhWnnqvQFJDTyhE4khaG5Wqn4tp4ErFnMY+Sll9naUfGpkFL5DAQA7</BINVAL><TYPE>image/gif</TYPE></PHOTO></vCard>' WHERE username='user1'"
21:42:29.644 [debug] SQL: "UPDATE vcard_search SET username='user1', fn='mi nombre curllll', lfn='mi nombre curllll', family='mi familia11', lfamily='mi familia11', given='', lgiven='', middle='', lmiddle='', nickname='mi apodoooooooooooooooooooo11', lnickname='mi apodoooooooooooooooooooo11', bday='', lbday='', ctry='', lctry='', locality='', llocality='', email='', lemail='', orgname='', lorgname='', orgunit='', lorgunit='' WHERE lusername='user1'"
21:42:29.658 [debug] SQL: "commit;"

Related

ejabberd ACME unexpected content type when it receives certificate

I am running a processone/ejabberd container that i am trying to get to request a certificate via ACME to a smallstep ca container. The request fails with this error:
#{<<"kid">> =>
<<"https://ca.mydomain.local:8000/acme/acme/account/svUkT7QwXD4pBqyrVdys94VMeVCeeo0D">>,
<<"nonce">> =>
<<"..">>,
<<"url">> =>
<<"https://ca.mydomain.local:8000/acme/acme/certificate/Jks2zJjdJwqDzE7VSsLM0TOaAzzYUB2P">>}}
2022-11-07 08:30:28.355858+00:00 [debug] HTTP request: {post,{"https://ca.mydomain.local:8000/acme/acme/certificate/Jks2zJjdJwqDzE7VSsLM0TOaAzzYUB2P",
[],"application/jose+json",
<<"{\"signature\":\"....\",\"protected\":\"......\",\"payload\":\"\"}">>}}
2022-11-07 08:30:28.608072+00:00 [debug] HTTP response: {{"HTTP/1.1",200,"OK"},
[{"cache-control","no-store"},
{"date","Mon, 07 Nov 2022 08:30:28 GMT"},
{"content-length","2108"},
{"content-type",
"application/pem-certificate-chain; charset=utf-8"},
{"link",
"<https://ca.mydomain.local:8000/acme/acme/directory>;rel=\"index\""},
{"replay-nonce",
".."}],
<<"-----BEGIN CERTIFICATE-----........\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----........\n-----END CERTIFICATE-----\n">>}
2022-11-07 08:30:28.609162+00:00 [error] Failed to request certificate for jabber-gw.mydomain.me: HTTP error: unexpected content type: application/pem-certificate-chain; charset=utf-8
2022-11-07 08:30:28.609456+00:00 [debug] Unregistering ACME challenge #Ref<0.1802325958.1657798659.124306>
2022-11-07 08:35:26.914567+00:00 [debug] Error when retrieving http headers gen_tcp: timeout
Any ideas on why its not happy with the content type and how to resolve?
Prior to the error message, the logs show what looks like a successful ACME challenge:
[<<".well-known">>,<<"acme-challenge">>,
<<"3rNIelLxSuDU0tWZgb3yEw5sL6d6Z61J">>] matches [<<".well-known">>,
<<"acme-challenge">>]
2022-11-04 04:28:12.436337+00:00 [debug] Received ACME challenge request for token: blah
2022-11-04 04:28:12.546710+00:00 [debug] HTTP response: {{"HTTP/1.1",200,"OK"},
The smallstep container was built with this great blog.

Artifactory Create Repository Rest API does not work

I have Artifactory pro license, and as the following pages provide, I called rest api.
https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-CreateRepository
I have verified that all other APIs such as repository listing, account creation and listing works normally, but I have confirmed that the repository creation api does not work with 400 errors.
I wanted to see the error by changing the log level, but there was no information about why there was a 400 error at the trace log level.
Below are related logs:
2018-06-15 10:31:34,028 [http-nio-8081-exec-15] [TRACE] (o.a.a.d.r.DockerV2AuthenticationFilter:84) - DockerV2AuthenticationFilter path: /api/repositories/newrepo
2018-06-15 10:31:34,028 [http-nio-8081-exec-15] [DEBUG] (o.a.w.s.a.AuthenticationFilterUtils:105) - Entering ArtifactorySsoAuthenticationFilter.getRemoteUserName
2018-06-15 10:31:34,028 [http-nio-8081-exec-15] [DEBUG] (o.a.w.s.AccessFilter:299) - Cached key has been found for request: '/artifactory/api/repositories/newrepo' with method: 'PUT'
2018-06-15 10:31:34,028 [http-nio-8081-exec-15] [TRACE] (o.a.s.PasswordDecryptingManager:95) - Received authentication request for org.artifactory.security.props.auth.PropsAuthenticationToken#3dc5bccf: Principal: null; Credentials: [PROTECTED]; Authenticated: false; Details: org.springframework.security.web.authentication.WebAuthenticationDetails#b364: RemoteIpAddress: {IP}; SessionId: null; Not granted any authorities
2018-06-15 10:31:34,029 [http-nio-8081-exec-15] [DEBUG] (o.j.a.c.h.AccessHttpClient:109) - Executing : GET http://localhost:8040/access/api/v1/users/?cd=apiKey_shash%3DGprGDe&exactKeyMatch=false
2018-06-15 10:31:34,035 [http-nio-8081-exec-15] [DEBUG] (o.a.w.s.AccessFilter:305) - Header authentication org.artifactory.security.props.auth.PropsAuthenticationToken#c20ca8df: Principal: admin; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails#b364: RemoteIpAddress: {IP}; SessionId: null; Granted Authorities: admin, user found in cache.
2018-06-15 10:31:34,035 [http-nio-8081-exec-15] [DEBUG] (o.a.w.s.RepoFilter :100) - Entering request PUT (10.191.128.129) /api/repositories/newrepo.
2018-06-15 10:31:34,038 [http-nio-8081-exec-15] [DEBUG] (o.a.w.s.RepoFilter :188) - Exiting request PUT (10.191.128.129) /api/repositories/newrepo
Updated
My Artifactory Version: 6.0.2
Reponse Message from Artifactory:
{
"errors" : [ {
"status" : 400,
"message" : "No valid type of repository found.\n"
} ]
}
Repository Create JSON Message*:
{
"key": "newrepo",
"rclass: "local",
"packageType": "docker",
"dockerApiVersion": "V2",
"includesPattern": "**/*",
"excludesPattern": "",
"repoLayoutRef": "simple-default",
"description": "",
"checksumPolicyType": "client-checksums",
"blackedOut": false,
"propertySets": ["artifactory"]
}
The error in this block is on purpose, and the code highlighting finds it quite nicely, but when this post was originally made, highlighting was not available on SO.
In your JSON you are missing " after the rclass.
You wrote ' "rclass: ' and it should be ' "rclass": '
Once fixing this the command should work properly.
Good luck :)
curl -iuadmin:password -X PUT http://localhost:8081/artifactory/api/repositories/newrepo -H "Content-type:application/vnd.org.jfrog.artifactory.repositories.LocalRepositoryConfiguration+json" -T repo_temp.json
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Server: Artifactory/5.11.0
X-Artifactory-Id: bea9f3f68aa06e62:4db81752:1643a9cff9e:-8000
Content-Type: text/plain
Transfer-Encoding: chunked
Date: Tue, 26 Jun 2018 06:57:24 GMT
Successfully created repository 'newrepo'
repo_temp.json:
{
"key": "newrepo",
"rclass": "local",
"packageType": "docker",
"dockerApiVersion": "V2",
"includesPattern": "**/*",
"excludesPattern": "",
"repoLayoutRef": "simple-default",
"description": "",
"checksumPolicyType": "client-checksums",
"blackedOut": false,
"propertySets": ["artifactory"]
}
This error is (somehow) returned by Artifactory if the content-type header contains the charset, for example: Content-Type: application/json; charset=UTF-8
Try with simply Content-Type: application/json

Switching to webview context will got exception "chrome not reachable" after resetApp

Environment
Appium : 1.6.4
OS : Ubuntu 16.04 64bit
Node.js : 7.9.0
Android : 5.1
Device :1501-M02
API :java
Appium CLI
Details
I am using spock as test framework,with blow code:
class Test{
AndroidDriver<RemoteWebElement> driver;
DesiredCapabilities cap=DesiredCapabilities.android();
........
def setup(){
//setup driver
.....
cap.setCapability(NO_RESET, "true");
cap.setCapability(FULL_RESET, "false");
.....
cap.setCapability(RECREATE_CHROME_DRIVER_SESSIONS, "true");
.......
driver.context("WEBVIEW_com.domain.pkg");
}
def "test1"(){}
def "test2"(){}
def cleanup(){
driver.resetApp();
}
}
In eclipse,If right clicking test1 or test2->run as->junit test,both two run as expected,but if right clicking Test(class)->run as->junit test,the first test works,and the second test will throw exception:
org.openqa.selenium.WebDriverException: chrome not reachable
(Session info: webview=39.0.0.0)
(Driver info: chromedriver=2.28.455506
if replacing cleanup() with this:
def cleanup(){
driver.quit();
}
all works as expected,but each test will reinitialize a lot of staff which wastes huge time,
so
driver.resetApp()
not work as expected,is this a bug or do I do something wrong?
appium log like this:
[debug] [ADB] Running '/opt/android-sdk/platform-tools/adb' with args: ["-P",5037,"-s","MB8DW44999999999","shell","am","force-stop","com.vsi.pd.doctor"]
[debug] [MJSONWP] Responding to client with driver.closeApp() result: null
[HTTP] <-- POST /wd/hub/session/ebe4a8b1-844c-49f3-9997-9bc1bc0dd8a2/appium/app/close 200 1099 ms - 76
[HTTP] --> POST /wd/hub/session/ebe4a8b1-844c-49f3-9997-9bc1bc0dd8a2/appium/app/launch {}
[debug] [MJSONWP] Calling AppiumDriver.launchApp() with args: ["ebe4a8b1-844c-49f3-9997-9bc1bc0dd8a2"]
[AndroidDriver] No app sent in, not parsing package/activity
[debug] [AndroidDriver] No app capability. Assuming it is already on the device
[debug] [ADB] Device API level: 22
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk/platform-tools/adb' with args: ["-P",5037,"-s","MB8DW44999999999","shell","am","start","-W","-n","com.vsi.pd.doctor/.MainActivity","-S","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"]
[debug] [MJSONWP] Responding to client with driver.launchApp() result: null
[HTTP] <-- POST /wd/hub/session/ebe4a8b1-844c-49f3-9997-9bc1bc0dd8a2/appium/app/launch 200 1987 ms - 76
[HTTP] --> POST /wd/hub/session/ebe4a8b1-844c-49f3-9997-9bc1bc0dd8a2/context {"name":"WEBVIEW_com.vsi.pd.doctor"}
[debug] [MJSONWP] Calling AppiumDriver.setContext() with args: ["WEBVIEW_com.vsi.pd.doctor","ebe4a8b1-844c-49f3-9997-9bc1bc0dd8a2"]
[debug] [AndroidDriver] Getting a list of available webviews
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk/platform-tools/adb' with args: ["-P",5037,"-s","MB8DW44999999999","shell","cat","/proc/net/unix"]
[debug] [AndroidDriver] WEBVIEW_17929 mapped to pid 17929
[debug] [AndroidDriver] Getting process name for webview
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk/platform-tools/adb' with args: ["-P",5037,"-s","MB8DW44999999999","shell","ps"]
[debug] [AndroidDriver] Parsed pid: 17929 pkg: com.vsi.pd.doctor!
[debug] [AndroidDriver] from: u0_a181,17929,274,1666480,109536,ffffffff,00000000,S,com.vsi.pd.doctor
[debug] [AndroidDriver] returning process name: com.vsi.pd.doctor
[debug] [AndroidDriver] Found webviews: ["WEBVIEW_com.vsi.pd.doctor"]
[debug] [AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_com.vsi.pd.doctor"]
[debug] [MJSONWP] Responding to client with driver.setContext() result: null
[HTTP] <-- POST /wd/hub/session/ebe4a8b1-844c-49f3-9997-9bc1bc0dd8a2/context 200 117 ms - 76
[HTTP] --> POST /wd/hub/session/ebe4a8b1-844c-49f3-9997-9bc1bc0dd8a2/element {"using":"id","value":"login"}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/ebe4a8b1-844c-49f3-9997-9bc1bc0dd8a2/element] to [POST http://127.0.0.1:8000/wd/hub/session/eb87d1b86ef6331102013b50ee2c0ea4/element] with body: {"using":"id","value":"login"}
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"eb87d1b86ef6331102013b50ee2c0ea4","status":100,"value":{"message":**"chrome not reachable**\n (Session info: webview=39.0.0.0)\n (Driver info: chromedriver=2.28.455506 (18f6627e265f442aeec9b6661a49fe819aeeea1f),platform=Linux 4.4.0-75-generic x86_64)"}}
[JSONWP Proxy] Replacing sessionId eb87d1b86ef6331102013b50ee2c0ea4 with ebe4a8b1-844c-49f3-9997-9bc1bc0dd8a2
[HTTP] <-- POST /wd/hub/session/ebe4a8b1-844c-49f3-9997-9bc1bc0dd8a2/element 200 13 ms - 269
[HTTP] --> POST /wd/hub/session/ebe4a8b1-844c-49f3-9997-9bc1bc0dd8a2/appium/app/close {}
[debug] [MJSONWP] Calling AppiumDriver.closeApp() with args: ["ebe4a8b1-844c-49f3-9997-9bc1bc0dd8a2"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk/platform-tools/adb' with args: ["-P",5037,"-s","MB8DW44999999999","shell","am","force-stop","com.vsi.pd.doctor"]
[debug] [MJSONWP] Responding to client with driver.closeApp() result: null
With new UIautomator you don't need to switch your driver to webview. It has built in capabilities to identify the elements inside webView.
Please update your Android SDK once.
Elements inside WebView will be visible in UIAutomator for Android Version 6.0+ versions. However, once you automate the script for Android 6.0+ device, you can use the same script for Android version below 6.0.
And also you can see the elements inside webView on Android 6.0+ devices using UIAutomator.

ejabberd mod_http_api rest request

I am trying to make some rest requests (without OAuth) but ejabberd response is always "HTTP/1.1 400 Bad Request"
Here is the detail:
ejabberd version:
16.02
ejabberd configuration
port: 5280
ip: "::"
module: ejabberd_http
request_handlers:
##"/websocket": ejabberd_http_ws
##"/oauth": ejabberd_oauth
"/api": mod_http_api
## "/pub/archive": mod_http_fileserver
web_admin: true
http_bind: true
http_poll: true
## register: true
captcha: false
commands_admin_access: configure
commands:
- add_commands: user
oauth_expire: 3600
oauth_access: all
Request
curl -v -X POST -H "X-Admin: true" -H "Authorization: Basic YWRtaW5AcHJqLmlvOmFkbWlu" -H "Content-Type:application/json" http://prj.io:5280/api/status -d '{}'
Logs
2016-03-26 04:38:04.711 [debug] <0.490.0>#ejabberd_http:process_header:281 (#Port<0.16265>) http query: 'POST' <<"/api/status">>
2016-03-26 04:38:04.711 [debug] <0.490.0>#ejabberd_http:extract_path_query:395 client data: <<"{}">>
2016-03-26 04:38:04.711 [debug] <0.490.0>#ejabberd_http:process:353 [<<"api">>,<<"status">>] matches [<<"api">>]
2016-03-26 04:38:04.711 [info] <0.490.0>#mod_http_api:log:388 Admin call status [] from ::FFFF:192.168.117.1:53583
Please help me out to understand ejabberd's behaviour and the way to post some requests to mod_http_api.
try the below ...
commands_admin_access: configure
commands:
- add_commands:
- status
In Request you have given,
curl -v -X POST -H "X-Admin: true" -H "Authorization: Basic YWRtaW5AcHJqLmlvOmFkbWlu" -H "Content-Type:application/json" http://prj.io:5280/api/status -d '{}'.
There is no such end point status
Try one of the following as you endpoint,
num_active_users - Number of users active in the last days
status_num_host - Number of logged users with given status in host
status_num - Number of logged users with given status
stats - Get statistical value: registered users, online users, online users node, uptime seconds
stats_host - Get statistical value per host: registered users, online users, online users node, uptime seconds

Mule smpt transport on EC2

A Mule flow I have deployed to EC2 cannot send emails to a nodejs "simplesmtp" server running on another EC2 instance. Here are the authentication details for the SMPT server
user: joseph
pass: josephk
port: 2525 (open in security group)
I can send emails to this SMTP server using various clients on other hosts, here's the auth part of a nodejs client:
var smtpTransport = nodemailer.createTransport("SMTP",{
host: 'ec2-54-211-220-210.compute-1.amazonaws.com',
secureConnection: false,
port: 2525,
auth: {
user: "joseph",
pass: "joseph12"
}
});
My Mule smpt endpoint looks like this
<smtp:outbound-endpoint
host="ec2-54-211-220-210.compute-1.amazonaws.com"
port="2525"
user="joseph"
password="joseph12"
to="cleardot#aol.com"
from="joseph#ec2-54-211-220-210.compute-1.amazonaws.com"
subject="Email from Mule ESB"
doc:name="send notification"
/>
My log error is (I hate dumping log files on here but in this case have to)
INFO 2014-11-02 12:03:08,734 [[q2].connector.smtp.mule.default.dispatcher.01] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'connector.smtp.mule.default.dispatcher.1535039248'. Object is: SmtpMessageDispatcher
ERROR 2014-11-02 12:03:08,815 [[q2].connector.smtp.mule.default.dispatcher.01] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=smtp://joseph:<password>#ec2-54-211-220-210.compute- 1.amazonaws.com, connector=SmtpConnector
{
name=connector.smtp.mule.default
lifecycle=start
this=54d8fd1a
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[smtp]
serviceOverrides=<none>
, name='endpoint.smtp.joseph.compute.1.amazonaws.com.2525', mep=ONE_WAY, properties={toAddresses=cleardot#aol.com, subject=Email from Mule ESB, fromAddress=joseph#ec2-54-211-220-210.compute-1.amazonaws.com}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: MimeMessage
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. 530 5.5.1 Authentication Required
(com.sun.mail.smtp.SMTPSendFailedException)
com.sun.mail.smtp.SMTPTransport:1829 (null)
2. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=smtp://joseph:<password>#ec2-54-211-220-210.compute-1.amazonaws.com, connector=SmtpConnector
{
name=connector.smtp.mule.default
lifecycle=start
this=54d8fd1a
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[smtp]
serviceOverrides=<none>
}
, name='endpoint.smtp.joseph.compute.1.amazonaws.com.2525', mep=ONE_WAY, properties={toAddresses=cleardot#aol.com, subject=Email from Mule ESB, fromAddress=joseph#ec2-54-211-220-210.compute-1.amazonaws.com}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: MimeMessage (org.mule.api.transport.DispatchException)
org.mule.transport.AbstractMessageDispatcher:117 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
com.sun.mail.smtp.SMTPSendFailedException: 530 5.5.1 Authentication Required
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1829)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1368)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:886)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
INFO 2014-11-02 12:03:09,697 [[q2].processArcMessage.stage1.02] org.mule.api.processor.LoggerMessageProcessor: send alert [B#3c32fb80
ERROR 2014-11-02 12:03:09,706 [[q2].connector.smtp.mule.default.dispatcher.01] org.mule.exception.DefaultMessagingExceptionStrategy:
Other comments:
I tried using joseph#ec2-54-211-220-210.compute-1.amazonaws.com as the user param with no luck.
Am wondering if Mule smpt requires that I use a standard port, or if I must use smpts not smpt.
My SMPT server logs attempts at authentication but sees nothing coming from Mule
Any help appreciated on this and the general issue of sending email from Mule on EC2
Clearly Mule can connect to your server because its response is visible in the logs:
530 5.5.1 Authentication Required
While your server was open to the web (see my comment above), I've noticed that it issued a 250 STARTTLS so I'm thinking that you should probably use the SMTPS transport for Mule, instead of the SMTP one in order to have proper support for TLS.