Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

550 Cannot receive from specified address

I followed all the instructions on heroku and sendgrid but users receive an error when they try to sign up. I ran the logs and here is the error. What is wrong here?

2013-07-01 app[web.1]: Net::SMTPFatalError (550 Cannot receive from specified address <[email protected]>: Unauthenticated senders not allowed

my settings;

config/initializers/devise.rb

  config.mailer_sender = "[email protected]"

config/environments/production.rb

config.action_mailer.default_url_options = { :host => '***.herokuapp.com' }
ActionMailer::Base.smtp_settings = {
  :address        => "smtp.sendgrid.net",
  :port           => "25",
  :authentication => :plain,
  :user_name      => ENV['***@heroku.com'],
  :password       => ENV['***'],
  :domain         => ENV['heroku.com']
}
like image 422
Efe Avatar asked Jul 01 '13 06:07

Efe


People also ask

What does a 550 error code mean?

550 Blocked error or 550 Requested action not taken: mailbox unavailable is an SMTP (Simple Mail Transfer Protocol) error code. Put simply, this message means that the email you sent was blocked by the recipient's email hosting server, and returned to you.

What does envelope blocked mean?

Envelope blocked – User Entry. A personal block policy is in place for the email address/domain. Remove the email address/domain from the Managed Senders list.


1 Answers

You need to change the line where you are setting the username and password to be ENV['SENDGRID_USERNAME'] and ENV['SENDGRID_PASSWORD'], not your actual password. These values are stored on the server and should not appear in your code.

like image 103
bwest Avatar answered Sep 28 '22 17:09

bwest