]> source.dussan.org Git - redmine.git/commitdiff
Makes email address case-insensitive in MailHandler (#2032).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 16 Oct 2008 19:13:43 +0000 (19:13 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 16 Oct 2008 19:13:43 +0000 (19:13 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@1933 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/mail_handler.rb
test/fixtures/mail_handler/ticket_on_given_project.eml

index 2f1eba3e951ae9df4a977d3256dab4d1e2634485..bbb71e3c1086c08db1bad0fbfd71073528f57664 100644 (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
index 927dbc63e8cc9554bf9e58b004d576b0f87a50c2..5dbd0dc2e9917b4242db4763897f42d53d8ca99b 100644 (file)
@@ -1,9 +1,9 @@
-Return-Path: <jsmith@somenet.foo>\r
+Return-Path: <JSmith@somenet.foo>\r
 Received: from osiris ([127.0.0.1])\r
        by OSIRIS\r
        with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200\r
 Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>\r
-From: "John Smith" <jsmith@somenet.foo>\r
+From: "John Smith" <JSmith@somenet.foo>\r
 To: <redmine@somenet.foo>\r
 Subject: New ticket on a given project\r
 Date: Sun, 22 Jun 2008 12:28:07 +0200\r