patch

Patch - Andrew Fenn, 2010-05-27 12:02

Download (911 Bytes)

 
1
Index: app/models/mail_handler.rb
2
===================================================================
3
--- app/models/mail_handler.rb	(revision 3757)
4
+++ app/models/mail_handler.rb	(working copy)
5
@@ -49,10 +49,12 @@
6
       logger.info  "MailHandler: ignoring email from Redmine emission address [#{sender_email}]" if logger && logger.info
7
       return false
8
     end
9
-    @user = User.find_by_mail(sender_email)
10
-    if @user && !@user.active?
11
-      logger.info  "MailHandler: ignoring email from non-active user [#{@user.login}]" if logger && logger.info
12
-      return false
13
+    if !sender_email.empty?
14
+      @user = User.find_by_mail(sender_email)
15
+      if @user && !@user.active?
16
+        logger.info  "MailHandler: ignoring email from non-active user [#{@user.login}]" if logger && logger.info
17
+        return false
18
+      end
19
     end
20
     if @user.nil?
21
       # Email was submitted by an unknown user