reach mail connection fails with 535 - logback

Below is an excerpt from my logback config for reachmail.
I'm getting "Error occurred while sending e-mail notification. javax.mail.AuthenticationFai
ledException: 535 error: authentication failed, InvalidUsernameOrPassword http://easy-smtp.com/err
at javax.mail.AuthenticationFailedException: 535 error: authentication failed, InvalidUsernameOrPassword http://easy-smtp.com/err"
Here is my appender:
<appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<smtpHost>ssrs.reachmail.net</smtpHost>
<smtpPort>587</smtpPort>
<STARTTLS>true</STARTTLS>
<username>domain\\myuser</username>
<password>mypassword</password>
<to>user#example.com</to>
<from>user#example.com</from>
<subject>Exception: %logger{20} - %m</subject>
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>%d{ISO8601} %p %t %c{1}.%M - %m%n</pattern>
</layout>
</appender>
Is there anything missing in this config? It should connect like this???
My username and password are correct!
Thank you.

You might try a single \ in your username. The double \ is not always required as the first \ is most often used to escape the \a (in Accountkey**\a**dmin)
While less common, some characters in your password may also need to be escaped in the same fashion. This depends on your application's environment and tends to be most common in *NIX devices.
If all else fails, consider email our support line at support#reachmail.com for more specific handling of your issue.

Related

Direct logback logs to graylog

I have a third party java application which uses logback for logging.
I want to add a Socket Appender to the application's logback.xml as specified in the documentation
(https://logback.qos.ch/manual/appenders.html)
<configuration debug="true">
<appender name="SERVER"
class="ch.qos.logback.classic.net.server.ServerSocketAppender">
<port>${port}</port>
<includeCallerData>${includeCallerData}</includeCallerData>
</appender>
<root level="debug">
<appender-ref ref="SERVER" />
</root>
</configuration>
The purpose is to direct the logs to graylog using udp end point.
Is there a way to send the logs using the UDP protocol ?
Thanks for your time.
There are multiple GELF appenders for Logback listed on the Graylog Marketplace:
https://marketplace.graylog.org/addons?tag=logback
Personally, I'd recommend using logstash-gelf.
I created a TCP Socket Server application (say on port 1234 running on localhost).
I added a socket appender to the logback.xml of the third party application to send logs to the TCP Server application.
<appender name="SOCKET" class="ch.qos.logback.classic.net.SocketAppender">
<remoteHost>localhost</remoteHost>
<port>1234</port>
<reconnectionDelay>10000</reconnectionDelay>
<includeCallerData>true</includeCallerData>
</appender>
Now, on the Socket server application, I added the logstash-gelf dependency and appender that joschi recommended.
Now the logs from the third party application go thru a hop and then reach Graylog.
The one caveat that I had to get around was to determine the severity of the log from the log message before logging it again in the socket server application.

UWP appx package Signtool "Error: SignerSign() failed." (-2147024885/0x8007000b)

EDIT
Event log error was this:
error 0x8007000B: The app manifest publisher name (CN=...)
must match the subject name of the signing certificate
(CN={19BE29DF-4812-4F2E-8FC1-A138B146946A}).
The command below now seems to work. So either user error on my part that I cannot identify or something hinky with the state of machine when I was seeing this. That guid associated with the signing cert in the event log message is not what the cert shows in the Certificate Manager snap-in, which is weird.
Original Question
I am attempting to sign a UWP appx package that was generated using MakeAppx.exe. The pfx is a developer code signing certificate generated with these commands from https://msdn.microsoft.com/windows/uwp/porting/desktop-to-uwp-manual-conversion.
C:\> MakeCert.exe -r -h 0 -n "CN=<publisher_name>" -eku 1.3.6.1.5.5.7.3.3 -pe -sv <my.pvk> <my.cer>
C:\> pvk2pfx.exe -pvk <my.pvk> -spc <my.cer> -pfx <my.pfx>
The private key is in my trusted root cert store and worked when I generated an appx from an installer using the Desktop App Converter.
The command line I am using is:
signtool.exe sign -f <path to my pfx file> -fd SHA256 -v .\FishTank.appx
but SignTool is erroring with this:
The following certificate was selected:
Issued to: ...
Issued by: ...
Expires: Sat Dec 31 18:59:59 2039
SHA1 hash: ...
Done Adding Additional Store
Error information: "Error: SignerSign() failed." (-2147024885/0x8007000b)
The certificate publisher matches what is in the appmanifest.xml
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities">
<Identity Name="..."
ProcessorArchitecture="x64"
Publisher="CN=..."
Version="1.1.0.0" />
<Properties>
<DisplayName>Fish Tank</DisplayName>
<PublisherDisplayName>Reserved</PublisherDisplayName>
<Description>Some fish. Swimming around on your screen.</Description>
<Logo>StoreLogo.png</Logo>
</Properties>
<Resources>
<Resource Language="en-us" />
</Resources>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14316.0" MaxVersionTested="10.0.14316.0" />
</Dependencies>
<Capabilities>
<rescap:Capability Name="runFullTrust"/>
</Capabilities>
<Applications>
<Application Id="FishTank" Executable="FishTank.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements
BackgroundColor="#464646"
DisplayName="Fish Tank"
Square150x150Logo="Square150x150Logo.png"
Square44x44Logo="Square44x44Logo.png"
Description="Some fish. Swimming around on your screen." />
</Application>
</Applications>
</Package>
Just like answered here (though for a different error code) - you have to make sure that the Publisher name (in the AppxManifest.xml file) is the same as the certificate's publisher.
For more information, see here (in the bottom "Remarks" section).
The MakeCert /n argument has to be the full Publisher string from your xml.

Mule SMTP not sending any mails

I have configured the outbound endpoint to the best of my knowledge but still the component is not able to send any mail.
I am using the latest Studio 3.7 to develop and the latest run-time
<smtp:outbound-endpoint host="smtp.gmail.com" port="465" user="aaa%40gmail.com" password="password" connector-ref="Gmail" to="zhk%40gmail.com" from="aaa%40gmail.com" subject="TestMessage" responseTimeout="10000" doc:name="SMTP" mimeType="text/plain" bcc="xyz%40gmail.com" cc="xyz%40gmail.com">
<reconnect/>
</smtp:outbound-endpoint>
Please note that this does not throw any errors .
<smtp:gmail-connector name="Gmail" contentType="text/plain" validateConnections="true" doc:name="Gmail"/>
<smtp:outbound-endpoint host="${smtp.host}" port="${smtp.port}" user="${smtp.from.address}" password="${smtp.from.password}"
to="${smtp.to.address}" from="${smtp.from.address}" subject="${mail.success.subject}" responseTimeout="10000"
doc:name="SuccessEmail" connector-ref="Gmail"/>
smtp.host=smtp.gmail.com
smtp.port=587
smtp.from.address=youremail%40gmail.com
smtp.from.password=yourpassword
smtp.to.address=yourtoaddress#gmail.com
I think the port 587 should do the trick
This configuration is a tested/working configuration :)
On the security tab of your SMTP component, enable SMTPS. Then try again.
If won't work, try removing '#gmail.com' on your user.

WSO2 ESB: suspended anonymousendpoint

I am working on WSO2 ESB 4.8.1 and facing an issue regarding to suspended anonymous endpoint. The scenario is: TCP/IP transport receiver (custom one) -> Proxy -> invoke HTTP endpoint.
At the startup runtime, my custom transport receiver will connect to another machine by using TCP/IP protocol and start listener message event. When message event come, the transport receiver will format the message event as JSON format and send it to predefined Proxy (This step is working well even though suspended anonymous endpoint has been occurred). The implement in side the proxy is really simple, just send to HTTP endpoint:
<property name="messageType" value="application/json" scope="axis2" />
<property name="Accept" scope="transport" value="application/json" />
<payloadFactory media-type="json">
<format>$1</format>
<args>
<arg evaluator="json" expression="$.eventMessage" />
</args>
</payloadFactory>
<call>
<endpoint>
<http method="post" uri-template="http://localhost:9080/goal"></http>
</endpoint>
</call>
The process is working fine except the suspended anonymous endpoint has happened (Such as the HTTP endpoint is shutdown), then i am able to see a log message as below:
WARN {org.apache.synapse.endpoints.EndpointContext} - Suspending endpoint : AnonymousEndpoint - current suspend duration is : 30000ms - Next retry after : Tue Oct 28 17:38:23 ICT 2014
If i stop the request traffic at the transport receiver and restart the HTTP endpoint, after 30 ms the endpoint can back to service
In case request traffic at the transport receiver still running, i saw the log message above is displayed few times and then the ESB server don't log that message anymore. At this time, the HTTP endpoint is suspended and never come back to service except restarting ESB server
I also saw this log message:
WARN {org.apache.synapse.core.axis2.TimeoutHandler} - Expiring message ID : urn:uuid:5dcedb38-3f9a-4a75-a201-ae4e76428216; dropping message after global timeout of : 120 seconds
That is really strange for me and i wonder if i did something wrong here. I really need your suggestion guys
Best regards,
An
Use a named endpoint and configure suspension and timeout, have a look there : https://docs.wso2.com/display/ESB481/Endpoint+Error+Handling
If you don't want to loose any message and if your http endpoint can be down for a long time for exemple, you should consider using guaranteed delivery with message Store and message Processor, have a look there : https://docs.wso2.com/display/IntegrationPatterns/Guaranteed+Delivery

How to configure Logback to add host-name/IP to each log event?

I am using Logback for logging. Scribe appenders send the logs in real time to a central Scribe aggregator. But I don't know how to add source machine IP in the logs for each log events. Looking at the aggregated central Scribe logs, it is almost impossible to know which machine is sending the logs. Hence, appending the IP of source machine to each log event will be helpful, and will be really great if we can control that through logback configuration.
It's possible to pass down hostname to remote receiver thru contextName.
Add following to logback.xml on all appenders:
<contextName>${HOSTNAME}</contextName>
Then, on aggregator instance, it will be available for inclusion in the pattern:
<pattern>%contextName %d %-5level %logger{35} - %msg %n</pattern>
According to the Logback docs, there's now a CanonicalHostNamePropertyDefiner expressly to add a hostname to your logs. Add a define to your project:
<define name="hostname"
class="ch.qos.logback.core.property.CanonicalHostNamePropertyDefiner"/>
and access it as ${hostname}
well if you are working on a client server project then u can use MDC feature of slf4j/logback full document here and in this case you can have a well structured log file that you can identify which log is for which client
hope this helps!