Commit dcf5ba1e authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Make use of User.find_by_mail

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2129 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent a37f4b9c
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment