Project

General

Profile

Patch #12937 ยป mail_handler.patch

Dinu Marina, 2013-01-21 23:59

View differences:

mail_handler.rb 2013-01-21 21:08:16.000000000 +0200
# * parse the email To field
# * specific project (eg. Setting.mail_handler_target_project)
target = Project.find_by_identifier(get_keyword(:project))
if target.nil?
target = Project.find_by_identifier(@@handler_options[:issue][:project])
end
raise MissingInformation.new('Unable to determine target project') if target.nil?
target
end
......
part = email.text_part || email.html_part || email
@plain_text_body = Redmine::CodesetUtil.to_utf8(part.body.decoded, part.charset)
# preserve outlook <user@domain> style addresses, not really tags
@plain_text_body.sub! %r{<([^>'" @]+@[^>'" @]+)>}, '&lt;\1&gt;'
# strip html tags and remove doctype directive
@plain_text_body = strip_tags(@plain_text_body.strip)
@plain_text_body.sub! %r{^<!DOCTYPE .*$}, ''
    (1-1/1)