プロジェクト

全般

プロフィール

Vote #71556

未完了

Error with rake redmine:email:receive_imap and cram-md5

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Email receiving_29
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
29
version_id:
33
issue_org_id:
10528
author_id:
20375
assigned_to_id:
0
comments:
1
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

rake -f ./Rakefile redmine:email:receive_imap RAILS_ENV="production" host= username= password= port= ssl=1 --trace
(in /srv/www/htdocs/redmine/)
** Invoke redmine:email:receive_imap (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:email:receive_imap
rake aborted!
Auth method not enabled
/usr/lib/ruby/1.8/net/imap.rb:981:in `pick_up_tagged_response'
/usr/lib/ruby/1.8/net/imap.rb:974:in `get_tagged_response'
/usr/lib/ruby/1.8/net/imap.rb:1032:in `send_command'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/1.8/net/imap.rb:1017:in `send_command'
/usr/lib/ruby/1.8/net/imap.rb:378:in `login'
/srv/www/htdocs/redmine/lib/redmine/imap.rb:30:in `check'
/srv/www/htdocs/redmine/lib/tasks/email.rake:134
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

The cause is /lib/redmine/imap.rb:

imap = Net::IMAP.new(host, port, ssl)
imap.login('LOGIN', imap_options[:username], imap_options[:password]) unless imap_options[:username].nil?

The solution is to change imap.login with imap.authenticate in /lib/redmine/imab.rb and take the auth type as a parameter:

      folder = imap_options[:folder] || 'INBOX'
 +    auth = imap_options[:auth] || 'LOGIN'


      imap = Net::IMAP.new(host, port, ssl)
 -    imap.login('LOGIN', imap_options[:username], imap_options[:password]) unless imap_options[:username].nil?
 +    imap.authenticate(imap_options[:auth], imap_options[:username], imap_options[:password]) unless imap_options[:username].nil?

Also need to modify /lib/tasks/email.rb:

       folder=FOLDER            IMAP folder to read (default: INBOX)
 +     auth=AUTH                IMAP authentication type (default: LOGIN)

       :folder => ENV['folder'],
 +     :auth => ENV['auth'],
       :move_on_success => ENV['move_on_success'],

This now runs succesfully:

rake -f ./Rakefile redmine:email:receive_imap RAILS_ENV="production" host= username= password= port= ssl=1 auth=CRAM-MD5 --trace


journals

--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリEmail receiving_29 にセット
  • 対象バージョンCandidate for next minor release_33 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0