SOLVED | SMTP failing in deployed Spring Boot application with timeout
praneet30debnath
PROOP

3 months ago

My Spring Boot Service has following SMTP configuration:

mail:
  host: smtp.gmail.com
  port: 587
  username: ${MAIL_USERNAME}
  password: ${MAIL_PASSWORD}
  properties:
    mail:
      smtp:
        auth: true
        starttls:
          enable: true
          required: true
        connectiontimeout: 10000
        timeout: 10000
        writetimeout: 10000

Encountering following error trace:

Mail server connection failed. Failed messages: org.eclipse.angus.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 587; timeout 10000;
  nested exception is:
	java.net.SocketTimeoutException: Connect timed out; message exception details (1) are:
Failed message 1:
org.eclipse.angus.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 587; timeout 10000;
  nested exception is:

Claude says "Railway blocks outbound SMTP ports (25, 465, 587) by default to prevent spam". Is it true?

Solved

2 Replies

praneet30debnath
PROOP

3 months ago

Update:

I went through a past ticket: https://station.railway.com/questions/smtp-65969dff

An employee replied:

"We noticed an issue where a small subset of hosts didn't have this block, so a ticket was created. During this, the engineer added ports 465, 587, and 2525 to exhaustively block SMTP (instead of just the original 25).

we've unblocked SMTP for all Pro and Enterprise customers."

I upgraded to pro plan and it is working now.

Thanks


Glad to hear that the issue is fixed smile emoji


Status changed to Awaiting User Response Railway 3 months ago


Status changed to Solved mahmoud-railway 3 months ago


Loading...