Project

General

Profile

Filter chain halted as [:check_credential] rendered_or_redirected.

Added by Syn Admin about 15 years ago

I have my e-mail reaching my desired host from my mailhost but I am having trouble with it posting to Redmine... Here is the log output of what is happening with the message:

Processing MailHandlerController#index (for <IP_ADDRESS> at 2009-12-02 11:44:55) [POST]
  Session ID: dad625ae235a634f84ccbfde1a7dfcc8
  Parameters: {"action"=>"index", "allow_override"=>"", "controller"=>"mail_handler", "issue"=>{"project"=>"helpdesk"}, "key"=>"<THE_KEY>", "email"=>"From <MY_EMAIL_ADDRESS>  Wed Dec  2 11:44:48 2009\nReturn-Path: <MY_EMAIL_ADDRESS>\nX-Original-To: <REDMINE_EMAIL_ADDRESS>\nDelivered-To: <REDMINE_EMAIL_ADDRESS>\nReceived: from <MY_MAILHOST> (localhost.localdomain [127.0.0.1])\n\tby <MY_MAILHOST> (Postfix) with ESMTP id D2ADC68052\n\tfor <REDMINE_EMAIL_ADDRESS>; Wed,  2 Dec 2009 11:44:47 -0500 (EST)\nReceived: (from <MY_EMAIL_ADDRESS>)\n\tby <MY_MAILHOST> (8.13.8/8.13.8/Submit) id nB2Gil48031843;\n\tWed, 2 Dec 2009 11:44:47 -0500\nDate: Wed, 2 Dec 2009 11:44:47 -0500\nFrom: <ME> <MY_EMAIL_ADDRESS>\nMessage-Id: <200912021644.nB2Gil48031843@<MY_MAILHOST>\nTo: <REDMINE_EMAIL_ADDRESS>, TICKET@<MY_MAILHOST>\nSubject: NEW\n\n"}
Filter chain halted as [:check_credential] rendered_or_redirected.
Completed in 0.00037 (2739 reqs/sec) | Rendering: 0.00020 (53%) | DB: 0.00000 (0%) | 403 Forbidden [http://<MY_URL>/mail_handler]

I've googled around and found some (very limited) pages, but they don't appear relevant. I've looked at the source code and can't decipher why this is being called --- here's the code snippet that it hits:

mail_handler_controller.rb

class MailHandlerController < ActionController::Base
  before_filter :check_credential

  verify :method => :post,
         :only => :index,
         :render => { :nothing => true, :status => 405 }

  # Submits an incoming email to MailHandler
  def index
    options = params.dup
    email = options.delete(:email)
    if MailHandler.receive(email, options)
      render :nothing => true, :status => :created
    else
      render :nothing => true, :status => :unprocessable_entity
    end
  end

  private

_  def check_credential
    User.current = nil
    unless Setting.mail_handler_api_enabled? && params[:key] == Setting.mail_handler_api_key
      render :nothing => true, :status => 403
    end
  end
_end

Since I'm a totaly newb to ruby, I have no idea what I'm missing here - any help would be appreciated...


Replies (2)

RE: Filter chain halted as [:check_credential] rendered_or_redirected. - Added by Syn Admin about 15 years ago

Syn Admin wrote:

I have my e-mail reaching my desired host from my mailhost but I am having trouble with it posting to Redmine... Here is the log output of what is happening with the message:

[...]

I've googled around and found some (very limited) pages, but they don't appear relevant. I've looked at the source code and can't decipher why this is being called --- here's the code snippet that it hits:

mail_handler_controller.rb
[...]

Oh - I forgot to give my environment information (although I also get an error there checking)

# RAILS_ENV=production script/about
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- rails/info (MissingSourceFile)
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /var/www/vhosts/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in `require'
    from /var/www/vhosts/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:355:in `new_constants_in'
    from /var/www/vhosts/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in `require'
    from /var/www/vhosts/redmine/vendor/rails/railties/lib/commands/about.rb:2
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'

RE: 422 Unprocessable Entity - Added by Syn Admin about 15 years ago

The 403 error I got was fixed by adding a --tracker=support into my alias on my mailhost, now I'm having a different problem:

Processing MailHandlerController#index (for 174.137.225.177 at 2009-12-02 14:39:
49) [POST]
  Session ID: 4f2b1decac3a6636d9c7dd670c4c65e7  Parameters: {"unknown_user"=>"accept", "action"=>"index", "allow_override"=>"", "controller"=>"mail_handler", "issue"=>{"project"=>"helpdesk", "tracker"=>"support"}XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXSubject: TEST TICKET\n\nTEST TICKET\n\nProject: helpdesk\nTracker: support\n\n"}
Completed in 0.00367 (272 reqs/sec) | Rendering: 0.00023 (6%) | DB: 0.00152 (41%
) | 422 Unprocessable Entity [http://XXX/mail_handler]
    (1-2/2)