port-binding failures for subethasmtp email server in Openshift environment - openshift

I have an application which uses subethasmtp library to receive inbound emails. I have tested my application (a listener) on my laptop by binding the (subethasmtp) email server to port 25. It worked fine.
When I built my application on Openshift, I received the following exception:
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/]] (ServerService Thread Pool -- 74) JBWEB000287: Exception sending context initialized event to listener instance of class org.SandRiver.InvoiceMailServer.InvoiceListener: java.lang.RuntimeException: java.net.BindException: Permission denied
I also tried to bind to a port > 20000, but received the same error message.
May someone help me?
Best Regards,
John Zhu

You can not bind to port 25, that requires root access. You should try ports between 15000 and 20000, and see if that works, it should. Also, those ports will not be able to be accessed from outside of your gear, so unless you are trying to just use that mail server for something on your gear, it is not going to work correctly (accept/send email from an outside source)

Related

Exception occurred while flushing email queue on Ionos virtual cloud server

I have a Symfony 4 application running on 1und1 on a package called "1&1 Unlimited Plus". The SMTP config looks like this:
MAILER_URL=smtp://smtp.1and1.com?username=****&password=******
and it works fine. I also have a development copy of this application on my local dev server with same config. This dev copy can send emails, too.
Since the databases on "1&1 Unlimited Plus" are limited to 1GB, I ordered another cloud server from Ionos. With the same config I am not able to send emails. I got this error in dev.log:
Exception occurred while flushing email queue: Connection could not be established with host smtp.1and1.com [Connection timed out #110]
Ping on smtp.1and1.com works, it reveals the same IP like if I ping on my dev server. On this cloud server I have running:
Plesk Onyx
Ubuntu 18.04.2 LTS‬
DNS turned off. I have just an A-record on the origin server to the IP of cloud server. NO MX-records set.
I checked the firewall rules. No outgoing limits found, just incoming. I added TCP 25 to incoming rules but I dont know if it is necessary.
I tried another ports but then I got this:
Exception occurred while flushing email queue: Expected response code 220 but got an empty response []
More config:
swiftmailer:
url: '%env(MAILER_URL)%'
spool: { type: 'memory' }
Any idea whats wrong?
I found the solution. Ionos closes the outgoing port 25 per default. This is nothing I can find or change in admin area, only technical support can open this port.

Google Compute Engine and Glassfish can't access from outside

I created an instance (CentOS7) in GCE. I then installed Glassfish 4. However, I can't seem to access it via http/https.
[ank#instance-1 bin]$ sudo ./asadmin start-domain
Waiting for domain1 to start .........
Successfully started the domain : domain1
domain Location: /opt/glassfish4/glassfish/domains/domain1
Log File: /opt/glassfish4/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.
When trying to access http://ip_address or even http://ip_address:4848 I get "refused to connect" error.
Appreciate any help.
you'd need to open port tcp:80, tcp:443 (and tcp:4848) on the firewall; assuming you have already assigned an external IP (or are accessing it from another internal IP on the same network, which I'd suggest for tcp:4848). see the documentation, concerning: Using Firewall Rules.

Sending test mail fails in confluence

I need to evaluate notification functionality in confluence.
I have installed confluence locally on my PC.
I have configured mail server in it by going to General Configuration->Mail Servers->Add a new SMTP mail server
I have provided smtp.office365.com as Server Host Name and 587 as Server port.
I have used my company user id as User name and corresponding password.
However when I try to send a test mail, it fails with below exception
"Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.office365.com, port: 587" and also we have tried to configure our smtp server and getting error as "Caused by: java.net.SocketException: Permission denied: connect"
I have seen accepted answers for this question at post https://answers.atlassian.com/questions/139025/error-while-configuring-mail-server
However that is related to a bug Java1.7 whereas I am using Java1.8.
Can someone please suggest any idea what thing can be wrong?
Looking at the hostname it seems that the mail server is in the internet. If you are behind a proxy you will need to configure this in the java options as described here
https://confluence.atlassian.com/doc/configuring-web-proxy-support-for-confluence-117068.html

Pingfederate SCIM Inbound provisioning

I have configured SCIM inbound provisioning in pingfederate 7.2.0 using Active Directory as an user store. But when I hit the URL exposed by ping to search for an user I get the following error on the browser-
{ "totalResults":0,"itemsPerPage":0,"startIndex":0,
"errors":[{"description":"User and/or certificate not found","code":"401"}]
}
In the logs it says
11:34:29,251 DEBUG [Authenticator] AuthnInfo: ID='null' cert:false
basic:false from CERT:'null' BASIC:'null' 11:34:29,251 ERROR [UsersIdResource]
Unable to find a connection associated with the username/password and/or
certificate passed in with the request.
11:34:29,252 DEBUG [TrackingIdSupport] [cross-reference-message]
entityid:null subject:ranajoy
Can someone please help me with this?
I was having this exact same issue. I set up my Provisioning connection correctly, and it worked in other environments, and everything looked good. But then I got this error. If I changed the Basic Auth to a bad password, the error message at least changed to "Bad Password for <user>".
I took another look at my connection and realized I never actually activated the connection:

Socket Exception when Connecting from Phone

I try to do an example about client-server Windows Phone app
but when I debug code, there is a error
An unhandled exception of type 'System.Net.Sockets.SocketException'
occurred in System.dll
Additional information: No connection could be made because the target
machine actively refused it
If there is a handler for this exception, the program may be safely
continued.
What should I do?
Try changing the port , the firewall may be blocking some of the ports associated with another applications.
For internal use you can use IP 127.0.0.1 , Port 5738
Best Regards,
Yaniv Jacob Jacob