Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1; - spring

I config spring email by add 2 step verification and password is Generated App Password
Help me know why I wrong :(

Related

Connection refused to host: smtp.gmail.com port: 587 from Spring Boot

I am trying to send email using spring-boot-starter-mail and the result is
Failed message 1: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 587; timeout 5000;
My application.properties are
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=<email>
spring.mail.password=<password>
# Other properties
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.connectiontimeout=5000
spring.mail.properties.mail.smtp.timeout=5000
spring.mail.properties.mail.smtp.writetimeout=5000
# TLS , port 587
spring.mail.properties.mail.smtp.ssl.trust=smtp.gmail.com
spring.mail.properties.mail.smtp.starttls.required=true
spring.mail.properties.mail.smtp.starttls.enable=true
I have tried myriad combinations and all roads lead to this same exception! I can telnet to smtp.gmail.com 587 and receive a response
220 smtp.gmail.com ESMTP e82sm2105370oia.36 - gsmtp
Many links I followed suggested a firewall might be to blame. Has anyone seen this issue?
Are you using a proxy? If your telnet is successful then it’s using some configuration that your spring application lacks, perhaps an environment variable such as HTTP_PROXY is set? The most likely scenario I come across in this situation is this issue. You would them need to set this as normal for any java application by passing the
-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128
arguments.

Mail properties in Production - Jhipster 4.2.8

I have the following configuration of the mail account of my company in develop, which goes perfectly:
mail:
host: smtp.xxx.es
port: 587
username: notifications-noreply#xxx.es
password: xxxx
protocol: smtp
#tls: true
properties.mail.smtp:
auth: true
from: notifications-noreply#xxx.es
starttls.enable: true
ssl.trust: smtp.xxx.es
I copy de same data from "application-dev.yml" to "application-prod.yml".
I make the deployment in Google Cloud.
It does not send me mails and the logs tells me the following:
: Email could not be sent to user 'joseluis.xxx#xxx.com': Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.xxx.es, 587; timeout -1;
nested exception is:
java.net.ConnectException: Operation timed out (Connection timed out). Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.xxx.es, 587; timeout -1;
nested exception is:
java.net.ConnectException: Operation timed out (Connection timed out)
Can somebody help me?
As described in the Google Cloud documentation you can't send e-mail from your Google Cloud VM using port 587. So this has nothing to do with JHipster, it's a limitation from your cloud provider.
I personally use Mailgun, which uses port 2525 (which is allowed by Google Cloud), here is my configuration for https://start.jhipster.tech (a JHipster application that runs on Google Cloud):
spring:
mail:
host: smtp.mailgun.org
port: 2525
username: xxxxx#mg.jhipster.tech
password: xxxxx
As Mailgun provides a generious free tier you can test this for free - in fact I use it in production and haven't paid anything yet!

Getting errors trying to connect to my sites FTP account from Filezilla

I'm getting the following error when I try to connect to my FTP account in Filezilla using the given cPanel FTP configuration. I've gone ahead and double checked it and tried entering it manually but I continue to get the same error.
Connection attempt failed with "EAI_NONAME - Neither nodename nor servname provided, or not known".
Everything I find tells me that something may be wrong in how I'm entering something but I'm sure that I am not. I'm unable to figure out this and I've worked with Filezilla and connecting to many other FTP accounts using the FTP configs in cPanel successfully.
Example FTP settings:
Host: ftp.address.com
Protocol: FTP
Encryption: Use explicit FTP over TLS if available
Logon Type: Normal
User: user#address.com
Password: ************
I've triple-checked the password and tried resetting it a few times in the cPanel.
I've tried removing the ftp. part in front of the host name to someone elses suggestions but I then get the following error:
Connection attempt failed with "ECONNREFUSED - Connection refused by server".
I'm at a lost and I can't figure out how to connect to my site. Any help is appreciated. Thanks.
Please check if your FTP server is actually working or listening. Connection refused by the server means that FTP server is not up and running. You can try to do a telnet ftp-server-ip-address 21 and see if you are able to connect or not.
Issue via ssh:
systemctl restart pure-ftpd and then systemctl status pure-ftpd to see if your ftp server is actually started. Additionally you can issue:
nestat -tunlp and check the list to see if you see the ftp service listening to the port 21. You should see an entry like this one:
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 8788/pure-ftpd (SER
You can restart the ftp server from WHM as well
for connecting to Cpanel through filezilla ftp client, i think this is how you should set the required things:
host: address.com
(no need to add ftp in the beginning)
User: user#address.com
Password: ************
Note that this user should be active in FTP Account.

Trying to Create the Server Socket On the Port [ 8443] With the Message: Couldn't Find a Self-Signed Certificate in Chai

Dear Greetings I try to deploy new Archive in my server; the Archive incloud web service use HTTPS and I use port 8443 because I already used 443 for another Archive. The web serive it's working in TIBCO Designer, but when I try to deploy it returns below error: BW-EXT-LOG-100000 Failed to initialize end point associated with ProtocolHandler ["http-bio-8443"] java.io.IOException: An AXSecurityException was thrown while trying to create the server socket on the port [ 8443] with the message: couldn't find a self-signed certificate in chain Could you please advise me?
I found in new Archive there is one process connect to 443 ,change all process to connect to 8443

SFTP Connection Issue "Connection reset by peer"

I am unable to connect to Secured FTP server Using Filezilla and psfTP too.
While connecting one popup message comes for Certification, then I find this error
Error Message:--
Status: Connecting to idx.XYZ.com...
Response: fzSftp started
Command: open "abc_mnp#idx.XYZ.com" 22
Command: Pass: ****
*Error: Network error: Connection reset by peer
Error: Could not connect to server*
Any Idea guys..
I feel this is an Issue with Server.

Resources