]> source.dussan.org Git - redmine.git/commitdiff
mailhandler: fixes exit status and adds an explicit message if response code is 403.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 16 Sep 2008 21:56:02 +0000 (21:56 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 16 Sep 2008 21:56:02 +0000 (21:56 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1868 e93f8b46-1217-0410-a6f0-8f06a7374b81

extra/mail_handler/rdm-mailhandler.rb

index 498c2cb04a38bf6dd7ae6ca87ce5c0452108402f..0f8020c767bf001875fa5b0b765dab0a42df8349 100644 (file)
@@ -112,7 +112,10 @@ class RedmineMailHandler
     debug "Posting to #{uri}..."
     response = Net::HTTPS.post_form(URI.parse(uri), data)
     debug "Response received: #{response.code}"
-    response.code == 201 ? 0 : 1
+    
+    puts "Request was denied by your Redmine server. " + 
+         "Please, make sure that 'WS for incoming emails' is enabled in application settings and that you provided the correct API key." if response.code == '403'
+    response.code == '201' ? 0 : 1
   end
   
   private