Test email not sent. MailConnectException

Version: docker 8.7.0.41497

Hi, we wanted to try Sonarqube so we have deployed community edition on Google Cloud compute engine.
Machine is in separate vpc and have all egress allowed. Sonarqube is working in docker.

The issue is that when I try to setup smtp and send test email via mailjet I’m getting error like below.

"2021.03.05 19:30:10 DEBUG web[AXgC8jtorosz1Vw0AAMn][o.s.s.n.e.EmailNotificationChannel] Fail to send test email to l.byjos@xxxxx.xxx: {} "
"org.apache.commons.mail.EmailException: Sending the email to the following server failed : in-v3.mailjet.com:25 "
" at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1469) "
"Caused by: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: in-v3.mailjet.com, 25; timeout 30000 "
" at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2118) "
" at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:712) "

I found suspicious log lines but I don’t know if this is directly connected to an issue.

"2021.03.05 19:29:40 DEBUG web[AXgC8jtorosz1Vw0AAMn][com.sun.mail.smtp] protocolConnect returning false, host=in-v3.mailjet.com, user=sonarqube, password=<null> "
"2021.03.05 19:29:40 DEBUG web[AXgC8jtorosz1Vw0AAMn][com.sun.mail.smtp] useEhlo true, useAuth true "

In firewall logs I see that this connection is allowed so I don’t know why it have trouble to connect to mailjet.

I’m still struggling with this issue. Does anyone have an idea what might be wrong?

Hello Lukasz,

welcome to the community! GCP is blocking port 25 to avoid spam. If your mail provider allows this use an alternative port.

Lol it worked, I changed to 587. I was trying all available ports previously and it was not working. But great it worked:D

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.