Cannot receive from specified address Unauthenticated senders not allowed

647 views
Skip to first unread message

Nishant Sharma

unread,
Nov 13, 2013, 8:13:59 AM11/13/13
to rubyonra...@googlegroups.com
On trying to run a rake task via crontab, I'm getting the following error:

    rake aborted!
    550 Cannot receive from specified address <he...@xyz.com>: Unauthenticated senders not allowed
    /mnt/voylla-production/shared/bundle/ruby/1.9.1/gems/mail-2.3.3/lib/mail/network/delivery_methods/smtp.rb:129:in `block in deliver!'
    /mnt/voylla-production/shared/bundle/ruby/1.9.1/gems/mail-2.3.3/lib/mail/network/delivery_methods/smtp.rb:128:in `deliver!'
    /mnt/voylla-production/shared/bundle/ruby/1.9.1/gems/mail-2.3.3/lib/mail/message.rb:1989:in `do_delivery'
    /mnt/voylla-production/shared/bundle/ruby/1.9.1/gems/mail-2.3.3/lib/mail/message.rb:230:in `block in deliver'
    /mnt/voylla-production/shared/bundle/ruby/1.9.1/gems/actionmailer-3.1.10/lib/action_mailer/base.rb:432:in `block in deliver_mail'
    /mnt/voylla-production/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.10/lib/active_support/notifications.rb:53:in `block in instrument'
    /mnt/voylla-production/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.10/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
    /mnt/voylla-production/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.10/lib/active_support/notifications.rb:53:in `instrument'
    /mnt/voylla-production/shared/bundle/ruby/1.9.1/gems/actionmailer-3.1.10/lib/action_mailer/base.rb:430:in `deliver_mail'
    /mnt/voylla-production/shared/bundle/ruby/1.9.1/gems/mail-2.3.3/lib/mail/message.rb:230:in `deliver'
    /mnt/voylla-production/releases/20131111011431/app/controllers/admin/order_query_controller.rb:255:in `send_last_2_days_orders'
    /mnt/voylla-production/releases/20131111011431/lib/tasks/env_setup.rake:116:in `block (2 levels) in <top (required)>'
    Tasks: TOP => maintenance:last_2_days_orders
    (See full trace by running task with --trace)


My production.rb is:

    config.action_mailer.delivery_method = :smtp
    config.action_mailer.raise_delivery_errors = true
    config.force_ssl = false
    config.i18n.fallbacks = true
    config.active_support.deprecation = :notify
    config.action_mailer.default_url_options = {:host =>'xyz.com'}
    config.action_mailer.smtp_settings = {
      :address        => 'smtp.sendgrid.net',
      :port           => '587',
      :authentication => :plain,
      :user_name      => ENV['SENDGRID_USERNAME'],
      :password       => ENV['SENDGRID_PASSWORD'],
      :domain         => 'xyz.com'
    }
    config.action_mailer.delivery_method = :smtp
    config.action_mailer.raise_delivery_errors = true
    config.action_mailer.default :from => "xyz Help <he...@xyz.com>"
    config.mailer_sender = "xyz Help <he...@xyz.com>"
    config.action_mailer.default_url_options = { :host => "xyz.com" }


I've looked through similar posts, and I feel my production.rb is configured correctly. So, I'm not able to figure out what's the problem.

Please could someone help. Thanks

**EDIT:** Could changes in Gemfile.lock casue this? My Gemfile.lock got changed, although I had reverted the changes later. It worked fine earlier.=

Tamara Temple

unread,
Nov 13, 2013, 11:43:33 PM11/13/13
to rubyonra...@googlegroups.com

On Nov 13, 2013, at 7:13 AM, Nishant Sharma <nishants...@gmail.com> wrote:

> On trying to run a rake task via crontab, I'm getting the following error:
>
> rake aborted!
> 550 Cannot receive from specified address <he...@xyz.com>: Unauthenticated senders not allowed

You should check that he...@xyz.com is in fact authenticated — make sure ENV['SENDGRID_USER'] and ENV['SENDGRID_PASSWORD'] are indeed correctly set in your production environment prior to starting up Rails.
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/eaabca66-6c76-412f-acb4-e23328fc1f3a%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Nishant Sharma

unread,
Nov 14, 2013, 7:16:59 AM11/14/13
to rubyonra...@googlegroups.com
Hi,

I am sure I have set the username and password correctly. Its working on staging environment.

Thanks
Reply all
Reply to author
Forward
0 new messages