diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 2f1eba3e9..bbb71e3c1 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -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 diff --git a/test/fixtures/mail_handler/ticket_on_given_project.eml b/test/fixtures/mail_handler/ticket_on_given_project.eml index 927dbc63e..5dbd0dc2e 100644 --- a/test/fixtures/mail_handler/ticket_on_given_project.eml +++ b/test/fixtures/mail_handler/ticket_on_given_project.eml @@ -1,9 +1,9 @@ -Return-Path: +Return-Path: Received: from osiris ([127.0.0.1]) by OSIRIS with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200 Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris> -From: "John Smith" +From: "John Smith" To: Subject: New ticket on a given project Date: Sun, 22 Jun 2008 12:28:07 +0200