בעיה בשליחת דואר דרך Namecheap Private Email (SMTP) ב-Discourse עצמאי

Hello everyone,

I’ve been trying to configure outbound mail on a self-hosted Discourse installation but so far no luck. Even with Namecheap support involved, we couldn’t get it working. Hoping someone here can point out what I’m missing.

Setup

  • Hosting: DigitalOcean droplet, Discourse installed via the official Docker method (/var/discourse).

  • Domain: Managed via Cloudflare (proxied A records for the site, DNS-only for MX/mail records).

  • Mail provider: Namecheap Private Email.

  • Discourse version: Latest tests-passed branch.

What works

  • I can receive email at my hello@domain.com inbox without issues.

  • MX, SPF, DKIM, and DMARC DNS records are set and validated.

  • Incoming mail via Gmail → hello@domain.com works.

What fails

  • Outgoing (activation emails, test emails from Discourse) never arrive.

  • Namecheap support confirmed my credentials and settings are correct, but couldn’t explain why it fails from the server.

Current app.yml config

DISCOURSE_SMTP_ADDRESS: mail dot privateemail dot com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: hello at domain dot com
DISCOURSE_SMTP_PASSWORD: “PASSWORD”
DISCOURSE_SMTP_ENABLE_START_TLS: true
DISCOURSE_SMTP_DOMAIN: domain dot com
DISCOURSE_NOTIFICATION_EMAIL: hello at domain dot com DISCOURSE_SMTP_AUTHENTICATION: login

I also tried port 465 with:

DISCOURSE_SMTP_PORT: 465
DISCOURSE_SMTP_ENABLE_START_TLS: false
DISCOURSE_SMTP_SSL: true

Debug steps taken

  • Verified DNS records in Cloudflare are correct (MX, SPF, DKIM, DMARC).

  • Confirmed that ports 587 and 465 are not blocked locally by UFW/iptables.

  • Tried forcing IPv4 preference in /etc/gai.conf.

  • Tested with nc and openssl → still timing out.

  • Even Namecheap’s own instructions (587 STARTTLS or 465 SSL) result in failure from the server.

Question

Has anyone successfully configured Namecheap Private Email with Discourse SMTP?

  • Is there a known issue with DigitalOcean droplets reaching mail.privateemail.com on 587/465?

  • Should I give up on Namecheap SMTP and use a transactional mail service (Postmark, Mailgun, SendGrid) instead?

  • Is there a special app.yml flag needed for this provider?

Thanks in advance for any guidance. I’ve hit a wall with this setup.

You should use a transaction mail serive like Mailgun, Brevo or Amazon SES. That’s the optimal way to send emails from your forum.

See discourse/docs/INSTALL-email.md at main · discourse/discourse · GitHub

You may also want to check out:

לייק 1

What is the failure message?

Is digital ocean blocking outgoing mail many others have reported?

Have you tried port 2525?

לייק 1

Thank you guys for the replies I appreciate it very much.

@pfaffman I am not aware that Digital Ocean is blocking outgoing mail. No i have not tried 2525.

After searching for it I stumbled upon an article they block all outgoing mails Why is SMTP blocked? | DigitalOcean Documentation

I did a little test with:

nc -vz ``smtp.mailgun.org`` 2525 and passed the test. 587 and 465 failed.

I opened a ticked with the request to open these ports.

If they won’t open it I need to look into mailgun, I hope this is free.

if you contact their support for account activation, after change to the plan type setting, you should be fine on a free plan


I always thought of this being very similar to BT mail or Gmail, not suitable for Discourse though.

You could do POP3 polling for receiving mail, but because you have an x86 VPS i’d recommend mail-receiver

Digital Ocean has replied and replied to their mail:

”We’d be happy to explore the possibility by having our Security team take a closer look at unblocking the SMTP ports for you. To help us better understand your needs and move forward with your request, could you please share the following details about your business requirements:

  • What type of emails will you be sending (e.g. transactional, newsletters, etc.)?

  • Are you planning on hosting your own email or utilizing a third-party sending service?

  • If possible, please provide context on your port requirements and if nonstandard ports or an API cannot be used.

Once we hear back from you, we will forward your request to the team with all the details provided.”

In that case, you should switch to using a transactional mail service like Mailgun (100 emails free per day) or Brevo (300 emails free per day). Then, you can switch to using port 2525 in your app.yml file, since that isn’t blocked.

לייק 1

Greetings from DigitalOcean Support!

We understand that you have an application requirement or a business need to enable port 25, 465 and 587. However due to our current policy we are unable to facilitate requests to remove the restriction on this port.

We recommend utilizing alternative ports if your application allows, such as port 2525. You can also use REST API with SendGrid, which allows you to send emails via HTTP requests instead of the traditional SMTP protocol if it is suitable for you or make use of another third-party sending service.

Please feel free to reach out to us if you have any additional queries. We’re always here for you!

So i will try Mailgun

לייק 1

maybe follow up and say you don’t need 25?

Edit: therefore you don’t need to demonstrate reverse DNS for example, if you wanted to do what MailGun deos for you

@Ethsim2 thanks I think it’s clear, like Linode, they closed everything to fight spam only Linode will open up the ports on request but its ok.

I’ll go for MailGun.

לייק 1

I never experienced in my life my brandnew account gets blocked LOL
”Mailgun: Your account is temporarily disabled.”

Is there an alternative SMTP service I can use?

לייק 1

Oh dear, Brevo is quicker to

לייק 1

@Ethsim2 is that you in that YouTube video? However 587 is blocked by Digital Ocean. Only 2525 is open.

2 לייקים