Devise: Net::SMTPSyntaxError when sending confirmation (SOLVED!)

Created on 23 Mar 2011  Â·  7Comments  Â·  Source: heartcombo/devise

Hi all,

I'm setting up a new devise app and i moved my views to my app/views/users folder (don't know if that makes a difference. Also, my routes look like this.

devise_for :users, :controllers => {:confirmations => "users/confirmations", :passwords => "users/passwords", :sessions => "users/sessions", :registrations => "users/registrations"} do
get 'login', :to => 'users/sessions#new'
post 'login', :to => 'users/sessions#create'
get 'sign_up', :to => 'users/registrations#new'
end

Also i have a file in my initializers folder called setup_mail.rb with this in it.

ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '25',
:domain => '*_.com',
:authentication => :plain,
:user_name => '_@gmail.com',
:password => '
*'
}

Ok so when I try to create a new account, I get this error

Net::SMTPSyntaxError in Users/registrationsController#create

501 Syntax error

Rails.root: /Users/node/Projects/memorysunnew
Application Trace | Framework Trace | Full Trace

app/controllers/users/registrations_controller.rb:23:in `create'

Request

Parameters:

{"utf8"=>"✓",
"authenticity_token"=>"bPYLI31WdtxiTnfDy8fFImYbyaGB4BnifkBYWDRsG5Y=",
"user"=>{"first_name"=>"joe",
"last_name"=>"doe",
"public_name"=>"jo",
"email"=>"[email protected]",
"password"=>"[FILTERED]",
"password_confirmation"=>"[FILTERED]",
"birthday(1i)"=>"1902",
"birthday(2i)"=>"4",
"birthday(3i)"=>"2",
"gender"=>"Male",
"terms"=>"1"},
"commit"=>"Create"}

Show session dump

Show env dump
Response

Headers:

None

I"m not sure whats making this givine me a syntax error. I haven't changed anything inside of the project. This seems like a bug in devise? Or maybe i'm over looking something simple?

Most helpful comment

Ok! so after about 2 hours of fighting and reading a lot of about what a 501 error was, I realized that the problem was in the devise.rb file in the initializers. The config.mailer_sender MUST be set to a valid formatted email address or else it breaks. I thought this was a label not an email for some weird reason. I hope this helps some poor soul.

All 7 comments

Sorry for the terrible markdown, I tried....

Ok! so after about 2 hours of fighting and reading a lot of about what a 501 error was, I realized that the problem was in the devise.rb file in the initializers. The config.mailer_sender MUST be set to a valid formatted email address or else it breaks. I thought this was a label not an email for some weird reason. I hope this helps some poor soul.

Thanks for pinging back. The config.mailer_sender there is explicitly stating to be replaced, but maybe we could have a default one that would not raise a 501 error.

Btw, what is not formatted properly here: "[email protected]" ? Am I missing something very obvious?

josevalim,
No it's explicit and actually I shouldn't have thought it could be changed to something different. I thought it would show up as the subject of the email. Maybe just a quick comment about it throwing a 501 error if it's not formatted properly?

It's really more of a dumb mistake on my part and I doubt many people do it. I could add a comment and push if you want. Thanks for taking the time to reply.

Putting it out there, I just encountered this error. In this case, the email of the user created was incorrect 'mailto:[email protected]'

YEESSSSS THANK YOU SO MUCH!!!! I was missing the sometext@ before my ending domain.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ragesoss picture ragesoss  Â·  3Comments

BimaPanduW picture BimaPanduW  Â·  3Comments

spaquet picture spaquet  Â·  3Comments

edipox picture edipox  Â·  4Comments

Gorchel picture Gorchel  Â·  3Comments