ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ruby-rails
ruby-rails
[Rails] Salted Hash Login Generator + ActionMailer = :(
by Kimball Larsen other posts by this author
Sep 9 2005 9:07AM messages near this date
[Rails] Really slow redirects | Re: [Rails] Salted Hash Login Generator + ActionMailer = :(
I'm new to RoR - but learning quickly.

I've run through all the simple tutorials on how to start a basic RoR  
app, and have purchased the Agile book on RoR and gone through the  
web store tutorial it offers.

I'm now beginning a new application and am seemingly stuck almost  
before I've begun.

This application will require a valid username/password to access,  
and following the suggestion in the Agile book, I decided to try out  
the Salted Hash Login Generator.  Following the instructions found on  
the SHLG wiki: http://wiki.rubyonrails.com/rails/show/ 
SaltedLoginGeneratorQuickstart I was able (with some slight tweaking  
to accomodate a few extra fields I have in my users table) to get the  
login screen to appear.  "Great!" I thought - didn't take very long,  
and actually looks like it will work.  Course, my users table was at  
this point empty, so I hit the link to create a new account, filled  
in all the required info, and Boom (in your best Steve Job's voice) I  
get the following message:

"Error creating account: confirmation email not sent"

So, I crack open the development log to see what's up, and I see the  
following: (some items altered to protect the guilty)

Sent mail:
Date: Fri, 9 Sep 2005 09:57:49 -0600
From: valid@[...].com
To: testing@[...].com
Subject: [My App] Welcome to My App!
Content-Type: text/plain; charset=utf-8

Welcome to My App, jh kjh.

Your login credentials are:

   login:    testing2
   password: testing

Please click on the following link to confirm your registration:

<a href="http://localhost:3000/user/welcome?user[id] 
=21&key=176e10ed73abd23c2c1c4393d3099ac19a4d9ac5"> Click me!</a>

http://localhost:3000/user/welcome?user[id] 
=21&key=176e10ed73abd23c2c1c4393d3099ac19a4d9ac5

   SQL (0.079510)   ROLLBACK
Rendering  within layouts/scaffold
Rendering user/signup (200 OK)
Completed in 0.23645 (4 reqs/sec) | Rendering: 0.02537 (10%) | DB:  
0.08675 (36%) [http://localhost/user/signup]


So, I think to myself that the error must be with my email server...  
I must not have set up ActionMailer to do SMTP auth correctly.  Here  
are the settings (again, some items altered a bit): (this is from  
config/environments/development.rb):

ActionMailer::Base.server_settings = {
   :address =>  "192.168.1.4",
   :port =>  25,
   :domain =>  "domain.com",
   :username =>  "someTest@domain.com",
   :password =>  "Secret",
   :authentication =>  :login
}

So, after verifying that the settings in development.rb appear  
correct, I try again, with the same result.  Next I took a look at  
the mail server logs, and find that there is never even a connection  
attempt being made by my machine.  It's as though ActionMailer is  
just not trying. (or at least not trying hard enough...)

I've dug through the ActionMailer docs to see if I can make it any  
noisier about what is going wrong, but I can't find anything other  
than to redirect the logs it is already producing to another  
destination.

What may I be doing wrong?

Thanks!

-- Kimball 

_______________________________________________
Rails mailing list
Rails@[...].org
http://lists.rubyonrails.org/mailman/listinfo/rails
Thread:
Kimball Larsen
Kimball Larsen
Stephen Caudill
Derek Haynes
Kimball Larsen

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved