mardi 28 avril 2015

RoR - Devise Mailer - gmail refusing to send message

Currently I am working on Cloud9 and trying to create a rails app where the Devise mailer can send the reset password function and other built in mailing features.

What I think is happening, is that gmail is refusing to send the message because of the account. I even went on gmail and found the cloud9 server that was sending the request and checked "This is me" for the IP address... but it still isn't working

What I have tried:

  1. http://ift.tt/1Dyy1Yj this link allows your account to receive message requests from "less secure" applications.
  2. Changing port number - then we get a time out error rather than our current one.
  3. tried yahoo account - similar error

Relevant files:

log/development.log:

Devise::Mailer#reset_password_instructions: processed outbound mail in 646.5ms

Sent mail to nick.dueber@gmail.com (60.6ms)
Date: Tue, 28 Apr 2015 20:32:39 +0000
From: newstab123@gmail.com
Reply-To: newstab123@gmail.com
To: nick.dueber@gmail.com
Message-ID: <553fee678a275_4542521a93097522@ryan_yu-cs169-newstab-1298669.mail>
Subject: Reset password instructions
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

<p>Hello nick.dueber@gmail.com!</p>

<p>Someone has requested a link to change your password. You can do this through the link below.</p>

<p><a href="http://localhost:3000/profile/users/password/edit?    reset_password_token=VhJFo7yaAsL3tCg2U4Tm">Change my password</a></p>

<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>

Completed 500 Internal Server Error in 1242ms

Net::SMTPAuthenticationError (530-5.5.1 Authentication Required. Learn more at
):
  /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/smtp.rb:957:in `check_response'
  /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/smtp.rb:926:in `getok'
  /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/smtp.rb:841:in `mailfrom'
  /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/smtp.rb:662:in `send_message'
  mail (2.6.3) lib/mail/network/delivery_methods/smtp.rb:113:in `block in deliver!'
  /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/net/smtp.rb:521:in `start'
  mail (2.6.3) lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'
  mail (2.6.3) lib/mail/message.rb:2141:in `do_delivery'
  mail (2.6.3) lib/mail/message.rb:236:in `block in deliver'
  actionmailer (4.1.6) lib/action_mailer/base.rb:527:in `block in     deliver_mail'
   activesupport (4.1.6) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.1.6) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.1.6) lib/active_support/notifications.rb:159:in `instrument'
  actionmailer (4.1.6) lib/action_mailer/base.rb:525:in `deliver_mail'
  mail (2.6.3) lib/mail/message.rb:236:in `deliver'
  devise (3.4.1) lib/devise/models/authenticatable.rb:178:in     `send_devise_notification'
  devise (3.4.1) lib/devise/models/recoverable.rb:99:in `send_reset_password_instructions_notification'
  devise (3.4.1) lib/devise/models/recoverable.rb:49:in `send_reset_password_instructions'
  devise (3.4.1) lib/devise/models/recoverable.rb:116:in `send_reset_password_instructions'
   devise (3.4.1) app/controllers/devise/passwords_controller.rb:13:in `create'
  actionpack (4.1.6) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (4.1.6) lib/abstract_controller/base.rb:189:in `process_action'
  actionpack (4.1.6) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.1.6) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
  activesupport (4.1.6) lib/active_support/callbacks.rb:113:in `call'
  activesupport (4.1.6) lib/active_support/callbacks.rb:113:in `call'
  activesupport (4.1.6) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
  activesupport (4.1.6) lib/active_support/callbacks.rb:149:in `call'
  activesupport (4.1.6) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
  activesupport (4.1.6) lib/active_support/callbacks.rb:229:in `call'
  activesupport (4.1.6) lib/active_support/callbacks.rb:229:in `block in halting'
  activesupport (4.1.6) lib/active_support/callbacks.rb:229:in `call'
  activesupport (4.1.6) lib/active_support/callbacks.rb:229:in `block in halting'
  activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.6) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.6) lib/active_support/callbacks.rb:86:in `call'
  activesupport (4.1.6) lib/active_support/callbacks.rb:86:in `run_callbacks'
  actionpack (4.1.6) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (4.1.6) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.1.6) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
  activesupport (4.1.6) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.1.6) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.1.6) lib/active_support/notifications.rb:159:in `instrument'
  actionpack (4.1.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.1.6) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  activerecord (4.1.6) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (4.1.6) lib/abstract_controller/base.rb:136:in `process'
  actionview (4.1.6) lib/action_view/rendering.rb:30:in `process'
  actionpack (4.1.6) lib/action_controller/metal.rb:196:in `dispatch'
  actionpack (4.1.6) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.1.6) lib/action_controller/metal.rb:232:in `block in action'
  actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:82:in `call'
  actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
  actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:50:in `call'
  actionpack (4.1.6) lib/action_dispatch/routing/mapper.rb:45:in `call'
    actionpack (4.1.6) lib/action_dispatch/journey/router.rb:73:in `block in call'
    actionpack (4.1.6) lib/action_dispatch/journey/router.rb:59:in `each'
    actionpack (4.1.6) lib/action_dispatch/journey/router.rb:59:in `call'
    actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:678:in `call'
    omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
    omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
    warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
    warden (1.2.3) lib/warden/manager.rb:34:in `catch'
    warden (1.2.3) lib/warden/manager.rb:34:in `call'
    rack (1.5.2) lib/rack/etag.rb:23:in `call'
    rack (1.5.2) lib/rack/conditionalget.rb:35:in `call'
    rack (1.5.2) lib/rack/head.rb:11:in `call'
    actionpack (4.1.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
    actionpack (4.1.6) lib/action_dispatch/middleware/flash.rb:254:in `call'
    rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
    rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
    actionpack (4.1.6) lib/action_dispatch/middleware/cookies.rb:560:in `call'
    activerecord (4.1.6) lib/active_record/query_cache.rb:36:in `call'
    activerecord (4.1.6)       lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
   activerecord (4.1.6) lib/active_record/migration.rb:380:in `call'
    actionpack (4.1.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
    activesupport (4.1.6) lib/active_support/callbacks.rb:82:in `run_callbacks'
    actionpack (4.1.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
    actionpack (4.1.6) lib/action_dispatch/middleware/reloader.rb:73:in `call'
    actionpack (4.1.6) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
    actionpack (4.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
    actionpack (4.1.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
    railties (4.1.6) lib/rails/rack/logger.rb:38:in `call_app'
    railties (4.1.6) lib/rails/rack/logger.rb:20:in `block in call'
    activesupport (4.1.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
    activesupport (4.1.6) lib/active_support/tagged_logging.rb:26:in `tagged'
    activesupport (4.1.6) lib/active_support/tagged_logging.rb:68:in `tagged'
    railties (4.1.6) lib/rails/rack/logger.rb:20:in `call'
    actionpack (4.1.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
    rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
    rack (1.5.2) lib/rack/runtime.rb:17:in `call'
    activesupport (4.1.6)       lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
    rack (1.5.2) lib/rack/lock.rb:17:in `call'
    actionpack (4.1.6) lib/action_dispatch/middleware/static.rb:64:in `call'
    rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
    railties (4.1.6) lib/rails/engine.rb:514:in `call'
    railties (4.1.6) lib/rails/application.rb:144:in `call'
    rack (1.5.2) lib/rack/lock.rb:17:in `call'
    rack (1.5.2) lib/rack/content_length.rb:14:in `call'
    rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
    /usr/local/rvm/rubies/ruby-      2.1.5/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
    /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
    /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'

config/environments/development.rb:

# Show full error reports and disable caching.
config.consider_all_requests_local       = true
config.action_controller.perform_caching = false

# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = true

config.action_mailer.perform_deliveries = true

config.action_mailer.default_url_options = { :host => 'localhost:3000' }

config.action_mailer.delivery_method = :smtp


config.action_mailer.smtp_settings = {
   address: "smtp.gmail.com",
   port: 587,
   domain: ENV["gmail.com"],
   authentication: "plain",
   enable_starttls_auto: true,
   user_name: ENV["coolEmail@gmail.com"],
   password: ENV["coolPassword"],
   openssl_verify_mode: 'none',
}

Aucun commentaire:

Enregistrer un commentaire