Fixed: MailHandler raises an error when processing an email without From header (#2916).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2553 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-03-06 18:25:19 +00:00
parent 02ecc8aa15
commit 009b685b1d
3 changed files with 46 additions and 1 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ class MailHandler < ActionMailer::Base
# Processes incoming emails
def receive(email)
@email = email
@user = User.active.find_by_mail(email.from.first.to_s.strip)
@user = User.active.find_by_mail(email.from.to_a.first.to_s.strip)
unless @user
# Unknown user => the email is ignored
# TODO: ability to create the user's account