Can't send mail on 16.04 - DigitalOcean

I’ve been looking for the answer all day, nothing.

  • I’m doing a fresh install via the first rails app guide on github.
  • Using a 1GB DigitalOcean droplet
  • Using NameCheap’s private email server.

Here is my app.yml:


  ## Uncomment if you want the container to be started with the same
  ## hostname (-h option) as specified above (default "$hostname-$config")

  ## TODO: List of comma delimited emails that will be made admin and developer
  ## on initial signup example ','

  ## TODO: The SMTP mail server used to validate new accounts and send notifications
  # SMTP ADDRESS, username, and password are required
  # WARNING the char '#' in SMTP password can cause problems!
  #DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)

Would appreciate any help on this.
P.S. I ran the more command on my Discourse log, it says Mail Sent!

Me paso y coloque el puerto 2525

Didn’t work. Before I even checked the log I did telnet 2525 and I got hit with:

telnet: Unable to connect to remote host: Connection refused

Also ran sudo ufw allow 2525/tcp @Mecanicos_Argentinos

Don’t DO block port 25 on new accounts now?

Afaik Mailgun on a secure port is still fine, otherwise you’ll need to contact support.

Can you telnet to port 587 of If not, you’ll need to open a ticket with Digital OCean to get them to unblock the port, or get to accept connections at port 2525.

Port 587 works. I contacted DO about this a few hours ago, havent heard anything. This has happened with multiple VPS hosts.

Oops. I didn’t notice this before.

You need to check the logs at, as it’s accepting mail from Discourse but not delivering it.

Or it’s in SPAM.


Tried this tutorial

Got this nasty mess:

Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED) subscribe fail
ed, reconnecting in 1 second. Call stack ["/var/www/discourse/vendor/bundle/ruby
/2.4.0/gems/redis-4.0.1/lib/redis/client.rb:344:in `rescue in establish_connecti
on'", "/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/redis-4.0.1/lib/redis/cl
ient.rb:328:in `establish_connection'", "/var/www/discourse/vendor/bundle/ruby/2
.4.0/gems/redis-4.0.1/lib/redis/client.rb:99:in `block in connect'", "/var/www/d
iscourse/vendor/bundle/ruby/2.4.0/gems/redis-4.0.1/lib/redis/client.rb:291:in `w
ith_reconnect'", "/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/redis-4.0.1/l
ib/redis/client.rb:98:in `connect'", "/var/www/discourse/vendor/bundle/ruby/2.4.
0/gems/redis-4.0.1/lib/redis/client.rb:363:in `ensure_connected'", "/var/www/dis
course/vendor/bundle/ruby/2.4.0/gems/redis-4.0.1/lib/redis/client.rb:219:in `blo
ck in process'", "/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/redis-4.0.1/l
ib/redis/client.rb:304:in `logging'", "/var/www/discourse/vendor/bundle/ruby/2.4
.0/gems/redis-4.0.1/lib/redis/client.rb:218:in `process'", "/var/www/discourse/v
endor/bundle/ruby/2.4.0/gems/redis-4.0.1/lib/redis/client.rb:118:in `call'", "/v
ar/www/discourse/vendor/bundle/ruby/2.4.0/gems/redis-4.0.1/lib/redis.rb:889:in `
block in get'", "/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/redis-4.0.1/li
b/redis.rb:45:in `block in synchronize'", "/usr/local/lib/ruby/2.4.0/monitor.rb:
214:in `mon_synchronize'", "/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/red
is-4.0.1/lib/redis.rb:45:in `synchronize'", "/var/www/discourse/vendor/bundle/ru
by/2.4.0/gems/redis-4.0.1/lib/redis.rb:888:in `get'", "/var/www/discourse/vendor
in `process_global_backlog'", "/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/
message_bus-2.1.4/lib/message_bus/backends/redis.rb:321:in `block in global_subs
cribe'", "/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/message_bus-2.1.4/lib
/message_bus/backends/redis.rb:334:in `global_subscribe'", "/var/www/discourse/v
endor/bundle/ruby/2.4.0/gems/message_bus-2.1.4/lib/message_bus.rb:530:in `global
_subscribe_thread'", "/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/message_b
us-2.1.4/lib/message_bus.rb:478:in `block in new_subscriber_thread'"]
Job exception: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)

It says “Mail Sent” 4 times at the bottom of my log.
Here is my complete config:

Uh Ok. I got the email… but I got 4 of them? Could this be from previous tries