Setting Up Google Workspace/Gmail SMTP for Ghost CMS
afluisaude
PROOP

2 months ago

Technical Summary for Railway Support (English Transcription)

1. Application and Goal Details

  • Service: Ghost CMS (version 6.9.3) hosted on Railway.

  • Email Service: Google Workspace (Gmail SMTP) using a custom domain (aflui.com).

  • Goal: Configure Ghost to send transactional emails using Google Workspace credentials.

2. Current Variable Configurations (Railway)

The variables are configured to use the Google App Password and standard SMTP ports, without success.

VariableValue/StatusNotemail__transportSMTPCorrect.mail__options__hostsmtp.gmail.comAttempted.mail__options__port465 or 587Both standard ports attempted.mail__options__securetrue (with 465) / false (with 587)Both security configurations attempted.mail__options__auth__useradm@aflui.com (or blog@aflui.com)Workspace authentication account.mail__options__auth__pass xxxx xxxx xxxx xxxx16-digit App Password.

3. Error Diagnosis

The service is consistently emitting a Connection timeout error in the logs, regardless of the port (465 or 587) and security settings.

  • Error Log:Failed to send email. Reason: Connection timeout.

  • Implication: Ghost is unable to establish a TCP connection to the host smtp.gmail.com on the specified ports. This indicates a network blockage occurring before the authentication phase.

4. Diagnostic Measures Already Taken

  • Credential Review: Credentials (auth__user and auth__pass) were checked and confirmed correct for the generated App Password.

  • DNS Configuration (Cloudflare): All email records (SPF and DKIM) and the smtp CNAME record were configured to DNS only (gray cloud), eliminating Cloudflare interference.

  • Protocol Test: Attempted both STARTTLS (587/false) and pure SSL/TLS (465/true). Both resulted in Connection timeout.

5. Request to Railway Support

"I would like to know if there is any Outbound Firewall (Egress Firewall) restriction or SMTP port blockage (465/587) configured by default in this deployment environment, preventing the Ghost service from establishing a connection to external hosts like smtp.gmail.com. If so, what would be the recommended SMTP Relay host/port for use on Railway?"

Attachments

Solved$10 Bounty

Pinned Solution

You need to be on the Pro plan to use the SMTP ports.

You should use SMTP services that have dedicated HTTP endpoints to send mails.

3 Replies

Railway
BOT

2 months ago

Hello,

Outbound SMTP is only available on the Pro plan and above, while Free, Trial, and Hobby plans have SMTP disabled.

For sending emails from your application, please use a dedicated email service that provides HTTPS APIs. More information can be found in our documentation:

https://docs.railway.com/reference/outbound-networking

Best regards,

The Railway Team


Status changed to Awaiting User Response Railway 2 months ago


Railway

Hello,Outbound SMTP is only available on the Pro plan and above, while Free, Trial, and Hobby plans have SMTP disabled.For sending emails from your application, please use a dedicated email service that provides HTTPS APIs. More information can be found in our documentation:https://docs.railway.com/reference/outbound-networkingBest regards,The Railway Team

afluisaude
PROOP

2 months ago

Okay, I'm currently using Mailgun, but I'm having trouble configuring it here on Railway. This error appears in the log.

Failed to send email. Reason: Connection timeout.

"Please see https://ghost.org/docs/config/#mail for instructions on configuring email."

at createMailError (/var/lib/ghost/versions/6.9.3/core/server/services/mail/GhostMailer.js:85:12)

at SMTPConnection._formatError (/var/lib/ghost/versions/6.9.3/node_modules/nodemailer/lib/smtp-connection/index.js:809:19)

at SMTPConnection._onError (/var/lib/ghost/versions/6.9.3/node_modules/nodemailer/lib/smtp-connection/index.js:795:20)

at Timeout.<anonymous> (/var/lib/ghost/versions/6.9.3/node_modules/nodemailer/lib/smtp-connection/index.js:237:22)

Attachments


Status changed to Awaiting Railway Response Railway 2 months ago


You need to be on the Pro plan to use the SMTP ports.

You should use SMTP services that have dedicated HTTP endpoints to send mails.


Status changed to Solved noahd 2 months ago


Loading...