Can't get admin email to send working with using namecheap email server


(Nath Turton) #1

Hello,

I’ve installed Discourse on my Ubuntu Server.

I’ve bought a domain and email server from NameCheap.

I’m now trying to get the email to send to my mailbox.

Here are my details inside my app.yml at the moment

## on initial signup example 'user1@example.com,user2@example.com'
DISCOURSE_DEVELOPER_EMAILS: 'admin@mydomain.com'

## TODO: The SMTP mail server used to validate new accounts and send notifications
DISCOURSE_SMTP_ADDRESS: mail.privateemail.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: postmaster@discourse.mydomain.com
DISCOURSE_SMTP_PASSWORD: "password to my private email client"
#DISCOURSE_SMTP_ENABLE_START_TLS: true   

Any ideas what I can do? NameCheap have been unable to help providing much information. I keep trying but have been unsuccessful so with the rebuilding it’s taking a while to sort.

Thanks all!


Solution for privateemail configurations
(cpradio) #2

You need to look in your logs to see why.

/var/discourse/shared/standalone/log/rails/production.log

Also, this topic should help you out with troubleshooting it


(Nath Turton) #3

Thanks @cpradio for showing me where the logs are located.

Sent mail to admin@mydomain.com (5.1ms)
Job exception: SMTP-AUTH requested but missing secret phrase

Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED) subscribe failed, reconnecting$
Job exception: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)

Job exception: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)

Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED) subscribe failed, reconnecting$

Sent mail to admin@mydomain.com (1852.4ms)

Last few lines also show…

Completed 200 OK in 174ms (Views: 93.4ms | ActiveRecord: 8.8ms)
Started GET "/javascripts/jquery_include.js" for 94.142.75.85 at 2017-02-15 14:37:00 +0000
ActionController::RoutingError (No route matches [GET] "/javascripts/jquery_include.js")
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middlewa$
Processing by ExceptionsController#not_found as */*
  Rendered exceptions/not_found.html.erb within layouts/no_ember (28.8ms)
  Rendered layouts/_head.html.erb (46.6ms)
  Rendered common/_special_font_face.html.erb (1.7ms)
  Rendered common/_discourse_stylesheet.html.erb (13.1ms)
  Rendered application/_header.html.erb (1.8ms)
  Rendered text template (0.0ms)
Completed 404 Not Found in 211ms (Views: 0.9ms | ActiveRecord: 22.7ms)

Sent mail to admin@mydomain.com (1823.1ms)

(Joshua Rosenfeld) #4

Does your email server use 2-factor auth?


(Nath Turton) #5

Hey.

I gave up and tried using mailgun as there was more documentation for it. It is happy that i’ve setup my records. However I’m still getting no mail and I don’t really understand the logs.

Here is my app.yml

## TODO: List of comma delimited emails that will be made admin and developer
## on initial signup example 'user1@example.com,user2@example.com'
DISCOURSE_DEVELOPER_EMAILS: 'admin@mydomain.com'

## TODO: The SMTP mail server used to validate new accounts and send notifications
DISCOURSE_SMTP_ADDRESS: smtp.mailgun.org
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: postmaster@discourse.mydomain.com
DISCOURSE_SMTP_PASSWORD: "mypassword"
#DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)

I then have my records as follows

TXT Record	
discourse
v=spf1 include:mailgun.org ~all
1 min

TXT Record	
krs._domainkey.discourse
k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBg...

Logs

Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED) subscribe failed, reconnecting$
Job exception: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)

Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED) subscribe failed, reconnecting$
Job exception: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)

Job exception: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)

Job exception: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)

Job exception: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)

Job exception: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)

Job exception: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)

Job exception: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)

Job exception: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)


Completed 404 Not Found in 213ms (Views: 0.9ms | ActiveRecord: 24.7ms)
Started PUT "/finish-installation/resend-email" for 94.142.75.85 at 2017-02-15 16:27:11 +0000
Processing by FinishInstallationController#resend_email as HTML
  Parameters: {"authenticity_token"=>"QoMEMBBzg08W/3KzqFhbldaV+LZ32N4EKqyAo3Ga6nvaCsk31/2qo1EdFY$
  Rendered finish_installation/resend_email.html.erb within layouts/finish_installation (0.8ms)
  Rendered common/_special_font_face.html.erb (0.8ms)
  Rendered layouts/_head.html.erb (1.6ms)
Completed 200 OK in 30ms (Views: 14.3ms | ActiveRecord: 2.3ms)
Started GET "/javascripts/jquery_include.js" for 94.142.75.85 at 2017-02-15 16:27:11 +0000
ActionController::RoutingError (No route matches [GET] "/javascripts/jquery_include.js")
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middlewa$
Processing by ExceptionsController#not_found as */*
  Rendered exceptions/not_found.html.erb within layouts/no_ember (23.0ms)
  Rendered layouts/_head.html.erb (35.4ms)
  Rendered common/_special_font_face.html.erb (1.2ms)
  Rendered common/_discourse_stylesheet.html.erb (5.7ms)
  Rendered application/_header.html.erb (1.5ms)
  Rendered text template (0.1ms)
Completed 404 Not Found in 130ms (Views: 1.0ms | ActiveRecord: 15.9ms)

Sent mail to admin@mydomain.com (1160.0ms)

(Joshua Rosenfeld) #6

(Nath Turton) #7

Thanks for the response and for that information. I have completed as you suggested and my logs show this.

Still no email has been received.

Started PUT "/finish-installation/resend-email" for 94.142.75.85 at 2017-02-15 16:56:06 +0000
Processing by FinishInstallationController#resend_email as HTML
  Parameters: {"authenticity_token"=>"v9g3YAfcsg98nf07KFbmP1RgvHERpZJdWi4mnuEDt+YnUfpnwFKb4zt/mg$
  Rendered finish_installation/resend_email.html.erb within layouts/finish_installation (1.0ms)
  Rendered common/_special_font_face.html.erb (0.3ms)
  Rendered layouts/_head.html.erb (0.5ms)
Completed 200 OK in 28ms (Views: 4.7ms | ActiveRecord: 5.6ms)
Started GET "/javascripts/jquery_include.js" for 94.142.75.85 at 2017-02-15 16:56:06 +0000
ActionController::RoutingError (No route matches [GET] "/javascripts/jquery_include.js")
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middlewa$
Processing by ExceptionsController#not_found as */*
  Rendered exceptions/not_found.html.erb within layouts/no_ember (10.4ms)
  Rendered layouts/_head.html.erb (0.5ms)
  Rendered common/_special_font_face.html.erb (0.2ms)
  Rendered common/_discourse_stylesheet.html.erb (0.3ms)
  Rendered application/_header.html.erb (0.2ms)
  Rendered text template (0.0ms)
Completed 404 Not Found in 48ms (Views: 0.4ms | ActiveRecord: 15.2ms)

Sent mail to admin@mydomain.com (1234.2ms)

(Joshua Rosenfeld) #8

Sorry - you’ve surpassed my email knowledge at this point … :disappointed:


(Nath Turton) #9

No problem! I appreciate the help.


(Régis Hanol) #10

Something’s wrong with your install. Did you follow our setup guide?


(Nath Turton) #12

Yeah line by line. It loads up fine when i navigate to the url. I setup an admin account but cant receive the email.


(Jay Pfaffman) #13

Did you send a test email from the admin email page? What do the Discourse logs say?

What about Mailgun logs?


(Zhaosen Wang) #14

Hi,
I’ve also encountered this problem, anyone who knows howto?