Outbound SMTP connections timing out from Railway service
rodrigo-bj-remax
PROOP

2 months ago

Hello Railway Support Team,

I have a Passbolt service running on Railway and need to send emails through Mailgun SMTP.

However, outbound SMTP connections from inside the container are timing out. I tested multiple SMTP providers and ports directly from the running container:

smtp.mailgun.org:587 → Connection timed out

smtp.mailgun.org:2525 → Connection timed out

smtp.mailgun.org:465 → Connection timed out

smtp.gmail.com:587 → Connection timed out

smtp.sendgrid.net:2525 → Connection timed out

Example test result:

php -r '$s=@stream_socket_client("tcp://smtp.mailgun.org:2525",$e,$m,10); var_dump((bool)$s,$e,$m);'

bool(false)

int(110)

string(20) "Connection timed out"

php -r '$s=@stream_socket_client("tcp://api.mailgun.net:443",$e,$m,10); var_dump((bool)$s,$e,$m);'

I enabled Outbound IPv6 as well, but smtp.mailgun.org does not return an IPv6/AAAA record.

Could you please verify whether there is any outbound SMTP/egress restriction, firewall rule, routing issue, or IP-level filtering affecting TCP ports 465, 587, and 2525 from my Railway service/region?

My application depends on authenticated SMTP for Passbolt invitations, password recovery, and notifications.

Thank you.

Solved

2 Replies

Railway
BOT

2 months ago

Outbound SMTP is only available on the Pro plan and above; it is disabled on Free, Trial, and Hobby plans. For sending emails from your application, please use a dedicated email service that provides an HTTPS API (Mailgun itself offers one). More details are in our outbound networking docs.


Status changed to Awaiting User Response Railway • 2 months ago


Railway

Outbound SMTP is only available on the Pro plan and above; it is disabled on Free, Trial, and Hobby plans. For sending emails from your application, please use a dedicated email service that provides an HTTPS API (Mailgun itself offers one). More details are in our [outbound networking docs](https://docs.railway.com/networking/outbound-networking).

rodrigo-bj-remax
PROOP

2 months ago

I performed the procedure and the ports failed

root@a0a986e5cba7:/usr/share/php/passbolt# SMTP_HOST="$smtp.mailgun.org" bash -c '

for port in 25 465 587 2525; do

timeout 1 bash -c "</dev/tcp/$SMTP_HOST/$port" 2>/dev/null && \

echo "$SMTP_HOST port $port reachable" || \

echo "$SMTP_HOST port $port unreachable"

done

'

.mailgun.org port 25 unreachable

.mailgun.org port 465 unreachable

.mailgun.org port 587 unreachable

.mailgun.org port 2525 unreachable

root@a0a986e5cba7:/usr/share/php/passbolt# SMTP_HOST="smtp.mailgun.org" bash -c '

for port in 25 465 587 2525; do

timeout 1 bash -c "</dev/tcp/$SMTP_HOST/$port" 2>/dev/null && \

echo "$SMTP_HOST port $port reachable" || \

echo "$SMTP_HOST port $port unreachable"

done

' smtp.mailgun.org port 25 unreachable

smtp.mailgun.org port 465 unreachable

smtp.mailgun.org port 587 unreachable

smtp.mailgun.org port 2525 unreachable

root@a0a986e5cba7:/usr/share/php/passbolt#


Status changed to Awaiting Railway Response Railway • 2 months ago


Status changed to Solved rodrigo-bj-remax • 2 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...