Index: app/models/mail_handler.rb =================================================================== --- app/models/mail_handler.rb (revision 17805) +++ app/models/mail_handler.rb (working copy) @@ -237,7 +237,7 @@ end # ignore CLI-supplied defaults for new issues - handler_options[:issue].clear + handler_options[:issue] = {} journal = issue.init_journal(user) if from_journal && from_journal.private_notes? Index: test/functional/mail_handler_controller_test.rb =================================================================== --- test/functional/mail_handler_controller_test.rb (revision 17805) +++ test/functional/mail_handler_controller_test.rb (working copy) @@ -60,6 +60,20 @@ assert_equal true, issue.is_private end + def test_should_update_issue + # Enable API and set a key + Setting.mail_handler_api_enabled = 1 + Setting.mail_handler_api_key = 'secret' + + assert_difference 'Journal.count' do + post :index, :params => { + :key => 'secret', + :email => IO.read(File.join(FIXTURES_PATH, 'ticket_reply.eml')) + } + end + assert_response 201 + end + def test_should_respond_with_422_if_not_created Project.find('onlinestore').destroy