##// END OF EJS Templates
Makes email address case-insensitive in MailHandler (#2032)....
Jean-Philippe Lang -
r1931:bc77cc2c5cc4
parent child
Show More
@@ -39,7 +39,7 class MailHandler < ActionMailer::Base
39 # Processes incoming emails
39 # Processes incoming emails
40 def receive(email)
40 def receive(email)
41 @email = email
41 @email = email
42 @user = User.find_active(:first, :conditions => {:mail => email.from.first})
42 @user = User.find_active(:first, :conditions => ["LOWER(mail) = ?", email.from.first.to_s.strip.downcase])
43 unless @user
43 unless @user
44 # Unknown user => the email is ignored
44 # Unknown user => the email is ignored
45 # TODO: ability to create the user's account
45 # TODO: ability to create the user's account
@@ -1,9 +1,9
1 Return-Path: <jsmith@somenet.foo>
1 Return-Path: <JSmith@somenet.foo>
2 Received: from osiris ([127.0.0.1])
2 Received: from osiris ([127.0.0.1])
3 by OSIRIS
3 by OSIRIS
4 with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200
4 with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200
5 Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>
5 Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>
6 From: "John Smith" <jsmith@somenet.foo>
6 From: "John Smith" <JSmith@somenet.foo>
7 To: <redmine@somenet.foo>
7 To: <redmine@somenet.foo>
8 Subject: New ticket on a given project
8 Subject: New ticket on a given project
9 Date: Sun, 22 Jun 2008 12:28:07 +0200
9 Date: Sun, 22 Jun 2008 12:28:07 +0200
General Comments 0
You need to be logged in to leave comments. Login now