I am trying to configure discourse , which is rails3 webapp, but there are some problems with configuring smtp with gmail smtp server.
Yesterday I registered a new gmail account, and I can log in to the browser and the mail client.
Then I configure the discourse in the config/environments/production.rb file:
config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :port => "587", :user_name => " smtp4shuzu@gmail.com ", :password => "12345678", :authentication => :plain, :domain => "shuzhu.org", :enable_starttls_auto => true }
Run sidekiq , which is used to send emails in the background:
nohup bundle exec sidekiq > log/sidekiq.log 2>&1 &
Then run the discourse in production mode:
rails server -e production -d
But that will not work. I see some errors in sidekiq.log :
2013-03-01T03: 06: 02Z 30687 TID-qib28 WARN: {"retry" => true, "queue" => "default", "class" => "Jobs :: UserEmail", "args" => [ {"type" => "signup", "user_id" => 42, "email_token" => "b40a21ece2b14586e346abfd96685975", "current_site_id" => "default"}], "jid" => "558bb6bd5aa36cfc8d3d1e91", " > "Connection reject - connect (2)", "error_class" => "Errno :: ECONNREFUSED", "failed_at" => 2013-03-01 03:06:02 UTC, "retry_count" => 0} 2013-03 -01T03: 06: 02Z 30687 TID-qib28 WARN: connection refused - connect (2) 2013-03-01T03: 06: 02Z 30687 TID-qib28 WARN: /home/discourse/.rvm/rubies/ruby-1.9.3- p385 / lib / ruby ββ/ 1.9.1 / net / smtp.rb: 540: in initialize' /home/discourse/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/net/smtp.rb:540:in open "/home/discourse/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/net/smtp.rbβΊ40:in` tcp_socket '
I tried all kinds of smtp settings, but none of them work.
UPDATE
In response to @Basil, I just tried:
config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :user_name => "smtp4shuzu", :password => "12345678", :authentication => "plain", :enable_starttls_auto => true }
But he has the same error. The shuzu.org domain is the domain of my site, I thought I should transfer it to smtp. Now I deleted it, but still did not work.