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:
parent
a4b07a36ed
commit
bc77cc2c5c
|
@ -39,7 +39,7 @@ class MailHandler < ActionMailer::Base
|
||||||
# Processes incoming emails
|
# Processes incoming emails
|
||||||
def receive(email)
|
def receive(email)
|
||||||
@email = 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
|
unless @user
|
||||||
# Unknown user => the email is ignored
|
# Unknown user => the email is ignored
|
||||||
# TODO: ability to create the user's account
|
# TODO: ability to create the user's account
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
Return-Path: <jsmith@somenet.foo>
|
Return-Path: <JSmith@somenet.foo>
|
||||||
Received: from osiris ([127.0.0.1])
|
Received: from osiris ([127.0.0.1])
|
||||||
by OSIRIS
|
by OSIRIS
|
||||||
with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200
|
with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200
|
||||||
Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>
|
Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>
|
||||||
From: "John Smith" <jsmith@somenet.foo>
|
From: "John Smith" <JSmith@somenet.foo>
|
||||||
To: <redmine@somenet.foo>
|
To: <redmine@somenet.foo>
|
||||||
Subject: New ticket on a given project
|
Subject: New ticket on a given project
|
||||||
Date: Sun, 22 Jun 2008 12:28:07 +0200
|
Date: Sun, 22 Jun 2008 12:28:07 +0200
|
||||||
|
|
Loading…
Reference in New Issue