--- mail_handler.rb.old 2013-01-21 03:08:45.888910264 +0200 +++ mail_handler.rb 2013-01-21 21:08:16.000000000 +0200 @@ -332,6 +332,9 @@ # * 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 @@ -379,6 +382,9 @@ part = email.text_part || email.html_part || email @plain_text_body = Redmine::CodesetUtil.to_utf8(part.body.decoded, part.charset) + # preserve outlook style addresses, not really tags + @plain_text_body.sub! %r{<([^>'" @]+@[^>'" @]+)>}, '<\1>' + # strip html tags and remove doctype directive @plain_text_body = strip_tags(@plain_text_body.strip) @plain_text_body.sub! %r{^