"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "app/models/mail_handler.rb" between
redmine-4.0.3.tar.gz and redmine-4.0.4.tar.gz

About: Redmine is a flexible project management and bug-tracking web application (using the Ruby on Rails framework). It supports also project wikis and forums, documents management, and multiple version control systems.

mail_handler.rb  (redmine-4.0.3):mail_handler.rb  (redmine-4.0.4)
skipping to change at line 57 skipping to change at line 57
mail = Mail.new(raw_mail) mail = Mail.new(raw_mail)
set_payload_for_mail(payload, mail) set_payload_for_mail(payload, mail)
new.receive(mail, options) new.receive(mail, options)
end end
end end
# Receives an email and rescues any exception # Receives an email and rescues any exception
def self.safe_receive(*args) def self.safe_receive(*args)
receive(*args) receive(*args)
rescue Exception => e rescue Exception => e
logger.error "MailHandler: an unexpected error occurred when receiving email : #{e.message}" if logger Rails.logger.error "MailHandler: an unexpected error occurred when receiving email: #{e.message}"
return false return false
end end
# Extracts MailHandler options from environment variables # Extracts MailHandler options from environment variables
# Use when receiving emails with rake tasks # Use when receiving emails with rake tasks
def self.extract_options_from_env(env) def self.extract_options_from_env(env)
options = {:issue => {}} options = {:issue => {}}
%w(project status tracker category priority assigned_to fixed_version).each do |option| %w(project status tracker category priority assigned_to fixed_version).each do |option|
options[:issue][option.to_sym] = env[option] if env[option] options[:issue][option.to_sym] = env[option] if env[option]
end end
skipping to change at line 290 skipping to change at line 290
if !message.locked? if !message.locked?
reply = Message.new(:subject => cleaned_up_subject.gsub(%r{^.*msg\d+\]}, '').strip, reply = Message.new(:subject => cleaned_up_subject.gsub(%r{^.*msg\d+\]}, '').strip,
:content => cleaned_up_text_body) :content => cleaned_up_text_body)
reply.author = user reply.author = user
reply.board = message.board reply.board = message.board
message.children << reply message.children << reply
add_attachments(reply) add_attachments(reply)
reply reply
else else
if logger if logger
logger.info "MailHandler: ignoring reply from [#{sender_email}] to a l ocked topic" logger.info "MailHandler: ignoring reply from [#{email.from.first}] to a locked topic"
end end
end end
end end
end end
def add_attachments(obj) def add_attachments(obj)
if email.attachments && email.attachments.any? if email.attachments && email.attachments.any?
email.attachments.each do |attachment| email.attachments.each do |attachment|
next unless accept_attachment?(attachment) next unless accept_attachment?(attachment)
next unless attachment.body.decoded.size > 0 next unless attachment.body.decoded.size > 0
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)