Jan Dudulski
Jan Dudulski

Reputation: 843

Net::SMTPUnknownError (could not get 3xx (550)) when sending email from Rails app

I read many answers how should I set SPF record, spf documentation, but I'm still getting this error and I have no idea why.

I've got 2 servers, on the first one I've got example.com and on the second I'm running rails app under account.example.com.

I setup spf record: "v=spf1 a mx ip4:ip-of-second-server include:_spf.google.com -all"

My smtp settings:

config.action_mailer.smtp_settings = {
  :address => 'smtp.gmail.com',
  :port => 587,
  :domain => 'example.com',
  :authentication => 'plain',
  :user_name => ENV['GMAIL_USERNAME'],
  :password => ENV['GMAIL_PASSWORD']
}

Any idea what am I doing wrong?

Upvotes: 2

Views: 3619

Answers (1)

blotto
blotto

Reputation: 3407

We had a similar issue on our Heroku App using a gmail account to send us notifications. Not sure if you situation is exactly the same but this is how we recovered.

When a huge spike in mails occurred, Google marked the alias as 'exceeding sending limit' ( see http://support.google.com/a/bin/answer.py?hl=en&answer=166852) , and we began to see the 3xx 550 errors in our Heroku logs.

  1. we reenabled the account via Gmail ( see http://support.google.com/a/bin/answer.py?hl=en&answer=1071520)
  2. we added SPF record for our domain ( see http://support.google.com/a/bin/answer.py?hl=en&answer=178723)

this resolved our 3xx 550 errors.

Upvotes: 1

Related Questions