# 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
-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