Make use of User.find_by_mail

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2129 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-12-12 19:11:16 +00:00
parent a37f4b9cf6
commit dcf5ba1ea6
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ class MailHandler < ActionMailer::Base
# Processes incoming emails
def receive(email)
@email = email
@user = User.active.find(:first, :conditions => ["LOWER(mail) = ?", email.from.first.to_s.strip.downcase])
@user = User.active.find_by_mail(email.from.first.to_s.strip)
unless @user
# Unknown user => the email is ignored
# TODO: ability to create the user's account