remove ineffective "logger.info" and "logger.error" check from MailHandler model (#14598)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12073 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f5658df8db
commit
7711e37da4
@ -76,7 +76,7 @@ class MailHandler < ActionMailer::Base
|
||||
sender_email = email.from.to_a.first.to_s.strip
|
||||
# Ignore emails received from the application emission address to avoid hell cycles
|
||||
if sender_email.downcase == Setting.mail_from.to_s.strip.downcase
|
||||
if logger && logger.info
|
||||
if logger
|
||||
logger.info "MailHandler: ignoring email from Redmine emission address [#{sender_email}]"
|
||||
end
|
||||
return false
|
||||
@ -87,7 +87,7 @@ class MailHandler < ActionMailer::Base
|
||||
if value
|
||||
value = value.to_s.downcase
|
||||
if (ignored_value.is_a?(Regexp) && value.match(ignored_value)) || value == ignored_value
|
||||
if logger && logger.info
|
||||
if logger
|
||||
logger.info "MailHandler: ignoring email with #{key}:#{value} header"
|
||||
end
|
||||
return false
|
||||
@ -96,7 +96,7 @@ class MailHandler < ActionMailer::Base
|
||||
end
|
||||
@user = User.find_by_mail(sender_email) if sender_email.present?
|
||||
if @user && !@user.active?
|
||||
if logger && logger.info
|
||||
if logger
|
||||
logger.info "MailHandler: ignoring email from non-active user [#{@user.login}]"
|
||||
end
|
||||
return false
|
||||
@ -109,7 +109,7 @@ class MailHandler < ActionMailer::Base
|
||||
when 'create'
|
||||
@user = create_user_from_email
|
||||
if @user
|
||||
if logger && logger.info
|
||||
if logger
|
||||
logger.info "MailHandler: [#{@user.login}] account created"
|
||||
end
|
||||
add_user_to_group(@@handler_options[:default_group])
|
||||
@ -117,14 +117,14 @@ class MailHandler < ActionMailer::Base
|
||||
Mailer.account_information(@user, @user.password).deliver
|
||||
end
|
||||
else
|
||||
if logger && logger.error
|
||||
if logger
|
||||
logger.error "MailHandler: could not create account for [#{sender_email}]"
|
||||
end
|
||||
return false
|
||||
end
|
||||
else
|
||||
# Default behaviour, emails from unknown users are ignored
|
||||
if logger && logger.info
|
||||
if logger
|
||||
logger.info "MailHandler: ignoring email from unknown user [#{sender_email}]"
|
||||
end
|
||||
return false
|
||||
@ -195,7 +195,7 @@ class MailHandler < ActionMailer::Base
|
||||
add_watchers(issue)
|
||||
issue.save!
|
||||
add_attachments(issue)
|
||||
logger.info "MailHandler: issue ##{issue.id} created by #{user}" if logger && logger.info
|
||||
logger.info "MailHandler: issue ##{issue.id} created by #{user}" if logger
|
||||
issue
|
||||
end
|
||||
|
||||
@ -224,7 +224,7 @@ class MailHandler < ActionMailer::Base
|
||||
journal.notes = cleaned_up_text_body
|
||||
add_attachments(issue)
|
||||
issue.save!
|
||||
if logger && logger.info
|
||||
if logger
|
||||
logger.info "MailHandler: issue ##{issue.id} updated by #{user}"
|
||||
end
|
||||
journal
|
||||
@ -257,7 +257,7 @@ class MailHandler < ActionMailer::Base
|
||||
add_attachments(reply)
|
||||
reply
|
||||
else
|
||||
if logger && logger.info
|
||||
if logger
|
||||
logger.info "MailHandler: ignoring reply from [#{sender_email}] to a locked topic"
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user