##// END OF EJS Templates
remove ineffective "logger.info" and "logger.error" check from MailHandler model (#14598)...
Toshi MARUYAMA -
r11843:7711e37da4f4
parent child
Show More
@@ -76,7 +76,7 class MailHandler < ActionMailer::Base
76 76 sender_email = email.from.to_a.first.to_s.strip
77 77 # Ignore emails received from the application emission address to avoid hell cycles
78 78 if sender_email.downcase == Setting.mail_from.to_s.strip.downcase
79 if logger && logger.info
79 if logger
80 80 logger.info "MailHandler: ignoring email from Redmine emission address [#{sender_email}]"
81 81 end
82 82 return false
@@ -87,7 +87,7 class MailHandler < ActionMailer::Base
87 87 if value
88 88 value = value.to_s.downcase
89 89 if (ignored_value.is_a?(Regexp) && value.match(ignored_value)) || value == ignored_value
90 if logger && logger.info
90 if logger
91 91 logger.info "MailHandler: ignoring email with #{key}:#{value} header"
92 92 end
93 93 return false
@@ -96,7 +96,7 class MailHandler < ActionMailer::Base
96 96 end
97 97 @user = User.find_by_mail(sender_email) if sender_email.present?
98 98 if @user && !@user.active?
99 if logger && logger.info
99 if logger
100 100 logger.info "MailHandler: ignoring email from non-active user [#{@user.login}]"
101 101 end
102 102 return false
@@ -109,7 +109,7 class MailHandler < ActionMailer::Base
109 109 when 'create'
110 110 @user = create_user_from_email
111 111 if @user
112 if logger && logger.info
112 if logger
113 113 logger.info "MailHandler: [#{@user.login}] account created"
114 114 end
115 115 add_user_to_group(@@handler_options[:default_group])
@@ -117,14 +117,14 class MailHandler < ActionMailer::Base
117 117 Mailer.account_information(@user, @user.password).deliver
118 118 end
119 119 else
120 if logger && logger.error
120 if logger
121 121 logger.error "MailHandler: could not create account for [#{sender_email}]"
122 122 end
123 123 return false
124 124 end
125 125 else
126 126 # Default behaviour, emails from unknown users are ignored
127 if logger && logger.info
127 if logger
128 128 logger.info "MailHandler: ignoring email from unknown user [#{sender_email}]"
129 129 end
130 130 return false
@@ -195,7 +195,7 class MailHandler < ActionMailer::Base
195 195 add_watchers(issue)
196 196 issue.save!
197 197 add_attachments(issue)
198 logger.info "MailHandler: issue ##{issue.id} created by #{user}" if logger && logger.info
198 logger.info "MailHandler: issue ##{issue.id} created by #{user}" if logger
199 199 issue
200 200 end
201 201
@@ -224,7 +224,7 class MailHandler < ActionMailer::Base
224 224 journal.notes = cleaned_up_text_body
225 225 add_attachments(issue)
226 226 issue.save!
227 if logger && logger.info
227 if logger
228 228 logger.info "MailHandler: issue ##{issue.id} updated by #{user}"
229 229 end
230 230 journal
@@ -257,7 +257,7 class MailHandler < ActionMailer::Base
257 257 add_attachments(reply)
258 258 reply
259 259 else
260 if logger && logger.info
260 if logger
261 261 logger.info "MailHandler: ignoring reply from [#{sender_email}] to a locked topic"
262 262 end
263 263 end
General Comments 0
You need to be logged in to leave comments. Login now