Makes email address case-insensitive in MailHandler (#2032).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@1933 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-10-16 19:13:43 +00:00
parent a4b07a36ed
commit bc77cc2c5c
2 changed files with 3 additions and 3 deletions

View File

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