0

I have a Rails 4.1 app with Devise (confirmable). I am using gmail for sending mail. It was working fine for 8-9 months. But has suddenly stopped sending any mails, confirmation , forgot password or resend confirmation since April 1 this year. There was no change to any config file in my latest commits. There is no error message in console and it shows mail being sent. But no mail is delivered. What could be the problem? Is it to do with gmail? The full trace:

/Users/sanjaysingh13/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/protocol.rb:153:in `read_nonblock'
/Users/sanjaysingh13/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/protocol.rb:153:in `rbuf_fill'
/Users/sanjaysingh13/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/protocol.rb:134:in `readuntil'
/Users/sanjaysingh13/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/protocol.rb:144:in `readline'
/Users/sanjaysingh13/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:938:in `recv_response'
/Users/sanjaysingh13/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:924:in `block in getok'
/Users/sanjaysingh13/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:948:in `critical'
/Users/sanjaysingh13/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:922:in `getok'
/Users/sanjaysingh13/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:830:in `helo'
/Users/sanjaysingh13/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:604:in `do_helo'
/Users/sanjaysingh13/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:556:in `do_start'
/Users/sanjaysingh13/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:520: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.7) lib/action_mailer/base.rb:527:in `block in deliver_mail'
activesupport (4.1.7) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.7) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.7) lib/active_support/notifications.rb:159:in `instrument'
actionmailer (4.1.7) lib/action_mailer/base.rb:525:in `deliver_mail'
mail (2.6.3) lib/mail/message.rb:236:in `deliver'
devise (3.5.2) lib/devise/models/authenticatable.rb:172:in `send_devise_notification'
devise (3.5.2) lib/devise/models/recoverable.rb:111:in `send_reset_password_instructions_notification'
devise (3.5.2) lib/devise/models/recoverable.rb:64:in `send_reset_password_instructions'
devise (3.5.2) lib/devise/models/recoverable.rb:128:in `send_reset_password_instructions'
devise (3.5.2) app/controllers/devise/passwords_controller.rb:13:in `create'
actionpack (4.1.7) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.1.7) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.1.7) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.1.7) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.1.7) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:229:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:149:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:229:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:86:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:86:in `run_callbacks'
actionpack (4.1.7) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.1.7) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.1.7) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.1.7) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.7) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.7) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.1.7) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.1.7) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.1.7) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.1.7) lib/abstract_controller/base.rb:136:in `process'
actionview (4.1.7) lib/action_view/rendering.rb:30:in `process'
actionpack (4.1.7) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.1.7) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.1.7) lib/action_controller/metal.rb:232:in `block in action'
actionpack (4.1.7) lib/action_dispatch/routing/route_set.rb:82:in `call'
actionpack (4.1.7) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
actionpack (4.1.7) lib/action_dispatch/routing/route_set.rb:50:in `call'
actionpack (4.1.7) lib/action_dispatch/routing/mapper.rb:45:in `call'
actionpack (4.1.7) lib/action_dispatch/journey/router.rb:73:in `block in call'
actionpack (4.1.7) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.7) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.7) lib/action_dispatch/routing/route_set.rb:678: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.5) lib/rack/etag.rb:23:in `call'
rack (1.5.5) lib/rack/conditionalget.rb:35:in `call'
rack (1.5.5) lib/rack/head.rb:11:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/flash.rb:254:in `call'
rack (1.5.5) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.5) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.1.7) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
activerecord (4.1.7) lib/active_record/migration.rb:380:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.7) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.7) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.7) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.7) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.7) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.7) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.7) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.7) lib/rails/rack/logger.rb:20:in `call'
request_store (1.2.0) lib/request_store/middleware.rb:8:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.5) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.7) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
rack (1.5.5) lib/rack/lock.rb:17:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/static.rb:84:in `call'
rack (1.5.5) lib/rack/sendfile.rb:112:in `call'
railties (4.1.7) lib/rails/engine.rb:514:in `call'
railties (4.1.7) lib/rails/application.rb:144:in `call'
rack (1.5.5) lib/rack/content_length.rb:14:in `call'
thin (1.6.3) lib/thin/connection.rb:86:in `block in pre_process'
thin (1.6.3) lib/thin/connection.rb:84:in `catch'
thin (1.6.3) lib/thin/connection.rb:84:in `pre_process'
thin (1.6.3) lib/thin/connection.rb:53:in `process'
thin (1.6.3) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run_machine'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
thin (1.6.3) lib/thin/backends/base.rb:73:in `start'
thin (1.6.3) lib/thin/server.rb:162:in `start'
rack (1.5.5) lib/rack/handler/thin.rb:16:in `run'
rack (1.5.5) lib/rack/server.rb:264:in `start'
railties (4.1.7) lib/rails/commands/server.rb:69:in `start'
railties (4.1.7) lib/rails/commands/commands_tasks.rb:81:in `block in server'
railties (4.1.7) lib/rails/commands/commands_tasks.rb:76:in `tap'
railties (4.1.7) lib/rails/commands/commands_tasks.rb:76:in `server'
railties (4.1.7) lib/rails/commands/commands_tasks.rb:40:in `run_command!'
railties (4.1.7) lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:8:in `require'
bin/rails:8:in `<top (required)>'
spring (1.3.6) lib/spring/client/rails.rb:28:in `load'
spring (1.3.6) lib/spring/client/rails.rb:28:in `call'
spring (1.3.6) lib/spring/client/command.rb:7:in `call'
spring (1.3.6) lib/spring/client.rb:26:in `run'
spring (1.3.6) bin/spring:48:in `<top (required)>'
spring (1.3.6) lib/spring/binstub.rb:11:in `load'
spring (1.3.6) lib/spring/binstub.rb:11:in `<top (required)>'
bin/spring:13:in `require'
bin/spring:13:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
victor sosa
  • 899
  • 13
  • 27
Sanjay Singh
  • 367
  • 1
  • 11
  • Actually, after some time gmail stops sending mails and requires login authentication, just login to the gmail account which you are using to send emails and it will start sending mails again! – Muhammad Ali Apr 18 '16 at 11:30

2 Answers2

1

Sorry for the trouble. I was doing something stupid. Was specifying my domain instead of "gmail.com" in the :domain settings for

`config.action_mailer.smtp_settings`
Sanjay Singh
  • 367
  • 1
  • 11
0

In you production.rb file active this:

config.action_mailer.raise_delivery_errors = true

Then you will start to see errors in the logs if something is happening when the emails are sent. Then you can make sense of what is the error.

Also gmail could be using Google 2-Step Verification which can block you system for sending email if it is not validated.

victor sosa
  • 899
  • 13
  • 27