Defect #2032 ยป email_downcase.diff
| app/models/mail_handler.rb (working copy) | ||
|---|---|---|
|
# Processes incoming emails
|
||
|
def receive(email)
|
||
|
@email = email
|
||
|
@user = User.find_active(:first, :conditions => {:mail => email.from.first})
|
||
|
@user = User.find_active(:first, :conditions => {:mail => email.from.first.downcase})
|
||
|
unless @user
|
||
|
# Unknown user => the email is ignored
|
||
|
# TODO: ability to create the user's account
|
||
| app/models/user.rb (working copy) | ||
|---|---|---|
|
def before_save
|
||
|
# update hashed_password if password was set
|
||
|
self.hashed_password = User.hash_password(self.password) if self.password
|
||
|
self.mail.downcase!
|
||
|
end
|
||
|
def self.active
|
||