Looking at the way the "global_prefs" routines are used to retrieve
the configuration values I am hesitant to use the same method to store
a userid/password combination for smtp authentication. Typing them
straight into email_settings.rb is one way but having them as
variables that can be configured through the admin interface would be
better. Anyone have an idea of how to store these securely in the
database and still use the global_prefs methods ?
Example email_settings.rb :
begin
unless test?
global_prefs = Preference.find(:first)
if global_prefs.email_notifications?
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => global_prefs.smtp_server,
:port => 25,
:domain => global_prefs.domain,
:authentication => :login,
:user_name => "xyz",
:password => "password"
}
end
end
rescue
# Rescue from the error raised upon first migrating
# (needed to bootstrap the preferences).
nil
end
--~--~---------~--~----~------------~-------~--~----~
Insoshi developer site: http://dogfood.insoshi.com/
Insoshi documentation: http://docs.insoshi.com/
You received this message because you are subscribed to the Google
Groups "Insoshi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/insoshi?hl=en
-~----------~----~----~----~------~----~------~--~---